Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
Show First 20 Lines • Show All 486 Lines • ▼ Show 20 Lines | public function migrateToStorageFormat(PhabricatorFileStorageFormat $format) { | ||||
$engine = $this->instantiateStorageEngine(); | $engine = $this->instantiateStorageEngine(); | ||||
$old_handle = $this->getStorageHandle(); | $old_handle = $this->getStorageHandle(); | ||||
$properties = $format->newStorageProperties(); | $properties = $format->newStorageProperties(); | ||||
$this->setStorageFormat($format->getStorageFormatKey()); | $this->setStorageFormat($format->getStorageFormatKey()); | ||||
$this->setStorageProperties($properties); | $this->setStorageProperties($properties); | ||||
list($identifier, $new_handle) = $this->writeToEngine( | list($identifier, $new_handle, $integrity_hash) = $this->writeToEngine( | ||||
$engine, | $engine, | ||||
$data, | $data, | ||||
$params); | $params); | ||||
$this->setStorageHandle($new_handle); | $this->setStorageHandle($new_handle); | ||||
$this->setIntegrityHash($integrity_hash); | |||||
$this->save(); | $this->save(); | ||||
$this->deleteFileDataIfUnused( | $this->deleteFileDataIfUnused( | ||||
$engine, | $engine, | ||||
$identifier, | $identifier, | ||||
$old_handle); | $old_handle); | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 1,181 Lines • Show Last 20 Lines |