File tree 4 files changed +15
-6
lines changed
4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -232,8 +232,10 @@ function optionError($error) {
232
232
die ();
233
233
}
234
234
235
- function _run ($ module_name ) {
235
+ function _run ($ module_name, $ bootstrap = true ) {
236
236
$ this ->module_name = $ module_name ;
237
+ if ($ bootstrap )
238
+ $ this ->bootstrap ();
237
239
$ this ->parseOptions ();
238
240
return $ this ->run ($ this ->_args , $ this ->_options );
239
241
}
@@ -242,6 +244,12 @@ function _run($module_name) {
242
244
function run ($ args , $ options ) {
243
245
}
244
246
247
+ function bootstrap () {
248
+ Bootstrap::loadConfig ();
249
+ Bootstrap::defineTables (TABLE_PREFIX );
250
+ Bootstrap::loadCode ();
251
+ }
252
+
245
253
function fail ($ message ) {
246
254
$ this ->stderr ->write ($ message . "\n" );
247
255
die ();
Original file line number Diff line number Diff line change 23
23
24
24
require_once INCLUDE_DIR . "class.cli.php " ;
25
25
26
- Bootstrap::loadConfig ();
27
- Bootstrap::defineTables (TABLE_PREFIX );
28
- Bootstrap::loadCode ();
29
26
Bootstrap::i18n_prep ();
Original file line number Diff line number Diff line change @@ -215,6 +215,11 @@ function get_include_dir() {
215
215
return $ location = rtrim ($ INCLUDE_DIR , '/ ' ).'/ ' ;
216
216
}
217
217
218
+ function bootstrap () {
219
+ // Don't load config and frieds as that will likely crash if not yet
220
+ // installed
221
+ }
222
+
218
223
function run ($ args , $ options ) {
219
224
$ this ->destination = $ args ['install-path ' ];
220
225
if (!is_dir ($ this ->destination ))
Original file line number Diff line number Diff line change @@ -80,5 +80,4 @@ function run($args, $options) {
80
80
}
81
81
82
82
$ manager = new Manager ();
83
- $ manager ->parseOptions ();
84
- $ manager ->_run (basename (__file__));
83
+ $ manager ->_run (basename (__file__), false );
You can’t perform that action at this time.
0 commit comments