Skip to content

Commit d75612d

Browse files
author
Jared Hancock
committed
cli: Fix crash deploying with --setup
1 parent b528df5 commit d75612d

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

include/class.cli.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ function optionError($error) {
232232
die();
233233
}
234234

235-
function _run($module_name) {
235+
function _run($module_name, $bootstrap=true) {
236236
$this->module_name = $module_name;
237+
if ($bootstrap)
238+
$this->bootstrap();
237239
$this->parseOptions();
238240
return $this->run($this->_args, $this->_options);
239241
}
@@ -242,6 +244,12 @@ function _run($module_name) {
242244
function run($args, $options) {
243245
}
244246

247+
function bootstrap() {
248+
Bootstrap::loadConfig();
249+
Bootstrap::defineTables(TABLE_PREFIX);
250+
Bootstrap::loadCode();
251+
}
252+
245253
function fail($message) {
246254
$this->stderr->write($message . "\n");
247255
die();

include/cli/cli.inc.php

-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,4 @@
2323

2424
require_once INCLUDE_DIR . "class.cli.php";
2525

26-
Bootstrap::loadConfig();
27-
Bootstrap::defineTables(TABLE_PREFIX);
28-
Bootstrap::loadCode();
2926
Bootstrap::i18n_prep();

include/cli/modules/unpack.php

+5
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ function get_include_dir() {
215215
return $location = rtrim($INCLUDE_DIR, '/').'/';
216216
}
217217

218+
function bootstrap() {
219+
// Don't load config and frieds as that will likely crash if not yet
220+
// installed
221+
}
222+
218223
function run($args, $options) {
219224
$this->destination = $args['install-path'];
220225
if (!is_dir($this->destination))

manage.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,4 @@ function run($args, $options) {
8080
}
8181

8282
$manager = new Manager();
83-
$manager->parseOptions();
84-
$manager->_run(basename(__file__));
83+
$manager->_run(basename(__file__), false);

0 commit comments

Comments
 (0)