Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | final class PhabricatorRepository extends PhabricatorRepositoryDAO | ||||
| protected $name; | protected $name; | ||||
| protected $callsign; | protected $callsign; | ||||
| protected $repositorySlug; | protected $repositorySlug; | ||||
| protected $uuid; | protected $uuid; | ||||
| protected $viewPolicy; | protected $viewPolicy; | ||||
| protected $editPolicy; | protected $editPolicy; | ||||
| protected $pushPolicy; | protected $pushPolicy; | ||||
| protected $profileImagePHID; | |||||
| protected $versionControlSystem; | protected $versionControlSystem; | ||||
| protected $details = array(); | protected $details = array(); | ||||
| protected $credentialPHID; | protected $credentialPHID; | ||||
| protected $almanacServicePHID; | protected $almanacServicePHID; | ||||
| protected $spacePHID; | protected $spacePHID; | ||||
| protected $localPath; | protected $localPath; | ||||
| private $commitCount = self::ATTACHABLE; | private $commitCount = self::ATTACHABLE; | ||||
| private $mostRecentCommit = self::ATTACHABLE; | private $mostRecentCommit = self::ATTACHABLE; | ||||
| private $projectPHIDs = self::ATTACHABLE; | private $projectPHIDs = self::ATTACHABLE; | ||||
| private $uris = self::ATTACHABLE; | private $uris = self::ATTACHABLE; | ||||
| private $profileImageFile = self::ATTACHABLE; | |||||
| public static function initializeNewRepository(PhabricatorUser $actor) { | public static function initializeNewRepository(PhabricatorUser $actor) { | ||||
| $app = id(new PhabricatorApplicationQuery()) | $app = id(new PhabricatorApplicationQuery()) | ||||
| ->setViewer($actor) | ->setViewer($actor) | ||||
| ->withClasses(array('PhabricatorDiffusionApplication')) | ->withClasses(array('PhabricatorDiffusionApplication')) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| Show All 25 Lines | return array( | ||||
| 'callsign' => 'sort32?', | 'callsign' => 'sort32?', | ||||
| 'repositorySlug' => 'sort64?', | 'repositorySlug' => 'sort64?', | ||||
| 'versionControlSystem' => 'text32', | 'versionControlSystem' => 'text32', | ||||
| 'uuid' => 'text64?', | 'uuid' => 'text64?', | ||||
| 'pushPolicy' => 'policy', | 'pushPolicy' => 'policy', | ||||
| 'credentialPHID' => 'phid?', | 'credentialPHID' => 'phid?', | ||||
| 'almanacServicePHID' => 'phid?', | 'almanacServicePHID' => 'phid?', | ||||
| 'localPath' => 'text128?', | 'localPath' => 'text128?', | ||||
| 'profileImagePHID' => 'phid?', | |||||
| ), | ), | ||||
| self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
| 'callsign' => array( | 'callsign' => array( | ||||
| 'columns' => array('callsign'), | 'columns' => array('callsign'), | ||||
| 'unique' => true, | 'unique' => true, | ||||
| ), | ), | ||||
| 'key_name' => array( | 'key_name' => array( | ||||
| 'columns' => array('name(128)'), | 'columns' => array('name(128)'), | ||||
| ▲ Show 20 Lines • Show All 352 Lines • ▼ Show 20 Lines | if (!preg_match('/^[A-Z]+\z/', $callsign)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'The callsign "%s" is not a valid repository callsign. Callsigns '. | 'The callsign "%s" is not a valid repository callsign. Callsigns '. | ||||
| 'may only contain UPPERCASE letters.', | 'may only contain UPPERCASE letters.', | ||||
| $callsign)); | $callsign)); | ||||
| } | } | ||||
| } | } | ||||
| public function getProfileImageURI() { | |||||
| return $this->getProfileImageFile()->getBestURI(); | |||||
| } | |||||
| public function attachProfileImageFile(PhabricatorFile $file) { | |||||
| $this->profileImageFile = $file; | |||||
| return $this; | |||||
| } | |||||
| public function getProfileImageFile() { | |||||
| return $this->assertAttached($this->profileImageFile); | |||||
| } | |||||
| /* -( Remote Command Execution )------------------------------------------- */ | /* -( Remote Command Execution )------------------------------------------- */ | ||||
| public function execRemoteCommand($pattern /* , $arg, ... */) { | public function execRemoteCommand($pattern /* , $arg, ... */) { | ||||
| $args = func_get_args(); | $args = func_get_args(); | ||||
| return $this->newRemoteCommandFuture($args)->resolve(); | return $this->newRemoteCommandFuture($args)->resolve(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,116 Lines • Show Last 20 Lines | |||||