This repository has been archived by the owner on Oct 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsole
70 lines (58 loc) · 1.8 KB
/
console
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env php
<?php
set_time_limit(0);
/**
* Loading path constant
*/
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__));
/**
* Enable autoload
*/
require_once ROOT . DS . 'plugins'. DS . 'autoload.php';
// require Facade aliases
require_once ROOT . DS . 'library' . DS .'aliases.php';
// require User commands aliases
require_once ROOT . DS . 'library' . DS .'commands.php';
// load Facades
\GL\Core\Facades\AliasLoader::getInstance($aliases)->register();
use GL\Core\Kernel\Loader;
use GL\Command\CacheCommand;
use GL\Command\ModelCommand;
use GL\Command\ModelsCommand;
use GL\Command\SecurityCommand;
use GL\Command\UserCommand;
use GL\Command\DebugBarCommand;
use GL\Command\ControllerCommand;
use GL\Command\MigrationCommand;
use GL\Command\MigrationCreateCommand;
use GL\Command\MigrationRollbackCommand;
use GL\Command\MigrationListCommand;
use GL\Command\CreateConsoleCommand;
use GL\Command\RoleCommand;
use GL\Command\UserRoleCommand;
use Symfony\Component\Console\Application;
Loader::InitPath();
Loader::InitConfig();
Loader::InitDatabase();
$application = new Application();
$application->add(new CacheCommand);
$application->add(new ModelCommand);
$application->add(new ModelsCommand);
$application->add(new SecurityCommand);
$application->add(new UserCommand);
$application->add(new DebugBarCommand);
$application->add(new ControllerCommand);
$application->add(new MigrationCommand);
$application->add(new MigrationCreateCommand);
$application->add(new MigrationRollbackCommand);
$application->add(new MigrationListCommand);
$application->add(new CreateConsoleCommand);
$application->add(new RoleCommand);
$application->add(new UserRoleCommand);
// load commands defined in library/commands.php
foreach ($commands as $command)
{
$application->add(new $command);
}
$application->run();