From e905878644e1a71ea538c93061603d29e24b606e Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Fri, 30 May 2014 16:13:28 +0400 Subject: [PATCH] Redirect stderr out to stdout with use pil. --- Upload.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Upload.class.php b/Upload.class.php index 6ae8567..4b8403d 100644 --- a/Upload.class.php +++ b/Upload.class.php @@ -124,11 +124,12 @@ abstract class Upload . $pil_options . ' ' . $tmp_file_path . ' ' . $file_path; - passthru( $command, $code ); + //ob_start(); + passthru( 'exec 2>&1; ' . $command, $code ); if ($code !== 0) { - throw new ErrorException('Command PYTHON_PIL_RESIZE: ' . $command ); + throw new ErrorException('Command PYTHON_PIL_RESIZE exit with code "' . $code . '": ' . $command . PHP_EOL . 'Std out: ' . ob_get_clean() ); } - // ob_clean(); + // ob_clean(); } else { if ($width || $height) { if (!(ImageVariant::getIsClass($image)) && Image::getIsSubClass($image)) { @@ -170,4 +171,4 @@ abstract class Upload } } } -} \ No newline at end of file +}