Differential D18953 Diff 45477 src/applications/search/controller/PhabricatorApplicationSearchController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/controller/PhabricatorApplicationSearchController.php
| Show First 20 Lines • Show All 455 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| $format->addHeaders($field_list); | $format->addHeaders($field_list); | ||||
| for ($ii = 0; $ii < count($objects); $ii++) { | for ($ii = 0; $ii < count($objects); $ii++) { | ||||
| $format->addObject($objects[$ii], $field_list, $export_data[$ii]); | $format->addObject($objects[$ii], $field_list, $export_data[$ii]); | ||||
| } | } | ||||
| $export_result = $format->newFileData(); | $export_result = $format->newFileData(); | ||||
| $file = PhabricatorFile::newFromFileData( | // We have all the data in one big string and aren't actually | ||||
| $export_result, | // streaming it, but pretending that we are allows us to actviate | ||||
| array( | // the chunk engine and store large files. | ||||
| 'name' => $filename, | $iterator = new ArrayIterator(array($export_result)); | ||||
| 'authorPHID' => $viewer->getPHID(), | |||||
| 'ttl.relative' => phutil_units('15 minutes in seconds'), | $source = id(new PhabricatorIteratorFileUploadSource()) | ||||
| 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, | ->setName($filename) | ||||
| 'mime-type' => $mime_type, | ->setViewPolicy(PhabricatorPolicies::POLICY_NOONE) | ||||
| )); | ->setMIMEType($mime_type) | ||||
| ->setRelativeTTL(phutil_units('60 minutes in seconds')) | |||||
| ->setAuthorPHID($viewer->getPHID()) | |||||
| ->setIterator($iterator); | |||||
| $file = $source->uploadFile(); | |||||
| return $this->newDialog() | return $this->newDialog() | ||||
| ->setTitle(pht('Download Results')) | ->setTitle(pht('Download Results')) | ||||
| ->appendParagraph( | ->appendParagraph( | ||||
| pht('Click the download button to download the exported data.')) | pht('Click the download button to download the exported data.')) | ||||
| ->addCancelButton($cancel_uri, pht('Done')) | ->addCancelButton($cancel_uri, pht('Done')) | ||||
| ->setSubmitURI($file->getDownloadURI()) | ->setSubmitURI($file->getDownloadURI()) | ||||
| ->setDisableWorkflowOnSubmit(true) | ->setDisableWorkflowOnSubmit(true) | ||||
| ▲ Show 20 Lines • Show All 427 Lines • Show Last 20 Lines | |||||