Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15333507
D21382.id50908.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D21382.id50908.diff
View Options
diff --git a/src/workflow/ArcanistUploadWorkflow.php b/src/workflow/ArcanistUploadWorkflow.php
--- a/src/workflow/ArcanistUploadWorkflow.php
+++ b/src/workflow/ArcanistUploadWorkflow.php
@@ -141,83 +141,4 @@
$this->writeStatusMessage($line."\n");
}
- private function uploadChunks($file_phid, $path) {
- $conduit = $this->getConduit();
-
- $f = @fopen($path, 'rb');
- if (!$f) {
- throw new Exception(pht('Unable to open file "%s"', $path));
- }
-
- $this->writeStatus(pht('Beginning chunked upload of large file...'));
- $chunks = $conduit->resolveCall(
- 'file.querychunks',
- array(
- 'filePHID' => $file_phid,
- ));
-
- $remaining = array();
- foreach ($chunks as $chunk) {
- if (!$chunk['complete']) {
- $remaining[] = $chunk;
- }
- }
-
- $done = (count($chunks) - count($remaining));
-
- if ($done) {
- $this->writeStatus(
- pht(
- 'Resuming upload (%s of %s chunks remain).',
- phutil_count($remaining),
- phutil_count($chunks)));
- } else {
- $this->writeStatus(
- pht(
- 'Uploading chunks (%s chunks to upload).',
- phutil_count($remaining)));
- }
-
- $progress = new PhutilConsoleProgressBar();
- $progress->setTotal(count($chunks));
-
- for ($ii = 0; $ii < $done; $ii++) {
- $progress->update(1);
- }
-
- $progress->draw();
-
- // TODO: We could do these in parallel to improve upload performance.
- foreach ($remaining as $chunk) {
- $offset = $chunk['byteStart'];
-
- $ok = fseek($f, $offset);
- if ($ok !== 0) {
- throw new Exception(
- pht(
- 'Failed to %s!',
- 'fseek()'));
- }
-
- $data = fread($f, $chunk['byteEnd'] - $chunk['byteStart']);
- if ($data === false) {
- throw new Exception(
- pht(
- 'Failed to %s!',
- 'fread()'));
- }
-
- $conduit->resolveCall(
- 'file.uploadchunk',
- array(
- 'filePHID' => $file_phid,
- 'byteStart' => $offset,
- 'dataEncoding' => 'base64',
- 'data' => base64_encode($data),
- ));
-
- $progress->update(1);
- }
- }
-
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 9, 2:41 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7332922
Default Alt Text
D21382.id50908.diff (2 KB)
Attached To
Mode
D21382: Remove an unused method in "ArcanistUploadWorkflow"
Attached
Detach File
Event Timeline
Log In to Comment