Fix import of TmpFileTool in RestResponseComponent

pull/9377/head
Marek Zpevacek 2023-11-21 12:35:26 +01:00 committed by GitHub
parent 3996af54ba
commit 4644e825c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -631,6 +631,7 @@ class RestResponseComponent extends Component
}
}
App::uses('TmpFileTool', 'Tools');
// 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);