WP_CLI

Runner::run_alias_group()privateWP-CLI 1.0

Метод класса: Runner{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->run_alias_group( $aliases );
$aliases (обязательный)
-

Код Runner::run_alias_group() WP-CLI 2.8.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 );
	}
}