WP_CLI::launch_self() Edit

Run a WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ command in a new process reusing the current runtime arguments.


Usage Usage

WP_CLI::launch_self( $command, $args = array(), $assoc_args = array(), $exit_on_error = true, $return_detailed = false, $runtime_args = array() )
$command (string) WP-CLI command to call.
$args (array) Positional arguments to include when calling the command.
$assoc_args (array) Associative arguments to include when calling the command.
$exit_on_error (bool) Whether to exit if the command returns an elevated return code.
$return_detailed (bool) Whether to return an exit status (default) or detailed execution results.
$runtime_args (array) Override one or more global args (path,url,user,allow-root)
@return (int|\WP_CLI\ProcessRun) command exit status, or a ProcessRun instance

Top ↑

Notes Notes

Use WP_CLI::runcommand() instead, which is easier to use and works better.

Note: While this command does persist a limited set of runtime arguments,
it does not persist environment variables. Practically speaking, WP-CLI
packages won’t be loaded when using WP_CLI::launch_self() because the
launched process doesn’t have access to the current process $HOME.

Internal APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. documentation is generated from the WP-CLI codebase on every releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software.. To suggest improvements, please submit a pull request.


Top ↑

Last updated: