This repository has been archived by the owner on Nov 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
coscli.sh
executable file
·56 lines (48 loc) · 2.06 KB
/
coscli.sh
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
#!/usr/bin/env php
<?php
include_once "vendor/autoload.php";
use diversen\autoloader\modules;
use diversen\conf;
use diversen\minimalCli;
use diversen\db\connect;
use diversen\cli\helpers;
$path = dirname(__FILE__);
conf::setMainIni('base_path', $path);
// Boot base system
$cliHelp = new diversen\cli\helpers();
$cliHelp->bootCli();
$cli = new minimalCli();
$cli->header = 'CosCMS Commandline Tool';
// Add commands
$commands = [];
$commands['apache2'] = new \diversen\commands\apache2Command();
$commands['backup'] = new \diversen\commands\backup();
$commands['build'] = new \diversen\commands\build();
$commands['cache'] = new \diversen\commands\cache();
$commands['cron'] = new \diversen\commands\cron();
$commands['db'] = new \diversen\commands\dbCommand();
$commands['dev'] = new \diversen\commands\dev();
$commands['git'] = new \diversen\commands\gitCommand();
$commands['structure'] = new \diversen\commands\structure();
$commands['file'] = new \diversen\commands\fileSystem();
$commands['install'] = new \diversen\commands\install();
$commands['module'] = new \diversen\commands\module();
$commands['template'] = new \diversen\commands\template();
$commands['translate'] = new \diversen\commands\translateCommand();
$commands['g-translate'] = new \diversen\commands\googleTranslate();
$commands['profile'] = new \diversen\commands\profileCommand();
$commands['prompt-install'] = new \diversen\commands\promptInstall();
$commands['useradd'] = new \diversen\commands\useradd();
$commands['upgrade'] = new \diversen\commands\upgrade();
// Check if database connection exists, and add any module commands
$res = $cliHelp->dbConExists();
if ($res) {
if ($cliHelp->tablesExists()) {
$module_commands = $cliHelp->getModuleCommands();
$commands = array_merge($commands, $module_commands);
ksort($commands);
}
}
// Set commands and run the script
$cli->commands = $commands;
$cli->runMain();