WP_CLI
Runner::run_alias_group
Method of the class: Runner{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->run_alias_group( $aliases );
- $aliases(required)
- .
Runner::run_alias_group() Runner::run alias group code WP-CLI 2.13.0-alpha
private function run_alias_group( $aliases ) {
Utils\check_proc_available( 'group alias' );
$php_bin = escapeshellarg( Utils\get_php_binary() );
$script_path = $GLOBALS['argv'][0];
if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) {
$config_path = getenv( 'WP_CLI_CONFIG_PATH' );
} else {
$config_path = Utils\get_home_dir() . '/.wp-cli/config.yml';
}
$config_path = escapeshellarg( $config_path );
foreach ( $aliases as $alias ) {
WP_CLI::log( $alias );
$args = implode( ' ', array_map( 'escapeshellarg', $this->arguments ) );
$assoc_args = Utils\assoc_args_to_str( $this->assoc_args );
$runtime_config = Utils\assoc_args_to_str( $this->runtime_config );
$full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$alias} {$args}{$assoc_args}{$runtime_config}";
$pipes = [];
$proc = Utils\proc_open_compat( $full_command, [ STDIN, STDOUT, STDERR ], $pipes );
proc_close( $proc );
}
}