-
·
WP_CLIUtilshttp_request()
Make a HTTP request to a remote URL. Usage WP_CLI\Utils\http_request( $method, $url, $data = null, $headers = [], $options = [] ) $method (string) HTTP method (GET, POST, DELETE, etc.). $url (string) URL to make the HTTP request to. $data (array|null) Data to send either as a query string for GET/HEAD requests, or in the…
-
·
WP_CLIUtilsisPiped()
Checks whether the output of the current script is a TTY or a pipe / redirect Usage WP_CLI\Utils\isPiped() @return (bool) Notes Returns true if STDOUT output is being redirected to a pipe or a file; false is output is being sent directly to the terminal. If an env variable SHELL_PIPE exists, the returned result depends…
-
·
WP_CLIUtilsget_temp_dir()
Get the system’s temp directory. Warns user if it isn’t writable. Usage WP_CLI\Utils\get_temp_dir() @return (string) Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related WP_CLI\Utils\get_home_dir() – Get the home directory. WP_CLI\Utils\trailingslashit() – Appends a trailing slash. WP_CLI\Utils\normalize_path() – Normalize a filesystem path. WP_CLI\Utils\get_php_binary()…
-
·
WP_CLIUtilsesc_like()
First half of escaping for LIKE special characters % and _ before preparing for MySQL. Usage WP_CLI\Utils\esc_like( $text ) $text (string) The raw text to be escaped. The input typed by the user should have no extra or deleted slashes. @return (string) in the form of a LIKE phrase. The output is not SQL safe.…
-
·
WP_CLI::get_config()
Get values of global configuration parameters. Usage WP_CLI::get_config( $key = null ) $key (string) Get value for a specific global configuration parameter. @return (mixed) Notes Provides access to –path=<path>, –url=<url>, and other values of the global configuration parameters. WP_CLI::log( ‘The –url=<url> value is: ‘ . WP_CLI::get_config( ‘url’ ) ); Internal API documentation is generated from…
-
·
WP_CLI::get_php_binary()
Get the path to the PHP binary used when executing WP-CLI. Usage WP_CLI::get_php_binary() @return (string) Notes Environment values permit specific binaries to be indicated. Note: moved to Utils, left for BC. Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related WP_CLI\Utils\get_home_dir() – Get…
-
·
WP_CLI::halt()
Halt script execution with a specific return code. Usage WP_CLI::halt( $return_code ) $return_code (integer) @return (never) Notes Permits script execution to be overloaded by WP_CLI::runcommand() When –debug is enabled, this method will also output a backtrace showing where the halt was triggered from, making it easier to identify the cause of early termination. Internal API…
-
·
WP_CLI::has_config()
Confirm that a global configuration parameter does exist. Usage WP_CLI::has_config( $key ) $key (string) Config parameter key to check. @return (bool) Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request. Related WP_CLI\Utils\launch_editor_for_input() – Launch system’s $EDITOR for the user to edit some text. WP_CLI\Utils\get_flag_value()…
-
·
WP_CLI::launch_self()
Run a WP-CLI command in a new process reusing the current runtime arguments. Usage WP_CLI::launch_self( $command, $args = [], $assoc_args = [], $exit_on_error = true, $return_detailed = false, $runtime_args = [] ) $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…
-
·
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…