mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 20:52:43 +01:00
b51a859636
Summary:
Fixes T10186. After D14970, `diffusion.filecontentquery` puts the content in a file and returns the file PHID.
However, it does this in a way that doesn't go through the chunking engine, so it will fail for files larger than the chunk threshold (generally, 8MB).
Instead, stream the file from the underlying command directly into chunked storage.
Test Plan:
- Made a commit including a really big file: 4dcd4c492b
- Used `diffusion.filecontentquery` to load file content.
- Parsed/imported commit locally.
- Used `diffusion.filecontentquery` to load content for smaller files (README, etc).
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T10186
Differential Revision: https://secure.phabricator.com/D15072
28 lines
519 B
PHP
28 lines
519 B
PHP
<?php
|
|
|
|
final class PhabricatorExecFutureFileUploadSource
|
|
extends PhabricatorFileUploadSource {
|
|
|
|
private $future;
|
|
|
|
public function setExecFuture(ExecFuture $future) {
|
|
$this->future = $future;
|
|
return $this;
|
|
}
|
|
|
|
public function getExecFuture() {
|
|
return $this->future;
|
|
}
|
|
|
|
protected function newDataIterator() {
|
|
$future = $this->getExecFuture();
|
|
|
|
return id(new LinesOfALargeExecFuture($future))
|
|
->setDelimiter(null);
|
|
}
|
|
|
|
protected function getDataLength() {
|
|
return null;
|
|
}
|
|
|
|
}
|