WP_CLI\Utils

get_php_binary()WP-CLI 1.0

Get the path to the PHP binary used when executing WP-CLI.

Environment values permit specific binaries to be indicated.

Хуков нет.

Возвращает

Строку.

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

get_php_binary();

Код get_php_binary() WP-CLI 2.7.0-alpha

function get_php_binary() {
	$wp_cli_php_used = getenv( 'WP_CLI_PHP_USED' );
	if ( false !== $wp_cli_php_used ) {
		return $wp_cli_php_used;
	}

	$wp_cli_php = getenv( 'WP_CLI_PHP' );
	if ( false !== $wp_cli_php ) {
		return $wp_cli_php;
	}

	return PHP_BINARY;
}