Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
Show First 20 Lines • Show All 780 Lines • ▼ Show 20 Lines | public static function hashFileContent($data) { | ||||
return $hash; | return $hash; | ||||
} | } | ||||
public function loadFileData() { | public function loadFileData() { | ||||
$iterator = $this->getFileDataIterator(); | $iterator = $this->getFileDataIterator(); | ||||
return $this->loadDataFromIterator($iterator); | return $this->loadDataFromIterator($iterator); | ||||
} | } | ||||
public function newFileDataIteratorFuture($begin = null, $end = null) { | |||||
$engine = $this->instantiateStorageEngine(); | |||||
$format = $this->newStorageFormat(); | |||||
return $engine->newRawFileDataIteratorFuture( | |||||
$this, | |||||
$begin, | |||||
$end, | |||||
$format); | |||||
} | |||||
/** | /** | ||||
* Return an iterable which emits file content bytes. | * Return an iterable which emits file content bytes. | ||||
* | * | ||||
* @param int Offset for the start of data. | * @param int Offset for the start of data. | ||||
* @param int Offset for the end of data. | * @param int Offset for the end of data. | ||||
* @return Iterable Iterable object which emits requested data. | * @return Iterable Iterable object which emits requested data. | ||||
*/ | */ | ||||
public function getFileDataIterator($begin = null, $end = null) { | public function getFileDataIterator($begin = null, $end = null) { | ||||
$engine = $this->instantiateStorageEngine(); | return $this->newFileDataIteratorFuture($begin, $end) | ||||
->resolve(); | |||||
$format = $this->newStorageFormat(); | |||||
$iterator = $engine->getRawFileDataIterator( | |||||
$this, | |||||
$begin, | |||||
$end, | |||||
$format); | |||||
return $iterator; | |||||
} | } | ||||
public function getURI() { | public function getURI() { | ||||
return $this->getInfoURI(); | return $this->getInfoURI(); | ||||
} | } | ||||
public function getViewURI() { | public function getViewURI() { | ||||
if (!$this->getPHID()) { | if (!$this->getPHID()) { | ||||
▲ Show 20 Lines • Show All 874 Lines • Show Last 20 Lines |