Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/conduit/FileAllocateConduitAPIMethod.php
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
if ($ttl) { | if ($ttl) { | ||||
$properties['ttl.absolute'] = $ttl; | $properties['ttl.absolute'] = $ttl; | ||||
} | } | ||||
$file = null; | $file = null; | ||||
if ($hash !== null) { | if ($hash !== null) { | ||||
$file = PhabricatorFile::newFileFromContentHash( | $file = PhabricatorFile::newFileFromContentHash( | ||||
$hash, | $hash, | ||||
$properties); | $properties, | ||||
$viewer); | |||||
} | } | ||||
if ($hash !== null && !$file) { | if ($hash !== null && !$file) { | ||||
$chunked_hash = PhabricatorChunkedFileStorageEngine::getChunkedHash( | $chunked_hash = PhabricatorChunkedFileStorageEngine::getChunkedHash( | ||||
$viewer, | $viewer, | ||||
$hash); | $hash); | ||||
$file = id(new PhabricatorFileQuery()) | $file = id(new PhabricatorFileQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |