Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
| Show First 20 Lines • Show All 1,146 Lines • ▼ Show 20 Lines | foreach ($builtins as $key => $builtin) { | ||||
| if (isset($results[$key])) { | if (isset($results[$key])) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $data = $builtin->loadBuiltinFileData(); | $data = $builtin->loadBuiltinFileData(); | ||||
| $params = array( | $params = array( | ||||
| 'name' => $builtin->getBuiltinDisplayName(), | 'name' => $builtin->getBuiltinDisplayName(), | ||||
| 'ttl.relative' => phutil_units('7 days in seconds'), | |||||
| 'canCDN' => true, | 'canCDN' => true, | ||||
| 'builtin' => $key, | 'builtin' => $key, | ||||
| ); | ); | ||||
| $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
| try { | try { | ||||
| $file = self::newFromFileData($data, $params); | $file = self::newFromFileData($data, $params); | ||||
| } catch (AphrontDuplicateKeyQueryException $ex) { | } catch (AphrontDuplicateKeyQueryException $ex) { | ||||
| ▲ Show 20 Lines • Show All 479 Lines • ▼ Show 20 Lines | return array( | ||||
| ->setType('int') | ->setType('int') | ||||
| ->setDescription(pht('File size, in bytes.')), | ->setDescription(pht('File size, in bytes.')), | ||||
| ); | ); | ||||
| } | } | ||||
| public function getFieldValuesForConduit() { | public function getFieldValuesForConduit() { | ||||
| return array( | return array( | ||||
| 'name' => $this->getName(), | 'name' => $this->getName(), | ||||
| 'dataURI' => $this->getCDNURI(), | 'dataURI' => $this->getCDNURI('data'), | ||||
| 'size' => (int)$this->getByteSize(), | 'size' => (int)$this->getByteSize(), | ||||
| ); | ); | ||||
| } | } | ||||
| public function getConduitSearchAttachments() { | public function getConduitSearchAttachments() { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| Show All 11 Lines | |||||