mirror of
https://gh.wpcy.net/https://github.com/wp-cli/handbook.git
synced 2026-04-26 12:38:03 +08:00
- Organize files in folders according to the desired structure - Use directory iterator to loop through all files and folders (makes generation more robust)
1.6 KiB
1.6 KiB
WP_CLI::launch()
Launch an arbitrary external process that takes over I/O.
Usage
WP_CLI::launch( $command, $exit_on_error = true, $return_detailed = false )
$command (string) External process to launch.
$exit_on_error (boolean) Whether to exit if the command returns an elevated return code.
$return_detailed (boolean) Whether to return an exit status (default) or detailed execution results.
@return (int|ProcessRun) command exit status, or a ProcessRun object for full details.
$exit_on_error (boolean) Whether to exit if the command returns an elevated return code.
$return_detailed (boolean) Whether to return an exit status (default) or detailed execution results.
@return (int|ProcessRun) command exit status, or a ProcessRun object for full details.
Notes
# `wp core download` falls back to the `tar` binary when PharData isn't available
if ( ! class_exists( 'PharData' ) ) {
$cmd = "tar xz --strip-components=1 --directory=%s -f $tarball";
WP_CLI::launch( Utils\esc_cmd( $cmd, $dest ) );
return;
}
Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.
Related
- WP_CLI::launch_self() - Run a WP-CLI command in a new process reusing the current runtime arguments.
- WP_CLI::runcommand() - Run a WP-CLI command.
- WP_CLI::run_command() - Run a given command within the current process using the same global parameters.