Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
| Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | final class PhabricatorFile extends PhabricatorFileDAO | ||||
| protected $ttl; | protected $ttl; | ||||
| protected $isExplicitUpload = 1; | protected $isExplicitUpload = 1; | ||||
| protected $viewPolicy = PhabricatorPolicies::POLICY_USER; | protected $viewPolicy = PhabricatorPolicies::POLICY_USER; | ||||
| protected $isPartial = 0; | protected $isPartial = 0; | ||||
| private $objects = self::ATTACHABLE; | private $objects = self::ATTACHABLE; | ||||
| private $objectPHIDs = self::ATTACHABLE; | private $objectPHIDs = self::ATTACHABLE; | ||||
| private $originalFile = self::ATTACHABLE; | private $originalFile = self::ATTACHABLE; | ||||
| private $transforms = self::ATTACHABLE; | |||||
| public static function initializeNewFile() { | public static function initializeNewFile() { | ||||
| $app = id(new PhabricatorApplicationQuery()) | $app = id(new PhabricatorApplicationQuery()) | ||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withClasses(array('PhabricatorFilesApplication')) | ->withClasses(array('PhabricatorFilesApplication')) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| $view_policy = $app->getPolicy( | $view_policy = $app->getPolicy( | ||||
| ▲ Show 20 Lines • Show All 1,136 Lines • ▼ Show 20 Lines | public function getRedirectResponse() { | ||||
| $is_external = strlen(id(new PhutilURI($uri))->getDomain()); | $is_external = strlen(id(new PhutilURI($uri))->getDomain()); | ||||
| return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
| ->setIsExternal($is_external) | ->setIsExternal($is_external) | ||||
| ->setURI($uri); | ->setURI($uri); | ||||
| } | } | ||||
| public function attachTransforms(array $map) { | |||||
| $this->transforms = $map; | |||||
| return $this; | |||||
| } | |||||
| public function getTransform($key) { | |||||
| return $this->assertAttachedKey($this->transforms, $key); | |||||
| } | |||||
| /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
| public function getApplicationTransactionEditor() { | public function getApplicationTransactionEditor() { | ||||
| return new PhabricatorFileEditor(); | return new PhabricatorFileEditor(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines | |||||