Differential D18951 Diff 45475 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 443 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
| $extension = $format->getFileExtension(); | $extension = $format->getFileExtension(); | ||||
| $mime_type = $format->getMIMEContentType(); | $mime_type = $format->getMIMEContentType(); | ||||
| $filename = $filename.'.'.$extension; | $filename = $filename.'.'.$extension; | ||||
| $format = clone $format; | $format = clone $format; | ||||
| $format->setViewer($viewer); | $format->setViewer($viewer); | ||||
| $export_data = $engine->newExport($objects); | $export_data = $engine->newExport($objects); | ||||
| if (count($export_data) !== count($objects)) { | |||||
| throw new Exception( | |||||
| pht( | |||||
| 'Search engine exported the wrong number of objects, expected '. | |||||
| '%s but got %s.', | |||||
| phutil_count($objects), | |||||
| phutil_count($export_data))); | |||||
| } | |||||
| $objects = array_values($objects); | $objects = array_values($objects); | ||||
| $export_data = array_values($export_data); | |||||
| $field_list = $engine->newExportFieldList(); | $field_list = $engine->newExportFieldList(); | ||||
| $field_list = mpull($field_list, null, 'getKey'); | $field_list = mpull($field_list, null, 'getKey'); | ||||
| 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]); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 446 Lines • Show Last 20 Lines | |||||