17 lines
431 B
PHP
17 lines
431 B
PHP
|
<?php
|
||
|
require_once("Settings.php");
|
||
|
|
||
|
if (!isset($argv[1]) || empty($argv[1])) {
|
||
|
Logger::log("No task specified", Logger::ERROR, "RunTask");
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
$task = $argv[1] . "Task";
|
||
|
if (!file_exists(LIB_DIR . "/tasks/" . $task . ".php")) {
|
||
|
Logger::log("Task " . $task . " does not exist", Logger::ERROR, "RunTask");
|
||
|
exit(1);
|
||
|
}
|
||
|
|
||
|
require_once(LIB_DIR . "/tasks/" . $task . ".php");
|
||
|
$task = new $task();
|
||
|
$task->run();
|