mirror of https://github.com/MISP/MISP
Merge branch 'tmpfiletool' into develop
commit
431f5acd9b
|
@ -589,6 +589,7 @@ class RestResponseComponent extends Component
|
|||
*/
|
||||
private function __sendResponse($response, $code, $format = false, $raw = false, $download = false, $headers = array())
|
||||
{
|
||||
App::uses('TmpFileTool', 'Tools');
|
||||
$format = !empty($format) ? strtolower($format) : 'json';
|
||||
if ($format === 'application/xml' || $format === 'xml') {
|
||||
if (!$raw) {
|
||||
|
@ -630,7 +631,7 @@ class RestResponseComponent extends Component
|
|||
$response['sql_dump'] = $this->getSqlLog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If response is big array, encode items separately to save memory
|
||||
if (is_array($response) && count($response) > 10000) {
|
||||
$output = new TmpFileTool();
|
||||
|
@ -661,7 +662,6 @@ class RestResponseComponent extends Component
|
|||
}
|
||||
}
|
||||
|
||||
App::uses('TmpFileTool', 'Tools');
|
||||
if ($response instanceof Generator) {
|
||||
$tmpFile = new TmpFileTool();
|
||||
$tmpFile->writeWithSeparator($response, null);
|
||||
|
|
Loading…
Reference in New Issue