Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/uploadsource/PhabricatorFileUploadSource.php
| Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | private function writeChunkedFile() { | ||||
| $data_length = $this->getDataLength(); | $data_length = $this->getDataLength(); | ||||
| if ($data_length !== null) { | if ($data_length !== null) { | ||||
| $length = $data_length; | $length = $data_length; | ||||
| } else { | } else { | ||||
| $length = 0; | $length = 0; | ||||
| } | } | ||||
| $file = PhabricatorFile::newChunkedFile($engine, $length, $parameters); | $file = PhabricatorFile::newChunkedFile($engine, $length, $parameters); | ||||
| $file->save(); | $file->saveAndIndex(); | ||||
| $rope = $this->getRope(); | $rope = $this->getRope(); | ||||
| // Read the source, writing chunks as we get enough data. | // Read the source, writing chunks as we get enough data. | ||||
| while ($this->readFileData()) { | while ($this->readFileData()) { | ||||
| while (true) { | while (true) { | ||||
| $rope_length = $rope->getByteLength(); | $rope_length = $rope->getByteLength(); | ||||
| if ($rope_length < $engine->getChunkSize()) { | if ($rope_length < $engine->getChunkSize()) { | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||