}
}
- public function before_wp_load() {
+ private function init_config() {
list( $args, $assoc_args, $runtime_config ) = \WP_CLI::get_configurator()->parse_args(
array_slice( $GLOBALS['argv'], 1 ) );
$this->config_path = self::get_config_path( $runtime_config );
- $local_config = \WP_CLI::get_configurator()->load_config( $this->config_path );
-
- $this->config = $local_config;
+ $this->config = \WP_CLI::get_configurator()->load_config( $this->config_path );
foreach ( $runtime_config as $key => $value ) {
if ( isset( $this->config[ $key ] ) && is_array( $this->config[ $key ] ) ) {
if ( !isset( $this->config['path'] ) ) {
$this->config['path'] = dirname( Utils\find_file_upward( 'wp-load.php' ) );
}
+ }
+ public function before_wp_load() {
+ $this->init_config();
$this->init_colorization();
$this->init_logger();
}
// Show synopsis if it's a composite command.
- $r = $this->find_command_to_run( $args );
+ $r = $this->find_command_to_run( $this->arguments );
if ( is_array( $r ) ) {
list( $command ) = $r;
define( 'WP_LOAD_IMPORTERS', true );
define( 'WP_IMPORTING', true );
}
-
}
public function after_wp_load() {
$this->_run_command();
}
}
+