PHP Class WP_CLI\Runner

ファイルを表示 Open project: wp-cli/wp-cli

Public Methods

Method Description
__get ( $key )
action_setup_theme_wp_cli_skip_themes ( ) Set up the filters to skip the loaded theme
find_command_to_run ( array $args ) : array | string Given positional arguments, find the command to execute.
get_packages_dir_path ( ) : string Get the path to the packages directory
get_wp_config_code ( ) : string Returns wp-config.php code, skipping the loading of wp-settings.php
in_color ( ) : boolean Whether or not the output should be rendered in color
is_command_disabled ( $command ) : boolean Check whether a given command is disabled by the config
load_wordpress ( ) Load WordPress, if it hasn't already been loaded
register_early_invoke ( string $when, Subcommand $command ) Register a command for early invocation, generally before WordPress loads.
run_command ( array $args, array $assoc_args = [], array $options = [] ) Find the WP-CLI command to run given arguments, and invoke it.
start ( )

Private Methods

Method Description
_run_command ( )
auto_check_update ( ) Check whether there's a WP-CLI update available, and suggest update if so.
back_compat_conversions ( array $args, array $assoc_args ) : array Transparently convert deprecated syntaxes
check_root ( )
check_wp_version ( )
cmd_starts_with ( $prefix )
do_early_invoke ( string $when ) Perform the early invocation of a command.
extract_subdir_path ( string $index_path ) : string | false Attempts to find the path to the WP install inside index.php
fake_current_site_blog ( $url_parts )
find_wp_root ( ) : string Find the directory that contains the WordPress files.
get_global_config_path ( ) : string | false Get the path to the global configuration YAML file.
get_project_config_path ( ) : string | false Get the path to the project-specific configuration YAML file.
guess_url ( array $assoc_args ) : string | false Guess which URL context WP-CLI has been invoked under.
init_colorization ( )
init_config ( )
init_logger ( )
is_multisite ( ) Whether or not this WordPress install is multisite.
maybe_update_url_from_domain_constant ( ) Called after wp-config.php is eval'd, to potentially reset --url
run_alias_group ( $aliases )
run_ssh_command ( $ssh ) Perform a command against a remote server over SSH
set_alias ( $alias )
set_wp_root ( string $path ) Set WordPress root as a given path.
setup_bootstrap_hooks ( ) Set up hooks meant to run during the WordPress bootstrap process
setup_skip_plugins_filters ( ) Set up the filters to skip the loaded plugins
wp_exists ( ) : boolean Do WordPress core files exist?

Method Details

__get() public method

public __get ( $key )

action_setup_theme_wp_cli_skip_themes() public method

Set up the filters to skip the loaded theme

find_command_to_run() public method

Given positional arguments, find the command to execute.
public find_command_to_run ( array $args ) : array | string
$args array
return array | string Command, args, and path on success; error message on failure

get_packages_dir_path() public method

Get the path to the packages directory
public get_packages_dir_path ( ) : string
return string

get_wp_config_code() public method

Returns wp-config.php code, skipping the loading of wp-settings.php
public get_wp_config_code ( ) : string
return string

in_color() public method

Whether or not the output should be rendered in color
public in_color ( ) : boolean
return boolean

is_command_disabled() public method

Check whether a given command is disabled by the config
public is_command_disabled ( $command ) : boolean
return boolean

load_wordpress() public method

Load WordPress, if it hasn't already been loaded
public load_wordpress ( )

register_early_invoke() public method

Register a command for early invocation, generally before WordPress loads.
public register_early_invoke ( string $when, Subcommand $command )
$when string Named execution hook
$command WP_CLI\Dispatcher\Subcommand

run_command() public method

Find the WP-CLI command to run given arguments, and invoke it.
public run_command ( array $args, array $assoc_args = [], array $options = [] )
$args array Positional arguments including command name
$assoc_args array Associative arguments for the command.
$options array Configuration options for the function.

start() public method

public start ( )