Last active
August 29, 2015 14:15
-
-
Save stefankeidel/78e94bfb9528e91db6d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('./setup.php'); | |
require_once(__CA_APP_DIR__.'/helpers/mediaPluginHelpers.php'); | |
$po_config = Configuration::load(); | |
$po_external_app_config = Configuration::load($po_config->get('external_applications')); | |
$ps_path_to_ghostscript = $po_external_app_config->get('ghostscript_app'); | |
print "ghostscript path from external conf: $ps_path_to_ghostscript <br/>\n"; | |
if(file_exists($ps_path_to_ghostscript)) { | |
print "ghostscript path exists<br/>\n"; | |
} else { | |
print "ghostscript path doesn't exist<br/>\n"; | |
exit(-1); | |
} | |
if (caIsValidFilePath($ps_path_to_ghostscript)) { | |
print "ghostscript path is valid<br/>\n"; | |
} else { | |
print "ghostscript path is not valid<br/>\n"; | |
exit(-1); | |
} | |
exec($ps_path_to_ghostscript." -v 2> /dev/null", $va_output, $vn_return); | |
if (($vn_return >= 0) && ($vn_return < 127)) { | |
print "found ghostscript<br/>\n"; | |
} else { | |
print "couldn't find ghostscript<br/>\n"; | |
exit(-1); | |
} | |
exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment