Source: Make WordPress: CLI

  • WP_CLIUtilsparse_str_to_argv()

    Parse a string of command line arguments into an $argv-esqe variable. Usage WP_CLI\Utils\parse_str_to_argv( $arguments ) $arguments (string) @return (array<string>) 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-CLIWP-CLI WP-CLI is…

  • WP_CLIUtilsproc_open_compat()

    Windows compatible proc_open(). Works around bug in PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/index.php, and also deals with *nix-like ENV_VAR=blah cmd environment variable prefixes. Usage WP_CLI\Utils\proc_open_compat( $cmd, $descriptorspec, $pipes, $cwd = null,…

  • WP_CLIUtilshttp_request()

    Make a HTTPHTTP HTTP is an acronym for Hyper Text Transfer Protocol. HTTP is the underlying protocol used by the World Wide Web and this protocol defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. request to a remote URLURL A specific web…

  • 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 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-CLIWP-CLI WP-CLI is the Command Line Interface…

  • WP_CLIUtilsbasename()

    Locale-independent version of basename() Usage WP_CLI\Utils\basename( $path, $suffix = ” ) $path (string) $suffix (string) @return (string) 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-CLIWP-CLI WP-CLI is the Command…

  • WP_CLI::error_multi_line()

    Display a multi-line error message in a red box. Doesn’t exit script. Usage WP_CLI::error_multi_line( $message_lines ) $message_lines (array) Multi-line error message to be displayed. Notes Error message is written to STDERR. Internal APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in…

  • WP_CLI::error()

    Display error message prefixed with “Error: ” and exit script. Usage WP_CLI::error( $message, $exit = true ) $message (string|WP_Error|Exception|Throwable) Message to write to STDERR. $exit (boolean|integer) True defaults to exit(1). @return (null) Notes Error message is written to STDERR. Defaults to halting script execution with return code 1. Use WP_CLI::warning() instead when script execution should…

  • 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 APIAPI An API or Application…

  • WP_CLI::get_php_binary()

    Get the path to the PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/index.php binary used when executing WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks…