WP_CLI
Configurator::__construct
Метод класса: Configurator{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Configurator = new Configurator(); $Configurator->__construct( $path );
- $path(строка) (обязательный)
- Path to config spec file.
Код Configurator::__construct() Configurator:: construct WP-CLI 2.13.0-alpha
public function __construct( $path ) {
$this->load_config_spec( $path );
$defaults = [
'runtime' => false,
'file' => false,
'synopsis' => '',
'default' => null,
'multiple' => false,
];
foreach ( $this->spec as $key => &$details ) {
$details = array_merge( $defaults, $details );
$this->config[ $key ] = $details['default'];
}
$env_files = getenv( 'WP_CLI_REQUIRE' )
? array_filter( array_map( 'trim', explode( ',', getenv( 'WP_CLI_REQUIRE' ) ) ) )
: [];
if ( ! empty( $env_files ) ) {
if ( ! isset( $this->config['require'] ) ) {
$this->config['require'] = [];
}
$this->config['require'] = array_unique( array_merge( $env_files, $this->config['require'] ) );
}
}