Fix #867 Add Exiftool binary check

Enhancement

Fix typo
This commit is contained in:
Nicolas Le Goff
2013-05-29 12:19:41 +02:00
parent 676fb688e3
commit 0248aa5adf

View File

@@ -21,6 +21,7 @@ class BinariesRequirements extends RequirementCollection implements RequirementI
const SWFTOOLS_VERSION = '0.9.0';
const UNOCONV_VERSION = '0.5.0';
const MP4BOX_VERSION = '0.4.0';
const EXIFTOOL_VERSION = '9.15';
public function __construct($binaries = array())
{
@@ -99,6 +100,25 @@ class BinariesRequirements extends RequirementCollection implements RequirementI
);
}
$exiftool = __DIR__ . '/../../../../../vendor/phpexiftool/exiftool/exiftool' . (defined('PHP_WINDOWS_VERSION_BUILD') ? '.exe' : '');
$this->addRequirement(
is_file($exiftool) && is_executable($exiftool),
'Exiftool is required for reading, writing and editing meta information',
'Please install Exiftool'
);
if (is_file($exiftool) && is_executable($exiftool)) {
$output = null;
exec($exiftool . ' -ver', $output);
$version = $output[0];
$this->addRequirement(
version_compare(static::EXIFTOOL_VERSION, $version, '<='),
sprintf('Exiftool version %s or higher is required (%s provided)', static::EXIFTOOL_VERSION, $version),
'Please update to a more recent version.'
);
}
$pdf2swf = isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : $finder->find('pdf2swf');
$this->addRecommendation(