-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreiko
executable file
·79 lines (67 loc) · 1.59 KB
/
reiko
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
71
72
73
74
75
76
77
78
79
#!/usr/bin/env php
<?php
require 'vendor/autoload.php';
require 'core/Bootstrap.php';
require 'app/config/constant.php';
require 'dev/loadCommand.php';
use Dev\Command\ClearCache;
use Symfony\Component\Console\Application;
use Dev\Command\Init;
use Dev\Command\MakeDbfun;
use Dev\Command\MakeHandler;
use Dev\Command\Run;
use Dev\Command\Build;
use Dev\Command\DBExport;
use Dev\Command\Seeder;
use Dev\Command\Migration;
class ReikoCLI
{
private $cli;
private $CliVer;
public function __construct()
{
@chdir(__DIR__);
$this->CliVer = '0.0.1';
$this->cli = new Application('REIKO CLI TOOLS', $this->CliVer);
}
public function register_cli($arr = array())
{
if (is_array($arr)) {
foreach ($arr as $className) {
$this->cli->add(new $className);
}
} else {
return false;
}
return $this->cli->run();
}
public function banner()
{
print "
_ __
________ (_) /______
/ ___/ _ \/ / //_/ __ \
/ / / __/ / ,< / /_/ /
/_/ \___/_/_/|_|\____/
-----------------------------------
| $this->CliVer - Reiko CLI Tools
-----------------------------------
\n\n";
}
}
/** register the command */
$command_lists = [
Run::class,
Init::class,
MakeHandler::class,
MakeDbfun::class,
ClearCache::class,
Build::class,
Seeder::class,
Migration::class,
DBExport::class
];
/** run the command */
$cli = new ReikoCLI;
$cli->banner();
$cli->register_cli($command_lists);