function UTL_execWrapper($cmd) { list($results, $status) = UTL_exec($cmd); if ($status == 0) { return true; } else { COM_errorLog("UTL_execWrapper: Failed Command: " . $cmd); return false; } }
function _img_getIMversion() { global $_CONF; $version = ''; // get im version list($results, $status) = UTL_exec($_CONF['path_to_mogrify'] . '/identify'); foreach ($results as $resultLine) { if (preg_match('/(ImageMagick|GraphicsMagick)\\s+([\\d\\.r-]+)/', $resultLine, $matches)) { $version = array($matches[1], $matches[2]); } } return $version; }
function _img_getIMversion() { global $_CONF, $_MG_CONF; // get im version $binary = 'identify' . (PHP_OS == 'WINNT' ? '.exe' : ''); $cmd = $_MG_CONF['path_to_imagemagick'] . $binary; list($results, $status) = UTL_exec($cmd); if ($status != 0) { COM_errorLog("UTL_execWrapper: Failed Command: " . $cmd); return false; } foreach ($results as $resultLine) { if (preg_match('/(ImageMagick|GraphicsMagick)\\s+([\\d\\.r-]+)/', $resultLine, $matches)) { $version = array($matches[1], $matches[2]); } } return $version; }