mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
39 lines
827 B
PHP
39 lines
827 B
PHP
#!/usr/bin/env php
|
|
<?php
|
|
|
|
require_once __DIR__ . '/common.php';
|
|
|
|
if(!IS_CLI) {
|
|
echo 'This script can be run only in command line mode.';
|
|
exit(1);
|
|
}
|
|
|
|
require_once SYSTEM . 'functions.php';
|
|
require_once SYSTEM . 'init.php';
|
|
|
|
use MyAAC\Plugins;
|
|
use Symfony\Component\Console\Application;
|
|
|
|
$application = new Application();
|
|
|
|
$commandsGlob = glob(SYSTEM . 'src/Commands/*.php');
|
|
foreach ($commandsGlob as $item) {
|
|
$name = pathinfo($item, PATHINFO_FILENAME);
|
|
if ($name == 'Command') { // ignore base Command class
|
|
continue;
|
|
}
|
|
|
|
$commandPre = '\\MyAAC\Commands\\';
|
|
$application->add(new ($commandPre . $name));
|
|
}
|
|
|
|
$pluginCommands = Plugins::getCommands();
|
|
foreach ($pluginCommands as $item) {
|
|
$application->add(require $item);
|
|
}
|
|
|
|
$application->setName('MyAAC');
|
|
$application->setVersion(MYAAC_VERSION);
|
|
|
|
$application->run();
|