/** * Tests if the soffice command is available on the system. * * @return boolean|sting True if the command exists, otherwise an error message. */ public static function isRunnable() { $Unoconv = new Transformist_Command('unoconv'); if (!$Unoconv->exists()) { return 'The unoconv command is not available.'; } $result = $Unoconv->execute(array('--version')); $version = 0; foreach ($result->output() as $line) { if (preg_match('#unoconv\\s+(?P<version>[0-9]\\.[0-9])#i', $line, $matches)) { $version = floatval($matches['version']); break; } } if ($version < 0.6) { return 'unoconv version must be 0.6 or higher'; } return true; }
/** * Tests if the convert command is available on the system. * * @return boolean|sting True if the command exists, otherwise an error message. */ public static function isRunnable() { $Convert = new Transformist_Command('convert'); return $Convert->exists() ? true : 'The convert command (from imagemagick) is not available.'; }
/** * Tests if the ffmpeg command is available on the system. * * @return boolean|sting True if the command exists, otherwise an error message. */ public static function isRunnable() { $ffmpeg = new Transformist_Command('ffmpeg'); return $ffmpeg->exists() ? true : 'The ffmpeg command is not available.'; }