Differential D19249 Diff 46088 src/applications/repository/storage/PhabricatorRepositoryPushEvent.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryPushEvent.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Groups a set of push logs corresponding to changes which were all pushed in | * Groups a set of push logs corresponding to changes which were all pushed in | ||||
| * the same transaction. | * the same transaction. | ||||
| */ | */ | ||||
| final class PhabricatorRepositoryPushEvent | final class PhabricatorRepositoryPushEvent | ||||
| extends PhabricatorRepositoryDAO | extends PhabricatorRepositoryDAO | ||||
| implements PhabricatorPolicyInterface { | implements PhabricatorPolicyInterface { | ||||
| protected $repositoryPHID; | protected $repositoryPHID; | ||||
| protected $epoch; | protected $epoch; | ||||
| protected $pusherPHID; | protected $pusherPHID; | ||||
| protected $requestIdentifier; | |||||
| protected $remoteAddress; | protected $remoteAddress; | ||||
| protected $remoteProtocol; | protected $remoteProtocol; | ||||
| protected $rejectCode; | protected $rejectCode; | ||||
| protected $rejectDetails; | protected $rejectDetails; | ||||
| private $repository = self::ATTACHABLE; | private $repository = self::ATTACHABLE; | ||||
| private $logs = self::ATTACHABLE; | private $logs = self::ATTACHABLE; | ||||
| public static function initializeNewEvent(PhabricatorUser $viewer) { | public static function initializeNewEvent(PhabricatorUser $viewer) { | ||||
| return id(new PhabricatorRepositoryPushEvent()) | return id(new PhabricatorRepositoryPushEvent()) | ||||
| ->setPusherPHID($viewer->getPHID()); | ->setPusherPHID($viewer->getPHID()); | ||||
| } | } | ||||
| protected function getConfiguration() { | protected function getConfiguration() { | ||||
| return array( | return array( | ||||
| self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
| self::CONFIG_TIMESTAMPS => false, | self::CONFIG_TIMESTAMPS => false, | ||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| 'requestIdentifier' => 'bytes12?', | |||||
| 'remoteAddress' => 'ipaddress?', | 'remoteAddress' => 'ipaddress?', | ||||
| 'remoteProtocol' => 'text32?', | 'remoteProtocol' => 'text32?', | ||||
| 'rejectCode' => 'uint32', | 'rejectCode' => 'uint32', | ||||
| 'rejectDetails' => 'text64?', | 'rejectDetails' => 'text64?', | ||||
| ), | ), | ||||
| self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
| 'key_repository' => array( | 'key_repository' => array( | ||||
| 'columns' => array('repositoryPHID'), | 'columns' => array('repositoryPHID'), | ||||
| ), | ), | ||||
| 'key_request' => array( | |||||
| 'columns' => array('requestIdentifier'), | |||||
| 'unique' => true, | |||||
| ), | |||||
| ), | ), | ||||
| ) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
| } | } | ||||
| public function generatePHID() { | public function generatePHID() { | ||||
| return PhabricatorPHID::generateNewPHID( | return PhabricatorPHID::generateNewPHID( | ||||
| PhabricatorRepositoryPushEventPHIDType::TYPECONST); | PhabricatorRepositoryPushEventPHIDType::TYPECONST); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||