mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
feat: Rewrite of the core: avoid globals where possible
Create services for: login, status, router, database, AnonymousStatistics Drop gesior.backward_support Drop compat/pages.php Drop part of compat/classes.php Move signature to routes
This commit is contained in:
33
aac
33
aac
@@ -3,34 +3,5 @@
|
||||
|
||||
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';
|
||||
|
||||
define('SELF_NAME', basename(__FILE__));
|
||||
|
||||
use MyAAC\Plugins;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
$application = new Application('MyAAC', MYAAC_VERSION);
|
||||
|
||||
$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->run();
|
||||
$console = new \MyAAC\App\Console();
|
||||
$console->run();
|
||||
|
Reference in New Issue
Block a user