Commit 466218af authored by Bas de Nooijer's avatar Bas de Nooijer

Added version check to phar

parent f9c401ed
...@@ -37,5 +37,20 @@ Phar::mapPhar("solarium.phar"); ...@@ -37,5 +37,20 @@ Phar::mapPhar("solarium.phar");
require_once 'phar://solarium.phar/Autoloader.php'; require_once 'phar://solarium.phar/Autoloader.php';
Solarium_Autoloader::register(); Solarium_Autoloader::register();
if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'][0]) && isset($_SERVER['argv'][1])) {
switch ($_SERVER['argv'][1]) {
case 'version':
echo "Solarium version " . Solarium_Version::VERSION ."\n";
break;
default:
echo "Unknown command '" . $_SERVER['argv'][1] . "' (Supported commands: version)\n";
}
exit(0);
}
__HALT_COMPILER(); __HALT_COMPILER();
?> ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment