private static $hooks = array(), $hooks_passed = array();
/**
- * Initialize WP_CLI static variables.
- */
- static function init() {
- self::$configurator = new WP_CLI\Configurator( WP_CLI_ROOT . '/php/config-spec.php' );
- }
-
- /**
* Set the logger instance.
*
* @param object $logger
}
static function get_configurator() {
- return self::$configurator;
+ static $configurator;
+
+ if ( !$configurator ) {
+ $configurator = new WP_CLI\Configurator( WP_CLI_ROOT . '/php/config-spec.php' );
+ }
+
+ return $configurator;
}
static function get_root_command() {
\WP_CLI\Utils\load_dependencies();
-WP_CLI::init();
-
WP_CLI::get_runner()->before_wp_load();
// Load wp-config.php code, in the global scope