Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
diversen committed Dec 29, 2016
1 parent c2c70aa commit 6343854
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions coscli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ use diversen\minimalCli;
use diversen\db\connect;
use diversen\cli\helpers;

$m = new modules();
$m->autoloadRegister();

$path = dirname(__FILE__);
conf::setMainIni('base_path', $path);

// Boot base system
$cliHelp = new diversen\cli\helpers();
$cliHelp->bootCli();

Expand Down Expand Up @@ -43,11 +41,14 @@ $commands['prompt-install'] = new \diversen\commands\promptInstall();
$commands['useradd'] = new \diversen\commands\useradd();
$commands['upgrade'] = new \diversen\commands\upgrade();

// Check if database connection exists
$res = $cliHelp->dbConExists();
if ($res) {
// Get module commands
$module_commands = $cliHelp->getModuleCommands();
$commands = array_merge($commands, $module_commands);
}

// Set commands and run the script
$cli->commands = $commands;
$cli->runMain();

0 comments on commit 6343854

Please sign in to comment.