SAND-framework/console/bin.php
Emmanuel ROY 2a2f2e3e46 update authentification multiple
update console bin
update composer apereo/phpCAS
2020-12-09 16:35:05 +01:00

28 lines
764 B
PHP

#!/usr/bin/php
<?php
global $argv;
require dirname(__DIR__) . DIRECTORY_SEPARATOR . "vendor" . DIRECTORY_SEPARATOR . "autoload.php";
\MVC\Classe\Dumper::setPHPvalues();
//var_dump($argv);
if (isset($argv[1])) {
$option = explode(':', $argv[1]);
$command_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "command" . DIRECTORY_SEPARATOR . ucfirst($option[0]) . ".php";
if (is_file($command_file)) {
$class = "\MVC\Command\\" . ucfirst($option[0]);
$static_method = $option[1];
$errors = $class::$static_method();
if ($errors !== null) {
\MVC\Classe\Logger::logCommandErrors($errors);
}
} else {
print "Command not found !\n";
}
} else {
print "No command was specified !\n";
}