diff --git a/include/class.cli.php b/include/class.cli.php index a4e3cfc16ab619d32fd854778b09dab81c4569fd..f2f98ce2914a880603f36caf56162bc1bc6b2d62 100644 --- a/include/class.cli.php +++ b/include/class.cli.php @@ -232,8 +232,10 @@ class Module { die(); } - function _run($module_name) { + function _run($module_name, $bootstrap=true) { $this->module_name = $module_name; + if ($bootstrap) + $this->bootstrap(); $this->parseOptions(); return $this->run($this->_args, $this->_options); } @@ -242,6 +244,12 @@ class Module { function run($args, $options) { } + function bootstrap() { + Bootstrap::loadConfig(); + Bootstrap::defineTables(TABLE_PREFIX); + Bootstrap::loadCode(); + } + function fail($message) { $this->stderr->write($message . "\n"); die(); diff --git a/include/cli/cli.inc.php b/include/cli/cli.inc.php index 401ddba40fc5d5f7fa74fd3523d58cc5078de8eb..cb833c9219859387f485ed805f3694030dfe6ed6 100644 --- a/include/cli/cli.inc.php +++ b/include/cli/cli.inc.php @@ -23,7 +23,4 @@ define('INC_DIR',dirname(__file__).'/../inc/'); //local include dir! require_once INCLUDE_DIR . "class.cli.php"; -Bootstrap::loadConfig(); -Bootstrap::defineTables(TABLE_PREFIX); -Bootstrap::loadCode(); Bootstrap::i18n_prep(); diff --git a/include/cli/modules/unpack.php b/include/cli/modules/unpack.php index 72f5fae8228f9676df60376e79f234d0ceed56d0..75b73353deb0f212bed2a65cb420707c5b3eaedd 100644 --- a/include/cli/modules/unpack.php +++ b/include/cli/modules/unpack.php @@ -215,6 +215,11 @@ class Unpacker extends Module { return $location = rtrim($INCLUDE_DIR, '/').'/'; } + function bootstrap() { + // Don't load config and frieds as that will likely crash if not yet + // installed + } + function run($args, $options) { $this->destination = $args['install-path']; if (!is_dir($this->destination)) diff --git a/manage.php b/manage.php index 37317e7f5cc5c0643de09a92d5a5830ef8141605..25e1fd80e256379c9d585892866915d5d3a6e231 100755 --- a/manage.php +++ b/manage.php @@ -80,5 +80,4 @@ class Manager extends Module { } $manager = new Manager(); -$manager->parseOptions(); -$manager->_run(basename(__file__)); +$manager->_run(basename(__file__), false);