Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/engine/PhabricatorS3FileStorageEngine.php
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | public function writeFile($data, array $params) { | ||||
return $name; | return $name; | ||||
} | } | ||||
/** | /** | ||||
* Load a stored blob from Amazon S3. | * Load a stored blob from Amazon S3. | ||||
*/ | */ | ||||
public function readFile($handle) { | public function readFile($handle) { | ||||
$s3 = $this->newS3API(); | return $this->newRawReadFuture()->resolve(); | ||||
$profiler = PhutilServiceProfiler::getInstance(); | |||||
$call_id = $profiler->beginServiceCall( | |||||
array( | |||||
'type' => 's3', | |||||
'method' => 'getObject', | |||||
)); | |||||
$result = $s3 | |||||
->setParametersForGetObject($handle) | |||||
->resolve(); | |||||
$profiler->endServiceCall($call_id, array()); | |||||
return $result; | |||||
} | } | ||||
protected function newRawReadFuture($handle) { | |||||
return $this->newS3API() | |||||
->setParametersForGetObject($handle); | |||||
} | |||||
/** | /** | ||||
* Delete a blob from Amazon S3. | * Delete a blob from Amazon S3. | ||||
*/ | */ | ||||
public function deleteFile($handle) { | public function deleteFile($handle) { | ||||
$s3 = $this->newS3API(); | $s3 = $this->newS3API(); | ||||
AphrontWriteGuard::willWrite(); | AphrontWriteGuard::willWrite(); | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |