public function ShellOperations::saveCommandStdoutToFile in Image Optimize Binaries 8
Overrides ImageAPIOptimizeShellOperationsInterface::saveCommandStdoutToFile
File
- src/
ShellOperations.php, line 62
Class
- ShellOperations
- Storage controller class for "image optimize pipeline" configuration entities.
Namespace
Drupal\imageapi_optimize_binariesCode
public function saveCommandStdoutToFile($cmd, $dst) {
$return_val = 0;
ob_start();
passthru($cmd);
$output = ob_get_contents();
ob_end_clean();
\Drupal::service('file_system')
->saveData($output, $dst, FileSystemInterface::EXISTS_REPLACE);
if ($return_val == 0) {
return TRUE;
}
else {
return FALSE;
}
}