mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-28 08:02:16 +08:00
modified: composer.lock modified: mu-plugin/v-sys-plugin-updater-mu.php modified: mu-plugin/v-sys-plugin-updater.php modified: mu-plugin/v-sys-theme-updater-mu.php modified: mu-plugin/v-sys-theme-updater.php modified: tests/ApiKeyHelperTest.php modified: update-api/app/Controllers/ApiController.php modified: update-api/app/Controllers/HomeController.php deleted: update-api/app/Controllers/KeyController.php modified: update-api/app/Core/Router.php modified: update-api/app/Models/HostsModel.php modified: update-api/config.php modified: update-api/public/install.php deleted: update-api/storage/test.sqlite
6735 lines
No EOL
208 KiB
PHP
6735 lines
No EOL
208 KiB
PHP
<?php
|
||
/**
|
||
* Generated stub declarations for WP-CLI
|
||
* @see https://wp-cli.org/
|
||
* @see https://github.com/php-stubs/wp-cli-stubs
|
||
*/
|
||
|
||
namespace WP_CLI {
|
||
/**
|
||
* Class Autoloader.
|
||
*
|
||
* This is a custom autoloader to replace the functionality that we would
|
||
* normally get through the autoloader generated by Composer.
|
||
*
|
||
* We need this separate autoloader for the bootstrapping process, which happens
|
||
* before the Composer autoloader(s) could be loaded.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class Autoloader
|
||
{
|
||
/**
|
||
* Array containing the registered namespace structures
|
||
*
|
||
* @var array
|
||
*/
|
||
protected $namespaces = [];
|
||
/**
|
||
* Destructor for the Autoloader class.
|
||
*
|
||
* The destructor automatically unregisters the autoload callback function
|
||
* with the SPL autoload system.
|
||
*/
|
||
public function __destruct()
|
||
{
|
||
}
|
||
/**
|
||
* Registers the autoload callback with the SPL autoload system.
|
||
*/
|
||
public function register()
|
||
{
|
||
}
|
||
/**
|
||
* Unregisters the autoload callback with the SPL autoload system.
|
||
*/
|
||
public function unregister()
|
||
{
|
||
}
|
||
/**
|
||
* Add a specific namespace structure with our custom autoloader.
|
||
*
|
||
* @param string $root Root namespace name.
|
||
* @param string $base_dir Directory containing the class files.
|
||
* @param string $prefix Prefix to be added before the class.
|
||
* @param string $suffix Suffix to be added after the class.
|
||
* @param boolean $lowercase Whether the class should be changed to
|
||
* lowercase.
|
||
* @param boolean $underscores Whether the underscores should be changed to
|
||
* hyphens.
|
||
*
|
||
* @return self
|
||
*/
|
||
public function add_namespace($root, $base_dir, $prefix = '', $suffix = '.php', $lowercase = false, $underscores = false)
|
||
{
|
||
}
|
||
/**
|
||
* The autoload function that gets registered with the SPL Autoloader
|
||
* system.
|
||
*
|
||
* @param string $class The class that got requested by the spl_autoloader.
|
||
*/
|
||
public function autoload($class)
|
||
{
|
||
}
|
||
/**
|
||
* Normalize a namespace root.
|
||
*
|
||
* @param string $root Namespace root that needs to be normalized.
|
||
*
|
||
* @return string Normalized namespace root.
|
||
*/
|
||
protected function normalize_root($root)
|
||
{
|
||
}
|
||
/**
|
||
* Remove a leading backslash from a string.
|
||
*
|
||
* @param string $string String to remove the leading backslash from.
|
||
*
|
||
* @return string Modified string.
|
||
*/
|
||
protected function remove_leading_backslash($string)
|
||
{
|
||
}
|
||
/**
|
||
* Make sure a string ends with a trailing backslash.
|
||
*
|
||
* @param string $string String to check the trailing backslash of.
|
||
*
|
||
* @return string Modified string.
|
||
*/
|
||
protected function add_trailing_backslash($string)
|
||
{
|
||
}
|
||
/**
|
||
* Make sure a string ends with a trailing slash.
|
||
*
|
||
* @param string $string String to check the trailing slash of.
|
||
*
|
||
* @return string Modified string.
|
||
*/
|
||
protected function add_trailing_slash($string)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Bootstrap {
|
||
/**
|
||
* Interface BootstrapStep.
|
||
*
|
||
* Represents a single bootstrapping step that can be processed.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
interface BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state);
|
||
}
|
||
/**
|
||
* Abstract class AutoloaderStep.
|
||
*
|
||
* Abstract base class for steps that include an autoloader.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
abstract class AutoloaderStep implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Store state for subclasses to have access.
|
||
*
|
||
* @var BootstrapState
|
||
*/
|
||
protected $state;
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
/**
|
||
* Get the name of the custom vendor folder as set in `composer.json`.
|
||
*
|
||
* @return string|false Name of the custom vendor folder or false if none.
|
||
*/
|
||
protected function get_custom_vendor_folder()
|
||
{
|
||
}
|
||
/**
|
||
* Handle the failure to find an autoloader.
|
||
*
|
||
* @return void
|
||
*/
|
||
protected function handle_failure()
|
||
{
|
||
}
|
||
/**
|
||
* Get the autoloader paths to scan for an autoloader.
|
||
*
|
||
* @return string[]|false Array of strings with autoloader paths, or false
|
||
* to skip.
|
||
*/
|
||
abstract protected function get_autoloader_paths();
|
||
}
|
||
/**
|
||
* Class BootstrapState.
|
||
*
|
||
* Represents the state that is passed from one bootstrap step to the next.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*
|
||
* Maintain BC: Changing the method names in this class breaks autoload interactions between Phar
|
||
* & framework/commands you use outside of Phar (like when running the Phar WP inside of a command folder).
|
||
* @phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
|
||
*/
|
||
class BootstrapState
|
||
{
|
||
/**
|
||
* Whether the command currently being run is "protected".
|
||
*
|
||
* This means that the command should not be allowed to break due to
|
||
* extension code.
|
||
*/
|
||
const IS_PROTECTED_COMMAND = 'is_protected_command';
|
||
/**
|
||
* Internal storage of the state values.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $state = [];
|
||
/**
|
||
* Get the state value for a given key.
|
||
*
|
||
* @param string $key Key to get the state from.
|
||
* @param mixed $fallback Fallback value to use if the key is not defined.
|
||
*
|
||
* @return mixed
|
||
*/
|
||
public function getValue($key, $fallback = null)
|
||
{
|
||
}
|
||
/**
|
||
* Set the state value for a given key.
|
||
*
|
||
* @param string $key Key to set the state for.
|
||
* @param mixed $value Value to set the state for the given key to.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function setValue($key, $value)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class CheckRoot.
|
||
*
|
||
* Check if the user is running as root and aborts with a warning if they are.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
class CheckRoot implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class ConfigureRunner.
|
||
*
|
||
* Initialize the configuration for the `WP_CLI\Runner` object.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class ConfigureRunner implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class DeclareAbstractBaseCommand.
|
||
*
|
||
* Declares the abstract `WP_CLI_Command` base class.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class DeclareAbstractBaseCommand implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class DeclareFallbackFunctions.
|
||
*
|
||
* Declares functions that might have been disabled but are required.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class DeclareFallbackFunctions implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class DeclareMainClass.
|
||
*
|
||
* Declares the main `WP_CLI` class.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class DeclareMainClass implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class DefineProtectedCommands.
|
||
*
|
||
* Define the commands that are "protected", meaning that they shouldn't be able
|
||
* to break due to extension code.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class DefineProtectedCommands implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
/**
|
||
* Get the list of protected commands.
|
||
*
|
||
* @return array
|
||
*/
|
||
private function get_protected_commands()
|
||
{
|
||
}
|
||
/**
|
||
* Get the current command as a string.
|
||
*
|
||
* @return string Current command to be executed.
|
||
*/
|
||
private function get_current_command()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class IncludeFallbackAutoloader.
|
||
*
|
||
* Loads the fallback autoloader that is provided through the `composer.json`
|
||
* file.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class IncludeFallbackAutoloader extends \WP_CLI\Bootstrap\AutoloaderStep
|
||
{
|
||
/**
|
||
* Get the autoloader paths to scan for an autoloader.
|
||
*
|
||
* @return string[] Array of autoloader paths, or an empty array if none are found.
|
||
*/
|
||
protected function get_autoloader_paths()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class IncludeFrameworkAutoloader.
|
||
*
|
||
* Loads the framework autoloader through an autoloader separate from the
|
||
* Composer one, to avoid coupling the loading of the framework with bundled
|
||
* commands.
|
||
*
|
||
* This only contains classes for the framework.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class IncludeFrameworkAutoloader implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class IncludePackageAutoloader.
|
||
*
|
||
* Loads the package autoloader that includes all the external packages.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class IncludePackageAutoloader extends \WP_CLI\Bootstrap\AutoloaderStep
|
||
{
|
||
/**
|
||
* Get the autoloader paths to scan for an autoloader.
|
||
*
|
||
* @return string[]|false Array of strings with autoloader paths, or false
|
||
* to skip.
|
||
*/
|
||
protected function get_autoloader_paths()
|
||
{
|
||
}
|
||
/**
|
||
* Handle the failure to find an autoloader.
|
||
*
|
||
* @return void
|
||
*/
|
||
protected function handle_failure()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class IncludeRequestsAutoloader.
|
||
*
|
||
* Loads the Requests autoloader that best fits the current environment.
|
||
*
|
||
* If a WordPress installation is found, it autoloads that version of Requests.
|
||
* Otherwise, it loads the version of Requests bundled with WP-CLI.
|
||
*
|
||
* This is done in order to avoid conflicts between Requests versions.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class IncludeRequestsAutoloader implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Requests is being used from the WordPress installation.
|
||
*
|
||
* @var string
|
||
*/
|
||
const FROM_WP_CORE = 'wp-core';
|
||
/**
|
||
* Requests is being used from the WP-CLI dependencies.
|
||
*
|
||
* @var string
|
||
*/
|
||
const FROM_WP_CLI = 'wp-cli';
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
/**
|
||
* Store meta information about the used Requests integration.
|
||
*
|
||
* This can be used for all the conditional code that needs to work
|
||
* across multiple Requests versions.
|
||
*
|
||
* @param string $class_name The class name of the Requests integration.
|
||
* @param string $source The source of the Requests integration.
|
||
*/
|
||
private function store_requests_meta($class_name, $source)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class InitializeColorization.
|
||
*
|
||
* Initialize the colorization through the `WP_CLI\Runner` object.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class InitializeColorization implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class InitializeContexts.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class InitializeContexts implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class InitializeLogger.
|
||
*
|
||
* Initialize the logger through the `WP_CLI\Runner` object.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class InitializeLogger implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
/**
|
||
* Load the class declarations for the loggers.
|
||
*/
|
||
private function declare_loggers()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class LaunchRunner.
|
||
*
|
||
* Kick off the Runner object that starts the actual commands.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class LaunchRunner implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class LoadDispatcher.
|
||
*
|
||
* Loads the dispatcher that will dispatch command names to file locations.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class LoadDispatcher implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class LoadExtraCommand.
|
||
*
|
||
* Loads a command that was passed through the `--exec=<php-code>` option.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class LoadExecCommand implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class LoadRequiredCommand.
|
||
*
|
||
* Loads a command that was passed through the `--require=<command>` option.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class LoadRequiredCommand implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class LoadUtilityFunctions.
|
||
*
|
||
* Loads the functions available through `WP_CLI\Utils`.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class LoadUtilityFunctions implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class RegisterDeferredCommands.
|
||
*
|
||
* Registers the deferred commands that for which no parent was registered yet.
|
||
* This is necessary, because we can have sub-commands that have no direct
|
||
* parent, like `wp network meta`.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class RegisterDeferredCommands implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
/**
|
||
* Add deferred commands that are still waiting to be processed.
|
||
*/
|
||
public function add_deferred_commands()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class RegisterFrameworkCommands.
|
||
*
|
||
* Register the commands that are directly included with the framework.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class RegisterFrameworkCommands implements \WP_CLI\Bootstrap\BootstrapStep
|
||
{
|
||
/**
|
||
* Process this single bootstrapping step.
|
||
*
|
||
* @param BootstrapState $state Contextual state to pass into the step.
|
||
*
|
||
* @return BootstrapState Modified state to pass to the next step.
|
||
*/
|
||
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class RunnerInstance.
|
||
*
|
||
* Convenience class for steps that make use of the `WP_CLI\Runner` object.
|
||
*
|
||
* @package WP_CLI\Bootstrap
|
||
*/
|
||
final class RunnerInstance
|
||
{
|
||
/**
|
||
* Return an instance of the `WP_CLI\Runner` object.
|
||
*
|
||
* Includes necessary class files first as needed.
|
||
*
|
||
* @return Runner
|
||
*/
|
||
public function __invoke()
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
class Completions
|
||
{
|
||
private $cur_word;
|
||
private $words;
|
||
private $opts = [];
|
||
/**
|
||
* Instantiate a Completions object.
|
||
*
|
||
* @param string $line Line of shell input to compute a completion for.
|
||
*/
|
||
public function __construct($line)
|
||
{
|
||
}
|
||
/**
|
||
* Get the specific WP-CLI command that is being referenced.
|
||
*
|
||
* @param array $words Individual input line words.
|
||
*
|
||
* @return array|mixed Array with command and arguments, or error result if command detection failed.
|
||
*/
|
||
private function get_command($words)
|
||
{
|
||
}
|
||
/**
|
||
* Get global parameters.
|
||
*
|
||
* @return array Associative array of global parameters.
|
||
*/
|
||
private function get_global_parameters()
|
||
{
|
||
}
|
||
/**
|
||
* Store individual option.
|
||
*
|
||
* @param string $opt Option to store.
|
||
*
|
||
* @return void
|
||
*/
|
||
private function add($opt)
|
||
{
|
||
}
|
||
/**
|
||
* Render the stored options.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function render()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Handles file- and runtime-based configuration values.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class Configurator
|
||
{
|
||
/**
|
||
* Configurator argument specification.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $spec;
|
||
/**
|
||
* Values for keys defined in Configurator spec.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $config = [];
|
||
/**
|
||
* Extra config values not specified in spec.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $extra_config = [];
|
||
/**
|
||
* Any aliases defined in config files.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $aliases = [];
|
||
/**
|
||
* Regex pattern used to define an alias.
|
||
*
|
||
* @var string
|
||
*/
|
||
const ALIAS_REGEX = '^@[A-Za-z0-9-_\.\-]+$';
|
||
/**
|
||
* Arguments that can be used in an alias.
|
||
*
|
||
* @var array
|
||
*/
|
||
private static $alias_spec = ['user', 'url', 'path', 'ssh', 'http', 'proxyjump', 'key'];
|
||
/**
|
||
* @param string $path Path to config spec file.
|
||
*/
|
||
public function __construct($path)
|
||
{
|
||
}
|
||
/**
|
||
* Loads the config spec file.
|
||
*
|
||
* @param string $path Path to the config spec file.
|
||
*/
|
||
private function load_config_spec($path)
|
||
{
|
||
}
|
||
/**
|
||
* Get declared configuration values as an array.
|
||
*
|
||
* @return array
|
||
*/
|
||
public function to_array()
|
||
{
|
||
}
|
||
/**
|
||
* Get configuration specification, i.e. list of accepted keys.
|
||
*
|
||
* @return array
|
||
*/
|
||
public function get_spec()
|
||
{
|
||
}
|
||
/**
|
||
* Get any aliases defined in config files.
|
||
*
|
||
* @return array
|
||
*/
|
||
public function get_aliases()
|
||
{
|
||
}
|
||
/**
|
||
* Splits a list of arguments into positional, associative and config.
|
||
*
|
||
* @param array<string> $arguments
|
||
* @return array<array<string>>
|
||
*/
|
||
public function parse_args($arguments)
|
||
{
|
||
}
|
||
/**
|
||
* Splits positional args from associative args.
|
||
*
|
||
* @param array<string> $arguments
|
||
* @return array{0: array<string>, 1: array<array{0: string, 1: string|bool}>, 2: array<array{0: string, 1: string|bool}>, 3: array<array{0: string, 1: string|bool}>}
|
||
*/
|
||
public static function extract_assoc($arguments)
|
||
{
|
||
}
|
||
/**
|
||
* Separate runtime parameters from command-specific parameters.
|
||
*
|
||
* @param array $mixed_args
|
||
* @return array
|
||
*/
|
||
private function unmix_assoc_args($mixed_args, $global_assoc = [], $local_assoc = [])
|
||
{
|
||
}
|
||
/**
|
||
* Handle turning an $assoc_arg into a runtime arg.
|
||
*/
|
||
private function assoc_arg_to_runtime_config($key, $value, &$runtime_config)
|
||
{
|
||
}
|
||
/**
|
||
* Load a YAML file of parameters into scope.
|
||
*
|
||
* @param string $path Path to YAML file.
|
||
*/
|
||
public function merge_yml($path, $current_alias = null)
|
||
{
|
||
}
|
||
/**
|
||
* Merge an array of values into the configurator config.
|
||
*
|
||
* @param array $config
|
||
*/
|
||
public function merge_array($config)
|
||
{
|
||
}
|
||
/**
|
||
* Load values from a YAML file.
|
||
*
|
||
* @param string $yml_file Path to the YAML file
|
||
* @return array Declared configuration values
|
||
*/
|
||
private static function load_yml($yml_file)
|
||
{
|
||
}
|
||
/**
|
||
* Conform a variable to an array.
|
||
*
|
||
* @param mixed $val A string or an array
|
||
*/
|
||
private static function arrayify(&$val)
|
||
{
|
||
}
|
||
/**
|
||
* Make a path absolute.
|
||
*
|
||
* @param string $path Path to file.
|
||
* @param string $base Base path to prepend.
|
||
*/
|
||
private static function absolutize(&$path, $base)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Context that can be selected in order to run commands within a properly
|
||
* set-up environment.
|
||
*/
|
||
interface Context
|
||
{
|
||
const ADMIN = 'admin';
|
||
const AUTO = 'auto';
|
||
const CLI = 'cli';
|
||
const FRONTEND = 'frontend';
|
||
/**
|
||
* Debugging group to use for all context-related debug messages.
|
||
*
|
||
* @var string
|
||
*/
|
||
const DEBUG_GROUP = 'context';
|
||
/**
|
||
* Process the context to set up the environment correctly.
|
||
*
|
||
* @param array $config Associative array of configuration data.
|
||
* @return void
|
||
*/
|
||
public function process($config);
|
||
}
|
||
}
|
||
namespace WP_CLI\Context {
|
||
/**
|
||
* Context which simulates the administrator backend.
|
||
*/
|
||
final class Admin implements \WP_CLI\Context
|
||
{
|
||
/**
|
||
* Process the context to set up the environment correctly.
|
||
*
|
||
* @param array $config Associative array of configuration data.
|
||
* @return void
|
||
*/
|
||
public function process($config)
|
||
{
|
||
}
|
||
/**
|
||
* Ensure the current request is done under a logged-in administrator
|
||
* account.
|
||
*
|
||
* A lot of premium plugins/themes have their custom update routines locked
|
||
* behind an is_admin() call.
|
||
*
|
||
* @return void
|
||
*/
|
||
private function log_in_as_admin_user()
|
||
{
|
||
}
|
||
/**
|
||
* Load the admin environment.
|
||
*
|
||
* This tries to load `wp-admin/admin.php` while trying to avoid issues
|
||
* like re-loading the wp-config.php file (which redeclares constants).
|
||
*
|
||
* To make this work across WordPress versions, we use the actual file and
|
||
* modify it on-the-fly.
|
||
*
|
||
* @global string $hook_suffix
|
||
* @global string $pagenow
|
||
* @global int $wp_db_version
|
||
* @global array $_wp_submenu_nopriv
|
||
*
|
||
* @return void
|
||
*/
|
||
private function load_admin_environment()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Context which switches to other contexts automatically based on conditions.
|
||
*/
|
||
final class Auto implements \WP_CLI\Context
|
||
{
|
||
/**
|
||
* Array of commands to intercept.
|
||
*
|
||
* @var array<array>
|
||
*/
|
||
const COMMANDS_TO_RUN_AS_ADMIN = [['plugin'], ['theme']];
|
||
/**
|
||
* Context manager instance to use.
|
||
*
|
||
* @var ContextManager
|
||
*/
|
||
private $context_manager;
|
||
/**
|
||
* Instantiate an Auto object.
|
||
*
|
||
* @param ContextManager $context_manager Context manager instance to use.
|
||
*/
|
||
public function __construct(\WP_CLI\ContextManager $context_manager)
|
||
{
|
||
}
|
||
/**
|
||
* Process the context to set up the environment correctly.
|
||
*
|
||
* @param array $config Associative array of configuration data.
|
||
* @return void
|
||
* @throws WP_CLI\ExitException If an invalid context was deduced.
|
||
*/
|
||
public function process($config)
|
||
{
|
||
}
|
||
/**
|
||
* Deduce the best context to run the current command in.
|
||
*
|
||
* @return string Context to use.
|
||
*/
|
||
private function deduce_best_context()
|
||
{
|
||
}
|
||
/**
|
||
* Check whether the current WP-CLI command is amongst those we want to
|
||
* run as admin.
|
||
*
|
||
* @return bool Whether the current command should be run as admin.
|
||
*/
|
||
private function is_command_to_run_as_admin()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Default WP-CLI context.
|
||
*/
|
||
final class Cli implements \WP_CLI\Context
|
||
{
|
||
/**
|
||
* Process the context to set up the environment correctly.
|
||
*
|
||
* @param array $config Associative array of configuration data.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function process($config)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Context which simulates a frontend request.
|
||
*/
|
||
final class Frontend implements \WP_CLI\Context
|
||
{
|
||
/**
|
||
* Process the context to set up the environment correctly.
|
||
*
|
||
* @param array $config Associative array of configuration data.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function process($config)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
/**
|
||
* Context manager to register_context and process different contexts that commands can
|
||
* run within.
|
||
*/
|
||
final class ContextManager
|
||
{
|
||
/**
|
||
* Associative array of context implementations.
|
||
*
|
||
* @var array<string, Context>
|
||
*/
|
||
private $contexts = [];
|
||
/**
|
||
* Store the current context.
|
||
*
|
||
* @var string Current context.
|
||
*/
|
||
private $current_context = \WP_CLI\Context::CLI;
|
||
/**
|
||
* Register a context with WP-CLI.
|
||
*
|
||
* @param string $name Name of the context.
|
||
* @param Context $implementation Implementation of the context.
|
||
*/
|
||
public function register_context($name, \WP_CLI\Context $implementation)
|
||
{
|
||
}
|
||
/**
|
||
* Switch the context in which to run WP-CLI.
|
||
*
|
||
* @param array $config Associative array of configuration data.
|
||
* @return void
|
||
*
|
||
* @throws ExitException When an invalid context was requested.
|
||
*/
|
||
public function switch_context($config)
|
||
{
|
||
}
|
||
/**
|
||
* Return the current context.
|
||
*
|
||
* @return string Current context.
|
||
*/
|
||
public function get_context()
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Dispatcher {
|
||
/**
|
||
* Controls whether adding of a command should be completed or not.
|
||
*
|
||
* This is needed because we can't reliably pass scalar values by reference
|
||
* through the hooks mechanism. An object is always passed by reference.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
final class CommandAddition
|
||
{
|
||
/**
|
||
* Whether the command addition was aborted or not.
|
||
*
|
||
* @var bool
|
||
*/
|
||
private $abort = false;
|
||
/**
|
||
* Reason for which the addition was aborted.
|
||
*
|
||
* @var string
|
||
*/
|
||
private $reason = '';
|
||
/**
|
||
* Abort the current command addition.
|
||
*
|
||
* @param string $reason Reason as to why the addition was aborted.
|
||
*/
|
||
public function abort($reason = '')
|
||
{
|
||
}
|
||
/**
|
||
* Check whether the command addition was aborted.
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function was_aborted()
|
||
{
|
||
}
|
||
/**
|
||
* Get the reason as to why the addition was aborted.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_reason()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Creates CompositeCommand or Subcommand instances.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class CommandFactory
|
||
{
|
||
// Cache of file contents, indexed by filename. Only used if opcache.save_comments is disabled.
|
||
private static $file_contents = [];
|
||
/**
|
||
* Create a new CompositeCommand (or Subcommand if class has __invoke())
|
||
*
|
||
* @param string $name Represents how the command should be invoked
|
||
* @param string|callable-string|callable|array $callable A subclass of WP_CLI_Command, a function, or a closure
|
||
* @param mixed $parent The new command's parent Composite (or Root) command
|
||
*/
|
||
public static function create($name, $callable, $parent)
|
||
{
|
||
}
|
||
/**
|
||
* Clear the file contents cache.
|
||
*/
|
||
public static function clear_file_contents_cache()
|
||
{
|
||
}
|
||
/**
|
||
* Create a new Subcommand instance.
|
||
*
|
||
* @param mixed $parent The new command's parent Composite command
|
||
* @param string|bool $name Represents how the command should be invoked.
|
||
* If false, will be determined from the documented subject, represented by `$reflection`.
|
||
* @param mixed $callable A callable function or closure, or class name and method
|
||
* @param object $reflection Reflection instance, for doc parsing
|
||
*/
|
||
private static function create_subcommand($parent, $name, $callable, $reflection)
|
||
{
|
||
}
|
||
/**
|
||
* Create a new Composite command instance.
|
||
*
|
||
* @param mixed $parent The new command's parent Root or Composite command
|
||
* @param string $name Represents how the command should be invoked
|
||
* @param mixed $callable
|
||
*/
|
||
private static function create_composite_command($parent, $name, $callable)
|
||
{
|
||
}
|
||
/**
|
||
* Create a new command namespace instance.
|
||
*
|
||
* @param mixed $parent The new namespace's parent Root or Composite command.
|
||
* @param string $name Represents how the command should be invoked
|
||
* @param mixed $callable
|
||
*/
|
||
private static function create_namespace($parent, $name, $callable)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether a method is actually callable.
|
||
*
|
||
* @param ReflectionMethod $method
|
||
* @return bool
|
||
*/
|
||
private static function is_good_method($method)
|
||
{
|
||
}
|
||
/**
|
||
* Gets the document comment. Caters for PHP directive `opcache.save comments` being disabled.
|
||
*
|
||
* @param ReflectionMethod|ReflectionClass|ReflectionFunction $reflection Reflection instance.
|
||
* @return string|false|null Doc comment string if any, false if none (same as `Reflection*::getDocComment()`), null if error.
|
||
*/
|
||
private static function get_doc_comment($reflection)
|
||
{
|
||
}
|
||
/**
|
||
* Returns the last doc comment if any in `$content`.
|
||
*
|
||
* @param string $content The content, which should end at the class or function declaration.
|
||
* @return string|bool The last doc comment if any, or false if none.
|
||
*/
|
||
private static function extract_last_doc_comment($content)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* A non-leaf node in the command tree.
|
||
* Contains one or more Subcommands.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class CompositeCommand
|
||
{
|
||
protected $name;
|
||
protected $shortdesc;
|
||
protected $longdesc;
|
||
protected $synopsis;
|
||
protected $hook;
|
||
protected $docparser;
|
||
protected $parent;
|
||
protected $subcommands = [];
|
||
/**
|
||
* Instantiate a new CompositeCommand
|
||
*
|
||
* @param mixed $parent Parent command (either Root or Composite)
|
||
* @param string $name Represents how command should be invoked
|
||
* @param DocParser $docparser
|
||
*/
|
||
public function __construct($parent, $name, $docparser)
|
||
{
|
||
}
|
||
/**
|
||
* Get the parent composite (or root) command
|
||
*
|
||
* @return mixed
|
||
*/
|
||
public function get_parent()
|
||
{
|
||
}
|
||
/**
|
||
* Add a named subcommand to this composite command's
|
||
* set of contained subcommands.
|
||
*
|
||
* @param string $name Represents how subcommand should be invoked
|
||
* @param Subcommand|CompositeCommand $command Cub-command to add.
|
||
* @param bool $override Optional. Whether to override an existing subcommand of the same
|
||
* name.
|
||
*/
|
||
public function add_subcommand($name, $command, $override = true)
|
||
{
|
||
}
|
||
/**
|
||
* Remove a named subcommand from this composite command's set of contained
|
||
* subcommands
|
||
*
|
||
* @param string $name Represents how subcommand should be invoked
|
||
*/
|
||
public function remove_subcommand($name)
|
||
{
|
||
}
|
||
/**
|
||
* Composite commands always contain subcommands.
|
||
*
|
||
* @return true
|
||
*/
|
||
public function can_have_subcommands()
|
||
{
|
||
}
|
||
/**
|
||
* Get the subcommands contained by this composite
|
||
* command.
|
||
*
|
||
* @return array
|
||
*/
|
||
public function get_subcommands()
|
||
{
|
||
}
|
||
/**
|
||
* Get the name of this composite command.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_name()
|
||
{
|
||
}
|
||
/**
|
||
* Get the short description for this composite
|
||
* command.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_shortdesc()
|
||
{
|
||
}
|
||
/**
|
||
* Get the hook name for this composite
|
||
* command.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_hook()
|
||
{
|
||
}
|
||
/**
|
||
* Set the short description for this composite command.
|
||
*
|
||
* @param string $shortdesc
|
||
*/
|
||
public function set_shortdesc($shortdesc)
|
||
{
|
||
}
|
||
/**
|
||
* Get the long description for this composite
|
||
* command.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_longdesc()
|
||
{
|
||
}
|
||
/**
|
||
* Set the long description for this composite command
|
||
*
|
||
* @param string $longdesc
|
||
*/
|
||
public function set_longdesc($longdesc)
|
||
{
|
||
}
|
||
/**
|
||
* Get the synopsis for this composite command.
|
||
* As a collection of subcommands, the composite
|
||
* command is only intended to invoke those
|
||
* subcommands.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_synopsis()
|
||
{
|
||
}
|
||
/**
|
||
* Get the usage for this composite command.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_usage($prefix)
|
||
{
|
||
}
|
||
/**
|
||
* Show the usage for all subcommands contained
|
||
* by the composite command.
|
||
*/
|
||
public function show_usage()
|
||
{
|
||
}
|
||
/**
|
||
* When a composite command is invoked, it shows usage
|
||
* docs for its subcommands.
|
||
*
|
||
* @param array $args
|
||
* @param array $assoc_args
|
||
* @param array $extra_args
|
||
*/
|
||
public function invoke($args, $assoc_args, $extra_args)
|
||
{
|
||
}
|
||
/**
|
||
* Given supplied arguments, find a contained
|
||
* subcommand
|
||
*
|
||
* @param array $args
|
||
* @return Subcommand|false
|
||
*/
|
||
public function find_subcommand(&$args)
|
||
{
|
||
}
|
||
/**
|
||
* Get any registered aliases for this composite command's
|
||
* subcommands.
|
||
*
|
||
* @param array $subcommands
|
||
* @return array
|
||
*/
|
||
private static function get_aliases($subcommands)
|
||
{
|
||
}
|
||
/**
|
||
* Composite commands can only be known by one name.
|
||
*
|
||
* @return string|false
|
||
*/
|
||
public function get_alias()
|
||
{
|
||
}
|
||
/***
|
||
* Get the list of global parameters
|
||
*
|
||
* @param string $root_command whether to include or not root command specific description
|
||
* @return string
|
||
*/
|
||
protected function get_global_params($root_command = false)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Adds a command namespace without actual functionality.
|
||
*
|
||
* This is meant to provide the means to attach meta information to a namespace
|
||
* when there's no actual command needed.
|
||
*
|
||
* In case a real command gets registered for the same name, it replaces the
|
||
* command namespace.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class CommandNamespace extends \WP_CLI\Dispatcher\CompositeCommand
|
||
{
|
||
/**
|
||
* Show the usage for all subcommands contained
|
||
* by the composite command.
|
||
*/
|
||
public function show_usage()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* The root node in the command tree.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class RootCommand extends \WP_CLI\Dispatcher\CompositeCommand
|
||
{
|
||
public function __construct()
|
||
{
|
||
}
|
||
/**
|
||
* Get the human-readable long description.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_longdesc()
|
||
{
|
||
}
|
||
/**
|
||
* Find a subcommand registered on the root
|
||
* command.
|
||
*
|
||
* @param array $args
|
||
* @return Subcommand|false
|
||
*/
|
||
public function find_subcommand(&$args)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* A leaf node in the command tree.
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class Subcommand extends \WP_CLI\Dispatcher\CompositeCommand
|
||
{
|
||
private $alias;
|
||
private $when_invoked;
|
||
public function __construct($parent, $name, $docparser, $when_invoked)
|
||
{
|
||
}
|
||
/**
|
||
* Extract the synopsis from PHPdoc string.
|
||
*
|
||
* @param string $longdesc Command docs via PHPdoc
|
||
* @return string
|
||
*/
|
||
private static function extract_synopsis($longdesc)
|
||
{
|
||
}
|
||
/**
|
||
* Subcommands can't have subcommands because they
|
||
* represent code to be executed.
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function can_have_subcommands()
|
||
{
|
||
}
|
||
/**
|
||
* Get the synopsis string for this subcommand.
|
||
* A synopsis defines what runtime arguments are
|
||
* expected, useful to humans and argument validation.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_synopsis()
|
||
{
|
||
}
|
||
/**
|
||
* Set the synopsis string for this subcommand.
|
||
*
|
||
* @param string $synopsis
|
||
*/
|
||
public function set_synopsis($synopsis)
|
||
{
|
||
}
|
||
/**
|
||
* If an alias is set, grant access to it.
|
||
* Aliases permit subcommands to be instantiated
|
||
* with a secondary identity.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_alias()
|
||
{
|
||
}
|
||
/**
|
||
* Print the usage details to the end user.
|
||
*
|
||
* @param string $prefix
|
||
*/
|
||
public function show_usage($prefix = 'usage: ')
|
||
{
|
||
}
|
||
/**
|
||
* Get the usage of the subcommand as a formatted string.
|
||
*
|
||
* @param string $prefix
|
||
* @return string
|
||
*/
|
||
public function get_usage($prefix)
|
||
{
|
||
}
|
||
/**
|
||
* Wrapper for CLI Tools' prompt() method.
|
||
*
|
||
* @param string $question
|
||
* @param string $default
|
||
* @return string|false
|
||
*/
|
||
private function prompt($question, $default)
|
||
{
|
||
}
|
||
/**
|
||
* Interactively prompt the user for input
|
||
* based on defined synopsis and passed arguments.
|
||
*
|
||
* @param array $args
|
||
* @param array $assoc_args
|
||
* @return array
|
||
*/
|
||
private function prompt_args($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Validate the supplied arguments to the command.
|
||
* Throws warnings or errors if arguments are missing
|
||
* or invalid.
|
||
*
|
||
* @param array $args
|
||
* @param array $assoc_args
|
||
* @param array $extra_args
|
||
* @return array list of invalid $assoc_args keys to unset
|
||
*/
|
||
private function validate_args($args, $assoc_args, $extra_args)
|
||
{
|
||
}
|
||
/**
|
||
* Invoke the subcommand with the supplied arguments.
|
||
* Given a --prompt argument, interactively request input
|
||
* from the end user.
|
||
*
|
||
* @param array $args
|
||
* @param array $assoc_args
|
||
*/
|
||
public function invoke($args, $assoc_args, $extra_args)
|
||
{
|
||
}
|
||
/**
|
||
* Get an array of parameter names, by merging the command-specific and the
|
||
* global parameters.
|
||
*
|
||
* @param array $spec Optional. Specification of the current command.
|
||
*
|
||
* @return array Array of parameter names
|
||
*/
|
||
private function get_parameters($spec = [])
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
/**
|
||
* Parse command attributes from its PHPdoc.
|
||
* Used to determine execution characteristics (arguments, etc.).
|
||
*/
|
||
class DocParser
|
||
{
|
||
/**
|
||
* PHPdoc command for the command.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $doc_comment;
|
||
/**
|
||
* @param string $doc_comment
|
||
*/
|
||
public function __construct($doc_comment)
|
||
{
|
||
}
|
||
/**
|
||
* Remove unused cruft from PHPdoc comment.
|
||
*
|
||
* @param string $comment PHPdoc comment.
|
||
* @return string
|
||
*/
|
||
private static function remove_decorations($comment)
|
||
{
|
||
}
|
||
/**
|
||
* Get the command's short description (e.g. summary).
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_shortdesc()
|
||
{
|
||
}
|
||
/**
|
||
* Get the command's full description
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_longdesc()
|
||
{
|
||
}
|
||
/**
|
||
* Get the value for a given tag (e.g. "@alias" or "@subcommand")
|
||
*
|
||
* @param string $name Name for the tag, without '@'
|
||
* @return string
|
||
*/
|
||
public function get_tag($name)
|
||
{
|
||
}
|
||
/**
|
||
* Get the command's synopsis.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_synopsis()
|
||
{
|
||
}
|
||
/**
|
||
* Get the description for a given argument.
|
||
*
|
||
* @param string $name Argument's doc name.
|
||
* @return string
|
||
*/
|
||
public function get_arg_desc($name)
|
||
{
|
||
}
|
||
/**
|
||
* Get the arguments for a given argument.
|
||
*
|
||
* @param string $name Argument's doc name.
|
||
* @return mixed|null
|
||
*/
|
||
public function get_arg_args($name)
|
||
{
|
||
}
|
||
/**
|
||
* Get the description for a given parameter.
|
||
*
|
||
* @param string $key Parameter's key.
|
||
* @return string
|
||
*/
|
||
public function get_param_desc($key)
|
||
{
|
||
}
|
||
/**
|
||
* Get the arguments for a given parameter.
|
||
*
|
||
* @param string $key Parameter's key.
|
||
* @return mixed|null
|
||
*/
|
||
public function get_param_args($key)
|
||
{
|
||
}
|
||
/**
|
||
* Get the args for an arg or param
|
||
*
|
||
* @param string $regex Pattern to match against
|
||
* @return array|null Interpreted YAML document, or null.
|
||
*/
|
||
private function get_arg_or_param_args($regex)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Exception {
|
||
class NonExistentKeyException extends \OutOfBoundsException
|
||
{
|
||
/** @var RecursiveDataStructureTraverser */
|
||
protected $traverser;
|
||
/**
|
||
* @param RecursiveDataStructureTraverser $traverser
|
||
*/
|
||
public function set_traverser($traverser)
|
||
{
|
||
}
|
||
/**
|
||
* @return RecursiveDataStructureTraverser
|
||
*/
|
||
public function get_traverser()
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
class ExitException extends \Exception
|
||
{
|
||
}
|
||
/**
|
||
* Extract a provided archive file.
|
||
*/
|
||
class Extractor
|
||
{
|
||
/**
|
||
* Extract the archive file to a specific destination.
|
||
*
|
||
* @param string $dest
|
||
*/
|
||
public static function extract($tarball_or_zip, $dest)
|
||
{
|
||
}
|
||
/**
|
||
* Extract a ZIP file to a specific destination.
|
||
*
|
||
* @param string $zipfile
|
||
* @param string $dest
|
||
*/
|
||
private static function extract_zip($zipfile, $dest)
|
||
{
|
||
}
|
||
/**
|
||
* Extract a tarball to a specific destination.
|
||
*
|
||
* @param string $tarball
|
||
* @param string $dest
|
||
*/
|
||
private static function extract_tarball($tarball, $dest)
|
||
{
|
||
}
|
||
/**
|
||
* Copy files from source directory to destination directory. Source
|
||
* directory must exist.
|
||
*
|
||
* @param string $source
|
||
* @param string $dest
|
||
*/
|
||
public static function copy_overwrite_files($source, $dest)
|
||
{
|
||
}
|
||
/**
|
||
* Delete all files and directories recursively from directory. Directory
|
||
* must exist.
|
||
*
|
||
* @param string $dir
|
||
*/
|
||
public static function rmdir($dir)
|
||
{
|
||
}
|
||
/**
|
||
* Return formatted ZipArchive error message from error code.
|
||
*
|
||
* @param int $error_code
|
||
* @return string|int The error message corresponding to the specified
|
||
* code, if found; Other wise the same error code,
|
||
* unmodified.
|
||
*/
|
||
public static function zip_error_msg($error_code)
|
||
{
|
||
}
|
||
/**
|
||
* Return formatted error message from ProcessRun of tar command.
|
||
*
|
||
* @param ProcessRun $process_run
|
||
* @return string|int The error message of the process, if available;
|
||
* otherwise the return code.
|
||
*/
|
||
public static function tar_error_msg($process_run)
|
||
{
|
||
}
|
||
/**
|
||
* Return the first subfolder within a given path.
|
||
*
|
||
* Falls back to the provided path if no subfolder was detected.
|
||
*
|
||
* @param string $path Path to find the first subfolder in.
|
||
* @return string First subfolder, or same as $path if none found.
|
||
*/
|
||
private static function get_first_subfolder($path)
|
||
{
|
||
}
|
||
/**
|
||
* Ensure directory exists.
|
||
*
|
||
* @param string $dir Directory to ensure the existence of.
|
||
* @return bool Whether the existence could be asserted.
|
||
*/
|
||
private static function ensure_dir_exists($dir)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether a path is relative-
|
||
*
|
||
* @param string $path Path to check.
|
||
* @return bool Whether the path is relative.
|
||
*/
|
||
private static function path_is_relative($path)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Fetchers {
|
||
/**
|
||
* Fetch a WordPress entity for use in a subcommand.
|
||
*/
|
||
abstract class Base
|
||
{
|
||
/**
|
||
* The message to display when an item is not found.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $msg;
|
||
/**
|
||
* @param string|int $arg The raw CLI argument.
|
||
* @return mixed|false The item if found; false otherwise.
|
||
*/
|
||
abstract public function get($arg);
|
||
/**
|
||
* Like get(), but calls WP_CLI::error() instead of returning false.
|
||
*
|
||
* @param string $arg The raw CLI argument.
|
||
* @return mixed The item if found.
|
||
* @throws ExitException If the item is not found.
|
||
*/
|
||
public function get_check($arg)
|
||
{
|
||
}
|
||
/**
|
||
* Get multiple items.
|
||
*
|
||
* @param array $args The raw CLI arguments.
|
||
* @return array The list of found items.
|
||
*/
|
||
public function get_many($args)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Fetch a WordPress comment based on one of its attributes.
|
||
*/
|
||
class Comment extends \WP_CLI\Fetchers\Base
|
||
{
|
||
/**
|
||
* The message to display when an item is not found.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $msg = 'Could not find the comment with ID %d.';
|
||
/**
|
||
* Get a comment object by ID
|
||
*
|
||
* @param string $arg The raw CLI argument.
|
||
* @return WP_Comment|array|false The item if found; false otherwise.
|
||
*/
|
||
public function get($arg)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Fetch a WordPress post based on one of its attributes.
|
||
*/
|
||
class Post extends \WP_CLI\Fetchers\Base
|
||
{
|
||
/**
|
||
* The message to display when an item is not found.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $msg = 'Could not find the post with ID %d.';
|
||
/**
|
||
* Get a post object by ID
|
||
*
|
||
* @param string $arg The raw CLI argument.
|
||
* @return WP_Post|array|false The item if found; false otherwise.
|
||
*/
|
||
public function get($arg)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Fetch a signup based on one of its attributes.
|
||
*/
|
||
class Signup extends \WP_CLI\Fetchers\Base
|
||
{
|
||
/**
|
||
* The message to display when an item is not found.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $msg = "Invalid signup ID, email, login, or activation key: '%s'";
|
||
/**
|
||
* Get a signup.
|
||
*
|
||
* @param int|string $signup
|
||
* @return object|false
|
||
*/
|
||
public function get($signup)
|
||
{
|
||
}
|
||
/**
|
||
* Get a signup by one of its identifying attributes.
|
||
*
|
||
* @param string $arg The raw CLI argument.
|
||
* @return object|false The item if found; false otherwise.
|
||
*/
|
||
protected function get_signup($arg)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Fetch a WordPress site based on one of its attributes.
|
||
*/
|
||
class Site extends \WP_CLI\Fetchers\Base
|
||
{
|
||
/**
|
||
* The message to display when an item is not found.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $msg = 'Could not find the site with ID %d.';
|
||
/**
|
||
* Get a site object by ID
|
||
*
|
||
* @param int $site_id
|
||
* @return object|false
|
||
*/
|
||
public function get($site_id)
|
||
{
|
||
}
|
||
/**
|
||
* Get site (blog) data for a given id.
|
||
*
|
||
* @global wpdb $wpdb WordPress database abstraction object.
|
||
*
|
||
* @param string $arg The raw CLI argument.
|
||
* @return array|false The item if found; false otherwise.
|
||
*/
|
||
private function get_site($arg)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Fetch a WordPress user based on one of its attributes.
|
||
*/
|
||
class User extends \WP_CLI\Fetchers\Base
|
||
{
|
||
/**
|
||
* The message to display when an item is not found.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $msg = "Invalid user ID, email or login: '%s'";
|
||
/**
|
||
* Get a user object by one of its identifying attributes.
|
||
*
|
||
* @param string $arg The raw CLI argument.
|
||
* @return WP_User|false The item if found; false otherwise.
|
||
*/
|
||
public function get($arg)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
/**
|
||
* Reads/writes to a filesystem cache
|
||
*/
|
||
class FileCache
|
||
{
|
||
/**
|
||
* @var string cache path
|
||
*/
|
||
protected $root;
|
||
/**
|
||
* @var bool
|
||
*/
|
||
protected $enabled = true;
|
||
/**
|
||
* @var int files time to live
|
||
*/
|
||
protected $ttl;
|
||
/**
|
||
* @var int max total size
|
||
*/
|
||
protected $max_size;
|
||
/**
|
||
* @var string key allowed chars (regex class)
|
||
*/
|
||
protected $whitelist;
|
||
/**
|
||
* @param string $cache_dir location of the cache
|
||
* @param int $ttl cache files default time to live (expiration)
|
||
* @param int $max_size max total cache size
|
||
* @param string $whitelist List of characters that are allowed in path names (used in a regex character class)
|
||
*/
|
||
public function __construct($cache_dir, $ttl, $max_size, $whitelist = 'a-z0-9._-')
|
||
{
|
||
}
|
||
/**
|
||
* Cache is enabled
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function is_enabled()
|
||
{
|
||
}
|
||
/**
|
||
* Cache root
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_root()
|
||
{
|
||
}
|
||
/**
|
||
* Check if a file is in cache and return its filename
|
||
*
|
||
* @param string $key cache key
|
||
* @param int $ttl time to live
|
||
* @return bool|string filename or false
|
||
*/
|
||
public function has($key, $ttl = null)
|
||
{
|
||
}
|
||
/**
|
||
* Write to cache file
|
||
*
|
||
* @param string $key cache key
|
||
* @param string $contents file contents
|
||
* @return bool
|
||
*/
|
||
public function write($key, $contents)
|
||
{
|
||
}
|
||
/**
|
||
* Read from cache file
|
||
*
|
||
* @param string $key cache key
|
||
* @param int $ttl time to live
|
||
* @return bool|string file contents or false
|
||
*/
|
||
public function read($key, $ttl = null)
|
||
{
|
||
}
|
||
/**
|
||
* Copy a file into the cache
|
||
*
|
||
* @param string $key cache key
|
||
* @param string $source source filename; tmp file filepath from HTTP response
|
||
* @return bool
|
||
*/
|
||
public function import($key, $source)
|
||
{
|
||
}
|
||
/**
|
||
* Copy a file out of the cache
|
||
*
|
||
* @param string $key cache key
|
||
* @param string $target target filename
|
||
* @param int $ttl time to live
|
||
* @return bool
|
||
*/
|
||
public function export($key, $target, $ttl = null)
|
||
{
|
||
}
|
||
/**
|
||
* Remove file from cache
|
||
*
|
||
* @param string $key cache key
|
||
* @return bool
|
||
*/
|
||
public function remove($key)
|
||
{
|
||
}
|
||
/**
|
||
* Clean cache based on time to live and max size
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function clean()
|
||
{
|
||
}
|
||
/**
|
||
* Remove all cached files.
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function clear()
|
||
{
|
||
}
|
||
/**
|
||
* Remove all cached files except for the newest version of one.
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function prune()
|
||
{
|
||
}
|
||
/**
|
||
* Ensure directory exists
|
||
*
|
||
* @param string $dir directory
|
||
* @return bool
|
||
*/
|
||
protected function ensure_dir_exists($dir)
|
||
{
|
||
}
|
||
/**
|
||
* Prepare cache write
|
||
*
|
||
* @param string $key cache key
|
||
* @return bool|string The destination filename or false when cache disabled or directory creation fails.
|
||
*/
|
||
protected function prepare_write($key)
|
||
{
|
||
}
|
||
/**
|
||
* Validate cache key
|
||
*
|
||
* @param string $key cache key
|
||
* @return string relative filename
|
||
*/
|
||
protected function validate_key($key)
|
||
{
|
||
}
|
||
/**
|
||
* Destination filename from key
|
||
*
|
||
* @param string $key
|
||
* @return string filename
|
||
*/
|
||
protected function filename($key)
|
||
{
|
||
}
|
||
/**
|
||
* Get a Finder that iterates in cache root only the files
|
||
*
|
||
* @return Finder
|
||
*/
|
||
protected function get_finder()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Output one or more items in a given format (e.g. table, JSON).
|
||
*/
|
||
class Formatter
|
||
{
|
||
/**
|
||
* How the items should be output.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $args;
|
||
/**
|
||
* Standard prefix for object fields.
|
||
*
|
||
* @var string
|
||
*/
|
||
private $prefix;
|
||
/**
|
||
* @param array $assoc_args Output format arguments.
|
||
* @param array $fields Fields to display of each item.
|
||
* @param string|bool $prefix Check if fields have a standard prefix.
|
||
* False indicates empty prefix.
|
||
*/
|
||
public function __construct(&$assoc_args, $fields = null, $prefix = false)
|
||
{
|
||
}
|
||
/**
|
||
* Magic getter for arguments.
|
||
*
|
||
* @param string $key
|
||
* @return mixed
|
||
*/
|
||
public function __get($key)
|
||
{
|
||
}
|
||
/**
|
||
* Display multiple items according to the output arguments.
|
||
*
|
||
* @param array|Iterator $items The items to display.
|
||
* @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `format()` if items in the table are pre-colorized. Default false.
|
||
*/
|
||
public function display_items($items, $ascii_pre_colorized = false)
|
||
{
|
||
}
|
||
/**
|
||
* Display a single item according to the output arguments.
|
||
*
|
||
* @param mixed $item
|
||
* @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `show_multiple_fields()` if the item in the table is pre-colorized. Default false.
|
||
*/
|
||
public function display_item($item, $ascii_pre_colorized = false)
|
||
{
|
||
}
|
||
/**
|
||
* Format items according to arguments.
|
||
*
|
||
* @param array $items
|
||
* @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `show_table()` if items in the table are pre-colorized. Default false.
|
||
*/
|
||
private function format($items, $ascii_pre_colorized = false)
|
||
{
|
||
}
|
||
/**
|
||
* Show a single field from a list of items.
|
||
*
|
||
* @param array $items Array of objects to show fields from
|
||
* @param string $field The field to show
|
||
*/
|
||
private function show_single_field($items, $field)
|
||
{
|
||
}
|
||
/**
|
||
* Find an object's key.
|
||
* If $prefix is set, a key with that prefix will be prioritized.
|
||
*
|
||
* @param object $item
|
||
* @param string $field
|
||
* @return string
|
||
*/
|
||
private function find_item_key($item, $field)
|
||
{
|
||
}
|
||
/**
|
||
* Show multiple fields of an object.
|
||
*
|
||
* @param object|array $data Data to display
|
||
* @param string $format Format to display the data in
|
||
* @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `show_table()` if the item in the table is pre-colorized. Default false.
|
||
*/
|
||
private function show_multiple_fields($data, $format, $ascii_pre_colorized = false)
|
||
{
|
||
}
|
||
/**
|
||
* Show items in a \cli\Table.
|
||
*
|
||
* @param array $items
|
||
* @param array $fields
|
||
* @param bool|array $ascii_pre_colorized Optional. A boolean or an array of booleans to pass to `Table::setAsciiPreColorized()` if items in the table are pre-colorized. Default false.
|
||
*/
|
||
private static function show_table($items, $fields, $ascii_pre_colorized = false)
|
||
{
|
||
}
|
||
/**
|
||
* Format an associative array as a table.
|
||
*
|
||
* @param array $fields Fields and values to format
|
||
* @return array
|
||
*/
|
||
private function assoc_array_to_rows($fields)
|
||
{
|
||
}
|
||
/**
|
||
* Transforms objects and arrays to JSON as necessary
|
||
*
|
||
* @param mixed $item
|
||
* @return mixed
|
||
*/
|
||
public function transform_item_values_to_json($item)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Doctrine inflector has static methods for inflecting text.
|
||
*
|
||
* The methods in these classes are from several different sources collected
|
||
* across several different php projects and several different authors. The
|
||
* original author names and emails are not known.
|
||
*
|
||
* Pluralize & Singularize implementation are borrowed from CakePHP with some modifications.
|
||
*
|
||
* @link www.doctrine-project.org
|
||
* @since 1.0
|
||
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||
*/
|
||
class Inflector
|
||
{
|
||
/**
|
||
* Plural inflector rules.
|
||
*
|
||
* @var array
|
||
*/
|
||
private static $plural = ['rules' => ['/(s)tatus$/i' => '\1\2tatuses', '/(quiz)$/i' => '\1zes', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice', '/(matr|vert|ind)(ix|ex)$/i' => '\1ices', '/(x|ch|ss|sh)$/i' => '\1es', '/([^aeiouy]|qu)y$/i' => '\1ies', '/(hive)$/i' => '\1s', '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', '/sis$/i' => 'ses', '/([ti])um$/i' => '\1a', '/(p)erson$/i' => '\1eople', '/(m)an$/i' => '\1en', '/(c)hild$/i' => '\1hildren', '/(f)oot$/i' => '\1eet', '/(buffal|her|potat|tomat|volcan)o$/i' => '\1\2oes', '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i', '/us$/i' => 'uses', '/(alias)$/i' => '\1es', '/(analys|ax|cris|test|thes)is$/i' => '\1es', '/s$/' => 's', '/^$/' => '', '/$/' => 's'], 'uninflected' => ['.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'cookie'], 'irregular' => ['atlas' => 'atlases', 'axe' => 'axes', 'beef' => 'beefs', 'brother' => 'brothers', 'cafe' => 'cafes', 'chateau' => 'chateaux', 'child' => 'children', 'cookie' => 'cookies', 'corpus' => 'corpuses', 'cow' => 'cows', 'criterion' => 'criteria', 'curriculum' => 'curricula', 'demo' => 'demos', 'domino' => 'dominoes', 'echo' => 'echoes', 'foot' => 'feet', 'fungus' => 'fungi', 'ganglion' => 'ganglions', 'genie' => 'genies', 'genus' => 'genera', 'graffito' => 'graffiti', 'hippopotamus' => 'hippopotami', 'hoof' => 'hoofs', 'human' => 'humans', 'iris' => 'irises', 'leaf' => 'leaves', 'loaf' => 'loaves', 'man' => 'men', 'medium' => 'media', 'memorandum' => 'memoranda', 'money' => 'monies', 'mongoose' => 'mongooses', 'motto' => 'mottoes', 'move' => 'moves', 'mythos' => 'mythoi', 'niche' => 'niches', 'nucleus' => 'nuclei', 'numen' => 'numina', 'occiput' => 'occiputs', 'octopus' => 'octopuses', 'opus' => 'opuses', 'ox' => 'oxen', 'penis' => 'penises', 'person' => 'people', 'plateau' => 'plateaux', 'runner-up' => 'runners-up', 'sex' => 'sexes', 'soliloquy' => 'soliloquies', 'son-in-law' => 'sons-in-law', 'syllabus' => 'syllabi', 'testis' => 'testes', 'thief' => 'thieves', 'tooth' => 'teeth', 'tornado' => 'tornadoes', 'trilby' => 'trilbys', 'turf' => 'turfs', 'volcano' => 'volcanoes']];
|
||
/**
|
||
* Singular inflector rules.
|
||
*
|
||
* @var array
|
||
*/
|
||
private static $singular = ['rules' => ['/(s)tatuses$/i' => '\1\2tatus', '/^(.*)(menu)s$/i' => '\1\2', '/(quiz)zes$/i' => '\1', '/(matr)ices$/i' => '\1ix', '/(vert|ind)ices$/i' => '\1ex', '/^(ox)en/i' => '\1', '/(alias)(es)*$/i' => '\1', '/(buffal|her|potat|tomat|volcan)oes$/i' => '\1o', '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us', '/([ftw]ax)es/i' => '\1', '/(analys|ax|cris|test|thes)es$/i' => '\1is', '/(shoe|slave)s$/i' => '\1', '/(o)es$/i' => '\1', '/ouses$/' => 'ouse', '/([^a])uses$/' => '\1us', '/([m|l])ice$/i' => '\1ouse', '/(x|ch|ss|sh)es$/i' => '\1', '/(m)ovies$/i' => '\1\2ovie', '/(s)eries$/i' => '\1\2eries', '/([^aeiouy]|qu)ies$/i' => '\1y', '/([lr])ves$/i' => '\1f', '/(tive)s$/i' => '\1', '/(hive)s$/i' => '\1', '/(drive)s$/i' => '\1', '/([^fo])ves$/i' => '\1fe', '/(^analy)ses$/i' => '\1sis', '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', '/([ti])a$/i' => '\1um', '/(p)eople$/i' => '\1\2erson', '/(m)en$/i' => '\1an', '/(c)hildren$/i' => '\1\2hild', '/(f)eet$/i' => '\1oot', '/(n)ews$/i' => '\1\2ews', '/eaus$/' => 'eau', '/^(.*us)$/' => '\1', '/s$/i' => ''], 'uninflected' => ['.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss'], 'irregular' => ['criteria' => 'criterion', 'curves' => 'curve', 'emphases' => 'emphasis', 'foes' => 'foe', 'hoaxes' => 'hoax', 'media' => 'medium', 'neuroses' => 'neurosis', 'waves' => 'wave', 'oases' => 'oasis']];
|
||
/**
|
||
* Words that should not be inflected.
|
||
*
|
||
* @var array
|
||
*/
|
||
private static $uninflected = ['Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', '.*?media', 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'staff', 'swine', 'testes', 'trousers', 'trout', 'tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest', 'Yengeese'];
|
||
/**
|
||
* Method cache array.
|
||
*
|
||
* @var array
|
||
*/
|
||
private static $cache = [];
|
||
/**
|
||
* The initial state of Inflector so reset() works.
|
||
*
|
||
* @var array
|
||
*/
|
||
private static $initial_state = [];
|
||
/**
|
||
* Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.
|
||
*
|
||
* @param string $word The word to tableize.
|
||
*
|
||
* @return string The tableized word.
|
||
*/
|
||
public static function tableize($word)
|
||
{
|
||
}
|
||
/**
|
||
* Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'.
|
||
*
|
||
* @param string $word The word to classify.
|
||
*
|
||
* @return string The classified word.
|
||
*/
|
||
public static function classify($word)
|
||
{
|
||
}
|
||
/**
|
||
* Camelizes a word. This uses the classify() method and turns the first character to lowercase.
|
||
*
|
||
* @param string $word The word to camelize.
|
||
*
|
||
* @return string The camelized word.
|
||
*/
|
||
public static function camelize($word)
|
||
{
|
||
}
|
||
/**
|
||
* Uppercases words with configurable delimiters between words.
|
||
*
|
||
* Takes a string and capitalizes all of the words, like PHP's built-in
|
||
* ucwords function. This extends that behavior, however, by allowing the
|
||
* word delimiters to be configured, rather than only separating on
|
||
* whitespace.
|
||
*
|
||
* Here is an example:
|
||
* <code>
|
||
* <?php
|
||
* $string = 'top-o-the-morning to all_of_you!';
|
||
* echo \Doctrine\Common\Inflector\Inflector::ucwords($string);
|
||
* // Top-O-The-Morning To All_of_you!
|
||
*
|
||
* echo \Doctrine\Common\Inflector\Inflector::ucwords($string, '-_ ');
|
||
* // Top-O-The-Morning To All_Of_You!
|
||
* ?>
|
||
* </code>
|
||
*
|
||
* @param string $string The string to operate on.
|
||
* @param string $delimiters A list of word separators.
|
||
*
|
||
* @return string The string with all delimiter-separated words capitalized.
|
||
*/
|
||
public static function ucwords($string, $delimiters = " \n\t\r\x00\v-")
|
||
{
|
||
}
|
||
/**
|
||
* Clears Inflectors inflected value caches, and resets the inflection
|
||
* rules to the initial values.
|
||
*
|
||
* @return void
|
||
*/
|
||
public static function reset()
|
||
{
|
||
}
|
||
/**
|
||
* Adds custom inflection $rules, of either 'plural' or 'singular' $type.
|
||
*
|
||
* ### Usage:
|
||
*
|
||
* {{{
|
||
* Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables'));
|
||
* Inflector::rules('plural', array(
|
||
* 'rules' => array('/^(inflect)ors$/i' => '\1ables'),
|
||
* 'uninflected' => array('dontinflectme'),
|
||
* 'irregular' => array('red' => 'redlings')
|
||
* ));
|
||
* }}}
|
||
*
|
||
* @param string $type The type of inflection, either 'plural' or 'singular'
|
||
* @param array $rules An array of rules to be added.
|
||
* @param boolean $reset If true, will unset default inflections for all
|
||
* new rules that are being defined in $rules.
|
||
*
|
||
* @return void
|
||
*/
|
||
public static function rules($type, $rules, $reset = false)
|
||
{
|
||
}
|
||
/**
|
||
* Returns a word in plural form.
|
||
*
|
||
* @param string $word The word in singular form.
|
||
*
|
||
* @return string The word in plural form.
|
||
*/
|
||
public static function pluralize($word)
|
||
{
|
||
}
|
||
/**
|
||
* Returns a word in singular form.
|
||
*
|
||
* @param string $word The word in plural form.
|
||
*
|
||
* @return string The word in singular form.
|
||
*/
|
||
public static function singularize($word)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Iterators {
|
||
/**
|
||
* Allows incrementally reading and parsing lines from a CSV file.
|
||
*/
|
||
class CSV implements \Countable, \Iterator
|
||
{
|
||
const ROW_SIZE = 4096;
|
||
private $filename;
|
||
private $file_pointer;
|
||
private $delimiter;
|
||
private $columns;
|
||
private $current_index;
|
||
private $current_element;
|
||
public function __construct($filename, $delimiter = ',')
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function rewind()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function current()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function key()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function next()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function count()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function valid()
|
||
{
|
||
}
|
||
}
|
||
class Exception extends \RuntimeException
|
||
{
|
||
}
|
||
/**
|
||
* Iterates over results of a query, split into many queries via LIMIT and OFFSET
|
||
*
|
||
* @source https://gist.github.com/4060005
|
||
*/
|
||
class Query implements \Iterator
|
||
{
|
||
private $chunk_size;
|
||
private $query = '';
|
||
private $count_query = '';
|
||
private $global_index = 0;
|
||
private $index_in_results = 0;
|
||
private $results = [];
|
||
private $row_count = 0;
|
||
private $offset = 0;
|
||
private $db = null;
|
||
private $depleted = false;
|
||
/**
|
||
* Creates a new query iterator
|
||
*
|
||
* This will loop over all users, but will retrieve them 100 by 100:
|
||
* <code>
|
||
* foreach( new Iterators\Query( 'SELECT * FROM users', 100 ) as $user ) {
|
||
* tickle( $user );
|
||
* }
|
||
* </code>
|
||
*
|
||
* @param string $query The query as a string. It shouldn't include any LIMIT clauses
|
||
* @param int $chunk_size How many rows to retrieve at once; default value is 500 (optional)
|
||
*/
|
||
public function __construct($query, $chunk_size = 500)
|
||
{
|
||
}
|
||
/**
|
||
* Reduces the offset when the query row count shrinks
|
||
*
|
||
* In cases where the iterated rows are being updated such that they will no
|
||
* longer be returned by the original query, the offset must be reduced to
|
||
* iterate over all remaining rows.
|
||
*/
|
||
private function adjust_offset_for_shrinking_result_set()
|
||
{
|
||
}
|
||
private function load_items_from_db()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function current()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function key()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function next()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function rewind()
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function valid()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* @source https://gist.github.com/4060005
|
||
*/
|
||
class Table extends \WP_CLI\Iterators\Query
|
||
{
|
||
/**
|
||
* Creates an iterator over a database table.
|
||
*
|
||
* <code>
|
||
* foreach( new Iterators\Table( array( 'table' => $wpdb->posts, 'fields' => array( 'ID', 'post_content' ) ) ) as $post ) {
|
||
* count_words_for( $post->ID, $post->post_content );
|
||
* }
|
||
* </code>
|
||
*
|
||
* <code>
|
||
* foreach( new Iterators\Table( array( 'table' => $wpdb->posts, 'where' => 'ID = 8 OR post_status = "publish"' ) ) as $post ) {
|
||
* …
|
||
* }
|
||
* </code>
|
||
*
|
||
* <code>
|
||
* foreach( new PostIterator( array( 'table' => $wpdb->posts, 'where' => array( 'post_status' => 'publish', 'post_date_gmt BETWEEN x AND y' ) ) ) as $post ) {
|
||
* …
|
||
* }
|
||
* </code>
|
||
*
|
||
* @param array $args Supported arguments:
|
||
* table – the name of the database table
|
||
* fields – an array of columns to get from the table, '*' is a valid value and the default
|
||
* where – conditions for filtering rows. Supports two formats:
|
||
* = string – this will be the where clause
|
||
* = array – each element is treated as a condition if it's positional, or as column => value if
|
||
* it's a key/value pair. In the latter case the value is automatically quoted and escaped
|
||
* append - add arbitrary extra SQL
|
||
*/
|
||
public function __construct($args = [])
|
||
{
|
||
}
|
||
private static function build_fields($fields)
|
||
{
|
||
}
|
||
private static function build_where_conditions($where)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Applies one or more callbacks to an item before returning it.
|
||
*/
|
||
class Transform extends \IteratorIterator
|
||
{
|
||
private $transformers = [];
|
||
public function add_transform($fn)
|
||
{
|
||
}
|
||
#[\ReturnTypeWillChange]
|
||
public function current()
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Loggers {
|
||
/**
|
||
* Base logger class
|
||
*/
|
||
abstract class Base
|
||
{
|
||
protected $in_color = false;
|
||
abstract public function info($message);
|
||
abstract public function success($message);
|
||
abstract public function warning($message);
|
||
/**
|
||
* Retrieve the runner instance from the base CLI object. This facilitates
|
||
* unit testing, where the WP_CLI instance isn't available
|
||
*
|
||
* @return Runner Instance of the runner class
|
||
*/
|
||
protected function get_runner()
|
||
{
|
||
}
|
||
/**
|
||
* Write a message to STDERR, prefixed with "Debug: ".
|
||
*
|
||
* @param string $message Message to write.
|
||
* @param string|bool $group Organize debug message to a specific group.
|
||
* Use `false` for no group.
|
||
*/
|
||
public function debug($message, $group = false)
|
||
{
|
||
}
|
||
/**
|
||
* Write a string to a resource.
|
||
*
|
||
* @param resource $handle Commonly STDOUT or STDERR.
|
||
* @param string $str Message to write.
|
||
*/
|
||
protected function write($handle, $str)
|
||
{
|
||
}
|
||
/**
|
||
* Output one line of message to a resource.
|
||
*
|
||
* @param string $message Message to write.
|
||
* @param string $label Prefix message with a label.
|
||
* @param string $color Colorize label with a given color.
|
||
* @param resource $handle Resource to write to. Defaults to STDOUT.
|
||
*/
|
||
protected function _line($message, $label, $color, $handle = STDOUT)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Default logger for success, warning, error, and standard messages.
|
||
*/
|
||
class Regular extends \WP_CLI\Loggers\Base
|
||
{
|
||
/**
|
||
* @param bool $in_color Whether or not to Colorize strings.
|
||
*/
|
||
public function __construct($in_color)
|
||
{
|
||
}
|
||
/**
|
||
* Write an informational message to STDOUT.
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function info($message)
|
||
{
|
||
}
|
||
/**
|
||
* Write a success message, prefixed with "Success: ".
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function success($message)
|
||
{
|
||
}
|
||
/**
|
||
* Write a warning message to STDERR, prefixed with "Warning: ".
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function warning($message)
|
||
{
|
||
}
|
||
/**
|
||
* Write an message to STDERR, prefixed with "Error: ".
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function error($message)
|
||
{
|
||
}
|
||
/**
|
||
* Similar to error( $message ), but outputs $message in a red box.
|
||
*
|
||
* @param array $message_lines Message to write.
|
||
*/
|
||
public function error_multi_line($message_lines)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Execution logger captures all STDOUT and STDERR writes
|
||
*/
|
||
class Execution extends \WP_CLI\Loggers\Regular
|
||
{
|
||
/**
|
||
* Captured writes to STDOUT.
|
||
*/
|
||
public $stdout = '';
|
||
/**
|
||
* Captured writes to STDERR.
|
||
*/
|
||
public $stderr = '';
|
||
/**
|
||
* @param bool $in_color Whether or not to Colorize strings.
|
||
*/
|
||
public function __construct($in_color = false)
|
||
{
|
||
}
|
||
/**
|
||
* Similar to error( $message ), but outputs $message in a red box.
|
||
*
|
||
* @param array $message_lines Message to write.
|
||
*/
|
||
public function error_multi_line($message_lines)
|
||
{
|
||
}
|
||
/**
|
||
* Write a string to a resource.
|
||
*
|
||
* @param resource $handle Commonly STDOUT or STDERR.
|
||
* @param string $str Message to write.
|
||
*/
|
||
protected function write($handle, $str)
|
||
{
|
||
}
|
||
/**
|
||
* Starts output buffering, using a callback to capture output from `echo`, `print`, `printf` (which write to the output buffer 'php://output' rather than STDOUT).
|
||
*/
|
||
public function ob_start()
|
||
{
|
||
}
|
||
/**
|
||
* Callback for `ob_start()`.
|
||
*
|
||
* @param string $str String to write.
|
||
* @return string Returns zero-length string so nothing gets written to the output buffer.
|
||
*/
|
||
public function ob_start_callback($str)
|
||
{
|
||
}
|
||
/**
|
||
* To match `ob_start() above. Does an `ob_end_flush()`.
|
||
*/
|
||
public function ob_end()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Quiet logger only logs errors.
|
||
*/
|
||
class Quiet extends \WP_CLI\Loggers\Base
|
||
{
|
||
/**
|
||
* @param bool $in_color Whether or not to Colorize strings.
|
||
*/
|
||
public function __construct($in_color = false)
|
||
{
|
||
}
|
||
/**
|
||
* Informational messages aren't logged.
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function info($message)
|
||
{
|
||
}
|
||
/**
|
||
* Success messages aren't logged.
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function success($message)
|
||
{
|
||
}
|
||
/**
|
||
* Warning messages aren't logged.
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function warning($message)
|
||
{
|
||
}
|
||
/**
|
||
* Write an error message to STDERR, prefixed with "Error: ".
|
||
*
|
||
* @param string $message Message to write.
|
||
*/
|
||
public function error($message)
|
||
{
|
||
}
|
||
/**
|
||
* Similar to error( $message ), but outputs $message in a red box.
|
||
*
|
||
* @param array $message_lines Message to write.
|
||
*/
|
||
public function error_multi_line($message_lines)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
/**
|
||
* Escape route for not doing anything.
|
||
*/
|
||
final class NoOp
|
||
{
|
||
public function __set($key, $value)
|
||
{
|
||
}
|
||
public function __call($method, $args)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Run a system process, and learn what happened.
|
||
*/
|
||
class Process
|
||
{
|
||
/**
|
||
* @var string The full command to execute by the system.
|
||
*/
|
||
private $command;
|
||
/**
|
||
* @var string|null The path of the working directory for the process or NULL if not specified (defaults to current working directory).
|
||
*/
|
||
private $cwd;
|
||
/**
|
||
* @var array Environment variables to set when running the command.
|
||
*/
|
||
private $env;
|
||
/**
|
||
* @var array Descriptor spec for `proc_open()`.
|
||
*/
|
||
private static $descriptors = [0 => STDIN, 1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
|
||
/**
|
||
* @var bool Whether to log run time info or not.
|
||
*/
|
||
public static $log_run_times = false;
|
||
/**
|
||
* @var array Array of process run time info, keyed by process command, each a 2-element array containing run time and run count.
|
||
*/
|
||
public static $run_times = [];
|
||
/**
|
||
* @param string $command Command to execute.
|
||
* @param string|null $cwd Directory to execute the command in.
|
||
* @param array|null $env Environment variables to set when running the command.
|
||
*
|
||
* @return Process
|
||
*/
|
||
public static function create($command, $cwd = null, $env = [])
|
||
{
|
||
}
|
||
private function __construct()
|
||
{
|
||
}
|
||
/**
|
||
* Run the command.
|
||
*
|
||
* @return ProcessRun
|
||
*/
|
||
public function run()
|
||
{
|
||
}
|
||
/**
|
||
* Run the command, but throw an Exception on error.
|
||
*
|
||
* @return ProcessRun
|
||
*/
|
||
public function run_check()
|
||
{
|
||
}
|
||
/**
|
||
* Run the command, but throw an Exception on error.
|
||
* Same as `run_check()` above, but checks the correct stderr.
|
||
*
|
||
* @return ProcessRun
|
||
*/
|
||
public function run_check_stderr()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Results of an executed command.
|
||
*/
|
||
class ProcessRun
|
||
{
|
||
/**
|
||
* The full command executed by the system.
|
||
*
|
||
* @var string
|
||
*/
|
||
public $command;
|
||
/**
|
||
* Captured output from the process' STDOUT.
|
||
*
|
||
* @var string
|
||
*/
|
||
public $stdout;
|
||
/**
|
||
* Captured output from the process' STDERR.
|
||
*
|
||
* @var string
|
||
*/
|
||
public $stderr;
|
||
/**
|
||
* The path of the working directory for the process or NULL if not specified.
|
||
*
|
||
* This defaults to current working directory.
|
||
*
|
||
* @var string|null
|
||
*/
|
||
public $cwd;
|
||
/**
|
||
* Environment variables set for this process.
|
||
*
|
||
* @var array
|
||
*/
|
||
public $env;
|
||
/**
|
||
* Exit code of the process.
|
||
*
|
||
* @var int
|
||
*/
|
||
public $return_code;
|
||
/**
|
||
* The run time of the process.
|
||
*
|
||
* @var float
|
||
*/
|
||
public $run_time;
|
||
/**
|
||
* @param array $props Properties of executed command.
|
||
*/
|
||
public function __construct($props)
|
||
{
|
||
}
|
||
/**
|
||
* Return properties of executed command as a string.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function __toString()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class RequestsLibrary.
|
||
*
|
||
* A class to manage the version and source of the Requests library used by WP-CLI.
|
||
*/
|
||
final class RequestsLibrary
|
||
{
|
||
/**
|
||
* Version 1 of the Requests library.
|
||
*
|
||
* @var string
|
||
*/
|
||
const VERSION_V1 = 'v1';
|
||
/**
|
||
* Version 2 of the Requests library.
|
||
*
|
||
* @var string
|
||
*/
|
||
const VERSION_V2 = 'v2';
|
||
/**
|
||
* Array of valid versions for the Requests library.
|
||
*
|
||
* @var array<string>
|
||
*/
|
||
const VALID_VERSIONS = [self::VERSION_V1, self::VERSION_V2];
|
||
/**
|
||
* Requests library bundled with WordPress Core being used.
|
||
*
|
||
* @var string
|
||
*/
|
||
const SOURCE_WP_CORE = 'wp-core';
|
||
/**
|
||
* Requests library bundled with WP-CLI being used.
|
||
*
|
||
* @var string
|
||
*/
|
||
const SOURCE_WP_CLI = 'wp-cli';
|
||
/**
|
||
* Array of valid source for the Requests library.
|
||
*
|
||
* @var array<string>
|
||
*/
|
||
const VALID_SOURCES = [self::SOURCE_WP_CORE, self::SOURCE_WP_CLI];
|
||
/**
|
||
* Class name of the Requests main class for v1.
|
||
*
|
||
* @var string
|
||
*/
|
||
const CLASS_NAME_V1 = '\Requests';
|
||
/**
|
||
* Class name of the Requests main class for v2.
|
||
*
|
||
* @var string
|
||
*/
|
||
const CLASS_NAME_V2 = '\WpOrg\Requests\Requests';
|
||
/**
|
||
* Version of the Requests library being used.
|
||
*
|
||
* @var string
|
||
*/
|
||
private static $version = self::VERSION_V2;
|
||
/**
|
||
* Source of the Requests library being used.
|
||
*
|
||
* @var string
|
||
*/
|
||
private static $source = self::SOURCE_WP_CLI;
|
||
/**
|
||
* Class name of the Requests library being used.
|
||
*
|
||
* @var string
|
||
*/
|
||
private static $class_name = self::CLASS_NAME_V2;
|
||
/**
|
||
* Check if the current version is v1.
|
||
*
|
||
* @return bool Whether the current version is v1.
|
||
*/
|
||
public static function is_v1()
|
||
{
|
||
}
|
||
/**
|
||
* Check if the current version is v2.
|
||
*
|
||
* @return bool Whether the current version is v2.
|
||
*/
|
||
public static function is_v2()
|
||
{
|
||
}
|
||
/**
|
||
* Check if the current source for the Requests library is WordPress Core.
|
||
*
|
||
* @return bool Whether the current source is WordPress Core.
|
||
*/
|
||
public static function is_core()
|
||
{
|
||
}
|
||
/**
|
||
* Check if the current source for the Requests library is WP-CLI.
|
||
*
|
||
* @return bool Whether the current source is WP-CLI.
|
||
*/
|
||
public static function is_cli()
|
||
{
|
||
}
|
||
/**
|
||
* Get the current version.
|
||
*
|
||
* @return string The current version.
|
||
*/
|
||
public static function get_version()
|
||
{
|
||
}
|
||
/**
|
||
* Set the version of the library.
|
||
*
|
||
* @param string $version The version to set.
|
||
* @throws RuntimeException if the version is invalid.
|
||
*/
|
||
public static function set_version($version)
|
||
{
|
||
}
|
||
/**
|
||
* Get the current class name.
|
||
*
|
||
* @return string The current class name.
|
||
*/
|
||
public static function get_class_name()
|
||
{
|
||
}
|
||
/**
|
||
* Set the class name for the library.
|
||
*
|
||
* @param string $class_name The class name to set.
|
||
*/
|
||
public static function set_class_name($class_name)
|
||
{
|
||
}
|
||
/**
|
||
* Get the current source.
|
||
*
|
||
* @return string The current source.
|
||
*/
|
||
public static function get_source()
|
||
{
|
||
}
|
||
/**
|
||
* Set the source of the library.
|
||
*
|
||
* @param string $source The source to set.
|
||
* @throws RuntimeException if the source is invalid.
|
||
*/
|
||
public static function set_source($source)
|
||
{
|
||
}
|
||
/**
|
||
* Check if a given exception was issued by the Requests library.
|
||
*
|
||
* This is used because we cannot easily catch multiple different exception
|
||
* classes with PHP 5.6. Because of that, we catch generic exceptions, check if
|
||
* they match the Requests library, and re-throw them if they do not.
|
||
*
|
||
* @param Exception $exception Exception to check.
|
||
* @return bool Whether the provided exception was issued by the Requests library.
|
||
*/
|
||
public static function is_requests_exception(\Exception $exception)
|
||
{
|
||
}
|
||
/**
|
||
* Register the autoloader for the Requests library.
|
||
*
|
||
* This checks for the detected setup and register the corresponding
|
||
* autoloader if it is still needed.
|
||
*/
|
||
public static function register_autoloader()
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the bundled certificate.
|
||
*
|
||
* @return string The path to the bundled certificate.
|
||
*/
|
||
public static function get_bundled_certificate_path()
|
||
{
|
||
}
|
||
/**
|
||
* Define WP_CLI_ROOT if it is not already defined.
|
||
*/
|
||
private static function maybe_define_wp_cli_root()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Performs the execution of a command.
|
||
*
|
||
* @property-read string $global_config_path
|
||
* @property-read string $project_config_path
|
||
* @property-read array $config
|
||
* @property-read array $extra_config
|
||
* @property-read ContextManager $context_manager
|
||
* @property-read string $alias
|
||
* @property-read array $aliases
|
||
* @property-read array $arguments
|
||
* @property-read array $assoc_args
|
||
* @property-read array $runtime_config
|
||
* @property-read bool $colorize
|
||
* @property-read array $early_invoke
|
||
* @property-read string $global_config_path_debug
|
||
* @property-read string $project_config_path_debug
|
||
* @property-read array $required_files
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class Runner
|
||
{
|
||
/**
|
||
* List of byte-order marks (BOMs) to detect.
|
||
*
|
||
* @var array<string, string>
|
||
*/
|
||
const BYTE_ORDER_MARKS = ['UTF-8' => "", 'UTF-16 (BE)' => "\xfe\xff", 'UTF-16 (LE)' => "\xff\xfe"];
|
||
private $global_config_path;
|
||
private $project_config_path;
|
||
private $config;
|
||
private $extra_config;
|
||
private $context_manager;
|
||
private $alias;
|
||
private $aliases;
|
||
private $arguments;
|
||
private $assoc_args;
|
||
private $runtime_config;
|
||
private $colorize = false;
|
||
private $early_invoke = [];
|
||
private $global_config_path_debug;
|
||
private $project_config_path_debug;
|
||
private $required_files;
|
||
public function __get($key)
|
||
{
|
||
}
|
||
public function register_context_manager(\WP_CLI\ContextManager $context_manager)
|
||
{
|
||
}
|
||
/**
|
||
* Register a command for early invocation, generally before WordPress loads.
|
||
*
|
||
* @param string $when Named execution hook
|
||
* @param Subcommand $command
|
||
*/
|
||
public function register_early_invoke($when, $command)
|
||
{
|
||
}
|
||
/**
|
||
* Perform the early invocation of a command.
|
||
*
|
||
* @param string $when Named execution hook
|
||
*/
|
||
private function do_early_invoke($when)
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the global configuration YAML file.
|
||
*
|
||
* @param bool $create_config_file Optional. If a config file doesn't exist,
|
||
* should it be created? Defaults to false.
|
||
*
|
||
* @return string|false
|
||
*/
|
||
public function get_global_config_path($create_config_file = false)
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the project-specific configuration
|
||
* YAML file.
|
||
* wp-cli.local.yml takes priority over wp-cli.yml.
|
||
*
|
||
* @return string|false
|
||
*/
|
||
public function get_project_config_path()
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the packages directory
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_packages_dir_path()
|
||
{
|
||
}
|
||
/**
|
||
* Attempts to find the path to the WP installation inside index.php
|
||
*
|
||
* @param string $index_path
|
||
* @return string|false
|
||
*/
|
||
private static function extract_subdir_path($index_path)
|
||
{
|
||
}
|
||
/**
|
||
* Find the directory that contains the WordPress files.
|
||
* Defaults to the current working dir.
|
||
*
|
||
* @return string An absolute path.
|
||
*/
|
||
public function find_wp_root()
|
||
{
|
||
}
|
||
/**
|
||
* Set WordPress root as a given path.
|
||
*
|
||
* @param string $path
|
||
*/
|
||
private static function set_wp_root($path)
|
||
{
|
||
}
|
||
/**
|
||
* Guess which URL context WP-CLI has been invoked under.
|
||
*
|
||
* @param array $assoc_args
|
||
* @return string|false
|
||
*/
|
||
private static function guess_url($assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Checks if the arguments passed to the WP-CLI binary start with the specified prefix.
|
||
*
|
||
* @param array $prefix An array of strings specifying the expected start of the arguments passed to the WP-CLI binary.
|
||
* For example, `['user', 'list']` checks if the arguments passed to the WP-CLI binary start with `user list`.
|
||
*
|
||
* @return bool `true` if the arguments passed to the WP-CLI binary start with the specified prefix, `false` otherwise.
|
||
*/
|
||
private function cmd_starts_with($prefix)
|
||
{
|
||
}
|
||
/**
|
||
* Given positional arguments, find the command to execute.
|
||
*
|
||
* @param array $args
|
||
* @return array|string Command, args, and path on success; error message on failure
|
||
*/
|
||
public function find_command_to_run($args)
|
||
{
|
||
}
|
||
/**
|
||
* Find the WP-CLI command to run given arguments, and invoke it.
|
||
*
|
||
* @param array $args Positional arguments including command name
|
||
* @param array $assoc_args Associative arguments for the command.
|
||
* @param array $options Configuration options for the function.
|
||
*/
|
||
public function run_command($args, $assoc_args = [], $options = [])
|
||
{
|
||
}
|
||
/**
|
||
* Show synopsis if the called command is a composite command
|
||
*/
|
||
public function show_synopsis_if_composite_command()
|
||
{
|
||
}
|
||
private function run_command_and_exit($help_exit_warning = '')
|
||
{
|
||
}
|
||
/**
|
||
* Perform a command against a remote server over SSH (or a container using
|
||
* scheme of "docker", "docker-compose", or "docker-compose-run").
|
||
*
|
||
* @param string $connection_string Passed connection string.
|
||
* @return void
|
||
*/
|
||
private function run_ssh_command($connection_string)
|
||
{
|
||
}
|
||
/**
|
||
* Generate a shell command from the parsed connection string.
|
||
*
|
||
* @param array $bits Parsed connection string.
|
||
* @param string $wp_command WP-CLI command to run.
|
||
* @return string
|
||
*/
|
||
private function generate_ssh_command($bits, $wp_command)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether a given command is disabled by the config.
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function is_command_disabled($command)
|
||
{
|
||
}
|
||
/**
|
||
* Returns wp-config.php code, skipping the loading of wp-settings.php.
|
||
*
|
||
* @param string $wp_config_path Optional. Config file path. If left empty, it tries to
|
||
* locate the wp-config.php file automatically.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function get_wp_config_code($wp_config_path = '')
|
||
{
|
||
}
|
||
/**
|
||
* Transparently convert deprecated syntaxes
|
||
*
|
||
* @param array $args
|
||
* @param array $assoc_args
|
||
* @return array
|
||
*/
|
||
private static function back_compat_conversions($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Whether or not the output should be rendered in color
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function in_color()
|
||
{
|
||
}
|
||
public function init_colorization()
|
||
{
|
||
}
|
||
public function init_logger()
|
||
{
|
||
}
|
||
public function get_required_files()
|
||
{
|
||
}
|
||
/**
|
||
* Do WordPress core files exist?
|
||
*
|
||
* @return bool
|
||
*/
|
||
private function wp_exists()
|
||
{
|
||
}
|
||
/**
|
||
* Are WordPress core files readable?
|
||
*
|
||
* @return bool
|
||
*/
|
||
private function wp_is_readable()
|
||
{
|
||
}
|
||
private function check_wp_version()
|
||
{
|
||
}
|
||
public function init_config()
|
||
{
|
||
}
|
||
private function run_alias_group($aliases)
|
||
{
|
||
}
|
||
private function set_alias($alias)
|
||
{
|
||
}
|
||
public function start()
|
||
{
|
||
}
|
||
/**
|
||
* Load WordPress, if it hasn't already been loaded
|
||
*/
|
||
public function load_wordpress()
|
||
{
|
||
}
|
||
private static function fake_current_site_blog($url_parts)
|
||
{
|
||
}
|
||
/**
|
||
* Called after wp-config.php is eval'd, to potentially reset `--url`
|
||
*/
|
||
private function maybe_update_url_from_domain_constant()
|
||
{
|
||
}
|
||
/**
|
||
* Set up hooks meant to run during the WordPress bootstrap process
|
||
*/
|
||
private function setup_bootstrap_hooks()
|
||
{
|
||
}
|
||
/**
|
||
* Set up the filters to skip the loaded plugins
|
||
*/
|
||
private function setup_skip_plugins_filters()
|
||
{
|
||
}
|
||
/**
|
||
* Set up the filters to skip the loaded theme
|
||
*/
|
||
public function action_setup_theme_wp_cli_skip_themes()
|
||
{
|
||
}
|
||
/**
|
||
* Whether or not this WordPress installation is multisite.
|
||
*
|
||
* For use after wp-config.php has loaded, but before the rest of WordPress
|
||
* is loaded.
|
||
*/
|
||
private function is_multisite()
|
||
{
|
||
}
|
||
/**
|
||
* Error handler for `wp_die()` when the command is help to try to trap errors (db connection failure in particular) during WordPress load.
|
||
*/
|
||
public function help_wp_die_handler($message)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether there's a WP-CLI update available, and suggest update if so.
|
||
*/
|
||
private function auto_check_update()
|
||
{
|
||
}
|
||
/**
|
||
* Get a suggestion on similar (sub)commands when the user entered an
|
||
* unknown (sub)command.
|
||
*
|
||
* @param string $entry User entry that didn't match an
|
||
* existing command.
|
||
* @param CompositeCommand|null $root_command Root command to start search for
|
||
* suggestions at.
|
||
*
|
||
* @return string Suggestion that fits the user entry, or an empty string.
|
||
*/
|
||
private function get_subcommand_suggestion($entry, $root_command = null)
|
||
{
|
||
}
|
||
/**
|
||
* Recursive method to enumerate all known commands.
|
||
*
|
||
* @param CompositeCommand $command Composite command to recurse over.
|
||
* @param array $list Reference to list accumulating results.
|
||
* @param string $parent Parent command to use as prefix.
|
||
*/
|
||
private function enumerate_commands(\WP_CLI\Dispatcher\CompositeCommand $command, array &$list, $parent = '')
|
||
{
|
||
}
|
||
/**
|
||
* Enables (almost) full PHP error reporting to stderr.
|
||
*/
|
||
private function enable_error_reporting()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Generate a synopsis from a command's PHPdoc arguments.
|
||
* Turns something like "<object-id>..."
|
||
* into [ optional=>false, type=>positional, repeating=>true, name=>object-id ]
|
||
*/
|
||
class SynopsisParser
|
||
{
|
||
/**
|
||
* @param string $synopsis A synopsis
|
||
* @return array List of parameters
|
||
*/
|
||
public static function parse($synopsis)
|
||
{
|
||
}
|
||
/**
|
||
* Render the Synopsis into a format string.
|
||
*
|
||
* @param array $synopsis A structured synopsis. This might get reordered
|
||
* to match the parsed output.
|
||
* @return string Rendered synopsis.
|
||
*/
|
||
public static function render(&$synopsis)
|
||
{
|
||
}
|
||
/**
|
||
* Classify argument attributes based on its syntax.
|
||
*
|
||
* @param string $token
|
||
* @return array
|
||
*/
|
||
private static function classify_token($token)
|
||
{
|
||
}
|
||
/**
|
||
* An optional parameter is surrounded by square brackets.
|
||
*
|
||
* @param string $token
|
||
* @return array
|
||
*/
|
||
private static function is_optional($token)
|
||
{
|
||
}
|
||
/**
|
||
* A repeating parameter is followed by an ellipsis.
|
||
*
|
||
* @param string $token
|
||
* @return array
|
||
*/
|
||
private static function is_repeating($token)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Checks if the list of parameters matches the specification defined in the synopsis.
|
||
*/
|
||
class SynopsisValidator
|
||
{
|
||
/**
|
||
* Structured representation of command synopsis.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $spec;
|
||
/**
|
||
* @param string $synopsis Command's synopsis.
|
||
*/
|
||
public function __construct($synopsis)
|
||
{
|
||
}
|
||
/**
|
||
* Get any unknown arguments.
|
||
*
|
||
* @return array
|
||
*/
|
||
public function get_unknown()
|
||
{
|
||
}
|
||
/**
|
||
* Check whether there are enough positional arguments.
|
||
*
|
||
* @param array $args Positional arguments.
|
||
* @return bool
|
||
*/
|
||
public function enough_positionals($args)
|
||
{
|
||
}
|
||
/**
|
||
* Check for any unknown positionals.
|
||
*
|
||
* @param array $args Positional arguments.
|
||
* @return array
|
||
*/
|
||
public function unknown_positionals($args)
|
||
{
|
||
}
|
||
/**
|
||
* Check that all required keys are present and that they have values.
|
||
*
|
||
* @param array $assoc_args Parameters passed to command.
|
||
* @return array
|
||
*/
|
||
public function validate_assoc($assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether there are unknown parameters supplied.
|
||
*
|
||
* @param array $assoc_args Parameters passed to command.
|
||
* @return array|false
|
||
*/
|
||
public function unknown_assoc($assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Filters a list of associative arrays, based on a set of key => value arguments.
|
||
*
|
||
* @param array $args An array of key => value arguments to match against
|
||
* @param string $operator
|
||
* @return array
|
||
*/
|
||
private function query_spec($args, $operator = 'AND')
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI\Traverser {
|
||
class RecursiveDataStructureTraverser
|
||
{
|
||
/**
|
||
* @var mixed The data to traverse set by reference.
|
||
*/
|
||
protected $data;
|
||
/**
|
||
* @var null|string The key the data belongs to in the parent's data.
|
||
*/
|
||
protected $key;
|
||
/**
|
||
* @var null|static The parent instance of the traverser.
|
||
*/
|
||
protected $parent;
|
||
/**
|
||
* RecursiveDataStructureTraverser constructor.
|
||
*
|
||
* @param mixed $data The data to read/manipulate by reference.
|
||
* @param string|int $key The key/property the data belongs to.
|
||
* @param static|null $parent_instance The parent instance of the traverser.
|
||
*/
|
||
public function __construct(&$data, $key = null, $parent_instance = null)
|
||
{
|
||
}
|
||
/**
|
||
* Get the nested value at the given key path.
|
||
*
|
||
* @param string|int|array $key_path
|
||
*
|
||
* @return static
|
||
*/
|
||
public function get($key_path)
|
||
{
|
||
}
|
||
/**
|
||
* Get the current data.
|
||
*
|
||
* @return mixed
|
||
*/
|
||
public function value()
|
||
{
|
||
}
|
||
/**
|
||
* Update a nested value at the given key path.
|
||
*
|
||
* @param string|int|array $key_path
|
||
* @param mixed $value
|
||
*/
|
||
public function update($key_path, $value)
|
||
{
|
||
}
|
||
/**
|
||
* Update the current data with the given value.
|
||
*
|
||
* This will mutate the variable which was passed into the constructor
|
||
* as the data is set and traversed by reference.
|
||
*
|
||
* @param mixed $value
|
||
*/
|
||
public function set_value($value)
|
||
{
|
||
}
|
||
/**
|
||
* Unset the value at the given key path.
|
||
*
|
||
* @param $key_path
|
||
*/
|
||
public function delete($key_path)
|
||
{
|
||
}
|
||
/**
|
||
* Define a nested value while creating keys if they do not exist.
|
||
*
|
||
* @param array $key_path
|
||
* @param mixed $value
|
||
*/
|
||
public function insert($key_path, $value)
|
||
{
|
||
}
|
||
/**
|
||
* Delete the key on the parent's data that references this data.
|
||
*/
|
||
public function unset_on_parent()
|
||
{
|
||
}
|
||
/**
|
||
* Delete the given key from the data.
|
||
*
|
||
* @param $key
|
||
*/
|
||
public function delete_by_key($key)
|
||
{
|
||
}
|
||
/**
|
||
* Get an instance of the traverser for the given hierarchical key.
|
||
*
|
||
* @param array $key_path Hierarchical key path within the current data to traverse to.
|
||
*
|
||
* @throws NonExistentKeyException
|
||
*
|
||
* @return self
|
||
*/
|
||
public function traverse_to(array $key_path)
|
||
{
|
||
}
|
||
/**
|
||
* Create the key on the current data.
|
||
*
|
||
* @throws UnexpectedValueException
|
||
*/
|
||
protected function create_key()
|
||
{
|
||
}
|
||
/**
|
||
* Check if the given key exists on the current data.
|
||
*
|
||
* @param string $key
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function exists($key)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
/**
|
||
* A Upgrader Skin for WordPress that only generates plain-text
|
||
*
|
||
* @package wp-cli
|
||
*/
|
||
class UpgraderSkin extends \WP_Upgrader_Skin
|
||
{
|
||
public $api;
|
||
public function header()
|
||
{
|
||
}
|
||
public function footer()
|
||
{
|
||
}
|
||
public function bulk_header()
|
||
{
|
||
}
|
||
public function bulk_footer()
|
||
{
|
||
}
|
||
/**
|
||
* Show error message.
|
||
*
|
||
* @param string $error Error message.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function error($error)
|
||
{
|
||
}
|
||
/**
|
||
* @param string $string
|
||
* @param mixed ...$args Optional text replacements.
|
||
*/
|
||
public function feedback($string, ...$args)
|
||
{
|
||
}
|
||
/**
|
||
* Process the feedback collected through the compat indirection.
|
||
*
|
||
* @param string $string String to use as feedback message.
|
||
* @param array $args Array of additional arguments to process.
|
||
*/
|
||
public function process_feedback($string, $args)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Manage caching with whitelisting
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
class WpHttpCacheManager
|
||
{
|
||
/**
|
||
* @var array<string, array{key:string, ttl:int}> map whitelisted urls to keys and ttls
|
||
*/
|
||
protected $whitelist = [];
|
||
/**
|
||
* @var FileCache
|
||
*/
|
||
protected $cache;
|
||
/**
|
||
* @param FileCache $cache
|
||
*/
|
||
public function __construct(\WP_CLI\FileCache $cache)
|
||
{
|
||
}
|
||
/**
|
||
* short circuit wp http api with cached file
|
||
*/
|
||
public function filter_pre_http_request($response, $args, $url)
|
||
{
|
||
}
|
||
/**
|
||
* cache wp http api downloads
|
||
*
|
||
* @param array $response
|
||
* @param array $args
|
||
* @param string $url
|
||
* @return array
|
||
*/
|
||
public function filter_http_response($response, $args, $url)
|
||
{
|
||
}
|
||
/**
|
||
* whitelist a package url
|
||
*
|
||
* @param string $url
|
||
* @param string $group package group (themes, plugins, ...)
|
||
* @param string $slug package slug
|
||
* @param string $version package version
|
||
* @param int $ttl
|
||
*/
|
||
public function whitelist_package($url, $group, $slug, $version, $ttl = null)
|
||
{
|
||
}
|
||
/**
|
||
* whitelist a url
|
||
*
|
||
* @param string $url
|
||
* @param string $key
|
||
* @param int $ttl
|
||
*/
|
||
public function whitelist_url($url, $key = null, $ttl = null)
|
||
{
|
||
}
|
||
/**
|
||
* check if url is whitelisted
|
||
*
|
||
* @param string $url
|
||
* @return bool
|
||
*/
|
||
public function is_whitelisted($url)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Class WpOrgApi.
|
||
*
|
||
* This is an abstraction of the WordPress.org API.
|
||
*
|
||
* @see https://codex.wordpress.org/WordPress.org_API
|
||
*
|
||
* @package WP_CLI
|
||
*/
|
||
final class WpOrgApi
|
||
{
|
||
/**
|
||
* WordPress.org API root URL.
|
||
*
|
||
* @var string
|
||
*/
|
||
const API_ROOT = 'https://api.wordpress.org';
|
||
/**
|
||
* WordPress.org API root URL.
|
||
*
|
||
* @var string
|
||
*/
|
||
const DOWNLOADS_ROOT = 'https://downloads.wordpress.org';
|
||
/**
|
||
* Core checksums endpoint.
|
||
*
|
||
* @see https://codex.wordpress.org/WordPress.org_API#Checksum
|
||
*
|
||
* @var string
|
||
*/
|
||
const CORE_CHECKSUMS_ENDPOINT = self::API_ROOT . '/core/checksums/1.0/';
|
||
/**
|
||
* Plugin checksums endpoint.
|
||
*
|
||
* @var string
|
||
*/
|
||
const PLUGIN_CHECKSUMS_ENDPOINT = self::DOWNLOADS_ROOT . '/plugin-checksums/';
|
||
/**
|
||
* Plugin info endpoint.
|
||
*
|
||
* @var string
|
||
*/
|
||
const PLUGIN_INFO_ENDPOINT = self::API_ROOT . '/plugins/info/1.2/';
|
||
/**
|
||
* Theme info endpoint.
|
||
*
|
||
* @var string
|
||
*/
|
||
const THEME_INFO_ENDPOINT = self::API_ROOT . '/themes/info/1.2/';
|
||
/**
|
||
* Salt endpoint.
|
||
*
|
||
* @see https://codex.wordpress.org/WordPress.org_API#Secret_Key
|
||
*
|
||
* @var string
|
||
*/
|
||
const SALT_ENDPOINT = self::API_ROOT . '/secret-key/1.1/salt/';
|
||
/**
|
||
* Version check endpoint.
|
||
*
|
||
* @see https://codex.wordpress.org/WordPress.org_API#Version_Check
|
||
*
|
||
* @var string
|
||
*/
|
||
const VERSION_CHECK_ENDPOINT = self::API_ROOT . '/core/version-check/1.7/';
|
||
/**
|
||
* Options to pass onto the Requests library for executing the remote calls.
|
||
*
|
||
* @var array
|
||
*/
|
||
private $options;
|
||
/**
|
||
* WpOrgApi constructor.
|
||
*
|
||
* @param array $options Associative array of options to pass to the API abstraction.
|
||
*/
|
||
public function __construct($options = [])
|
||
{
|
||
}
|
||
/**
|
||
* Gets the checksums for the given version of WordPress core.
|
||
*
|
||
* @param string $version Version string to query.
|
||
* @param string $locale Optional. Locale to query. Defaults to 'en_US'.
|
||
* @return bool|array False on failure. An array of checksums on success.
|
||
* @throws RuntimeException If the remote request fails.
|
||
*/
|
||
public function get_core_checksums($version, $locale = 'en_US')
|
||
{
|
||
}
|
||
/**
|
||
* Gets a core version check.
|
||
*
|
||
* @param string $locale Optional. Locale to request a version check for. Defaults to 'en_US'.
|
||
* @return array|false False on failure. Associative array of the offer on success.
|
||
* @throws RuntimeException If the remote request failed.
|
||
*/
|
||
public function get_core_version_check($locale = 'en_US')
|
||
{
|
||
}
|
||
/**
|
||
* Gets a download offer.
|
||
*
|
||
* @param string $locale Optional. Locale to request an offer from. Defaults to 'en_US'.
|
||
* @return array|false False on failure. Associative array of the offer on success.
|
||
* @throws RuntimeException If the remote request failed.
|
||
*/
|
||
public function get_core_download_offer($locale = 'en_US')
|
||
{
|
||
}
|
||
/**
|
||
* Gets the checksums for the given version of plugin.
|
||
*
|
||
* @param string $plugin Plugin slug to query.
|
||
* @param string $version Version string to query.
|
||
* @return bool|array False on failure. An array of checksums on success.
|
||
* @throws RuntimeException If the remote request fails.
|
||
*/
|
||
public function get_plugin_checksums($plugin, $version)
|
||
{
|
||
}
|
||
/**
|
||
* Gets a plugin's info.
|
||
*
|
||
* @param string $plugin Plugin slug to query.
|
||
* @param string $locale Optional. Locale to request info for. Defaults to 'en_US'.
|
||
* @param array $fields Optional. Fields to include/omit from the response.
|
||
* @return array|false False on failure. Associative array of the offer on success.
|
||
* @throws RuntimeException If the remote request failed.
|
||
*/
|
||
public function get_plugin_info($plugin, $locale = 'en_US', array $fields = [])
|
||
{
|
||
}
|
||
/**
|
||
* Gets a theme's info.
|
||
*
|
||
* @param string $theme Theme slug to query.
|
||
* @param string $locale Optional. Locale to request info for. Defaults to 'en_US'.
|
||
* @param array $fields Optional. Fields to include/omit from the response.
|
||
* @return array|false False on failure. Associative array of the offer on success.
|
||
* @throws RuntimeException If the remote request failed.
|
||
*/
|
||
public function get_theme_info($theme, $locale = 'en_US', array $fields = [])
|
||
{
|
||
}
|
||
/**
|
||
* Gets a set of salts in the format required by `wp-config.php`.
|
||
*
|
||
* @return string A string of PHP define() statements.
|
||
* @throws RuntimeException If the remote request fails.
|
||
*/
|
||
public function get_salts()
|
||
{
|
||
}
|
||
/**
|
||
* Execute a remote GET request.
|
||
*
|
||
* @param string $url URL to execute the GET request on.
|
||
* @param array $headers Optional. Associative array of headers.
|
||
* @param array $options Optional. Associative array of options.
|
||
* @return mixed|false False on failure. Decoded JSON on success.
|
||
* @throws RuntimeException If the JSON could not be decoded.
|
||
*/
|
||
private function json_get_request($url, $headers = [], $options = [])
|
||
{
|
||
}
|
||
/**
|
||
* Execute a remote GET request.
|
||
*
|
||
* @param string $url URL to execute the GET request on.
|
||
* @param array $headers Optional. Associative array of headers.
|
||
* @param array $options Optional. Associative array of options.
|
||
* @return string Response body.
|
||
* @throws RuntimeException If the remote request fails.
|
||
*/
|
||
private function get_request($url, $headers = [], $options = [])
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace {
|
||
/**
|
||
* Base class for WP-CLI commands
|
||
*
|
||
* @package wp-cli
|
||
*/
|
||
abstract class WP_CLI_Command
|
||
{
|
||
public function __construct()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Various utilities for WP-CLI commands.
|
||
*/
|
||
class WP_CLI
|
||
{
|
||
private static $logger;
|
||
private static $hooks = [];
|
||
private static $hooks_passed = [];
|
||
private static $capture_exit = \false;
|
||
private static $deferred_additions = [];
|
||
/**
|
||
* Set the logger instance.
|
||
*
|
||
* @param object $logger Logger instance to set.
|
||
*/
|
||
public static function set_logger($logger)
|
||
{
|
||
}
|
||
/**
|
||
* Get the logger instance.
|
||
*
|
||
* @return object $logger Logger instance.
|
||
*/
|
||
public static function get_logger()
|
||
{
|
||
}
|
||
/**
|
||
* Get the Configurator instance
|
||
*
|
||
* @return Configurator
|
||
*/
|
||
public static function get_configurator()
|
||
{
|
||
}
|
||
public static function get_root_command()
|
||
{
|
||
}
|
||
public static function get_runner()
|
||
{
|
||
}
|
||
/**
|
||
* @return FileCache
|
||
*/
|
||
public static function get_cache()
|
||
{
|
||
}
|
||
/**
|
||
* Set the context in which WP-CLI should be run
|
||
*/
|
||
public static function set_url($url)
|
||
{
|
||
}
|
||
private static function set_url_params($url_parts)
|
||
{
|
||
}
|
||
/**
|
||
* @return WpHttpCacheManager
|
||
*/
|
||
public static function get_http_cache_manager()
|
||
{
|
||
}
|
||
/**
|
||
* Colorize a string for output.
|
||
*
|
||
* Yes, you can change the color of command line text too. For instance,
|
||
* here's how `WP_CLI::success()` colorizes "Success: "
|
||
*
|
||
* ```
|
||
* WP_CLI::colorize( "%GSuccess:%n " )
|
||
* ```
|
||
*
|
||
* Uses `\cli\Colors::colorize()` to transform color tokens to display
|
||
* settings. Choose from the following tokens (and note 'reset'):
|
||
*
|
||
* * %y => ['color' => 'yellow'],
|
||
* * %g => ['color' => 'green'],
|
||
* * %b => ['color' => 'blue'],
|
||
* * %r => ['color' => 'red'],
|
||
* * %p => ['color' => 'magenta'],
|
||
* * %m => ['color' => 'magenta'],
|
||
* * %c => ['color' => 'cyan'],
|
||
* * %w => ['color' => 'grey'],
|
||
* * %k => ['color' => 'black'],
|
||
* * %n => ['color' => 'reset'],
|
||
* * %Y => ['color' => 'yellow', 'style' => 'bright'],
|
||
* * %G => ['color' => 'green', 'style' => 'bright'],
|
||
* * %B => ['color' => 'blue', 'style' => 'bright'],
|
||
* * %R => ['color' => 'red', 'style' => 'bright'],
|
||
* * %P => ['color' => 'magenta', 'style' => 'bright'],
|
||
* * %M => ['color' => 'magenta', 'style' => 'bright'],
|
||
* * %C => ['color' => 'cyan', 'style' => 'bright'],
|
||
* * %W => ['color' => 'grey', 'style' => 'bright'],
|
||
* * %K => ['color' => 'black', 'style' => 'bright'],
|
||
* * %N => ['color' => 'reset', 'style' => 'bright'],
|
||
* * %3 => ['background' => 'yellow'],
|
||
* * %2 => ['background' => 'green'],
|
||
* * %4 => ['background' => 'blue'],
|
||
* * %1 => ['background' => 'red'],
|
||
* * %5 => ['background' => 'magenta'],
|
||
* * %6 => ['background' => 'cyan'],
|
||
* * %7 => ['background' => 'grey'],
|
||
* * %0 => ['background' => 'black'],
|
||
* * %F => ['style' => 'blink'],
|
||
* * %U => ['style' => 'underline'],
|
||
* * %8 => ['style' => 'inverse'],
|
||
* * %9 => ['style' => 'bright'],
|
||
* * %_ => ['style' => 'bright']
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string $string String to colorize for output, with color tokens.
|
||
* @return string Colorized string.
|
||
*/
|
||
public static function colorize($string)
|
||
{
|
||
}
|
||
/**
|
||
* Schedule a callback to be executed at a certain point.
|
||
*
|
||
* Hooks conceptually are very similar to WordPress actions. WP-CLI hooks
|
||
* are typically called before WordPress is loaded.
|
||
*
|
||
* WP-CLI hooks include:
|
||
*
|
||
* * `before_add_command:<command>` - Before the command is added.
|
||
* * `after_add_command:<command>` - After the command was added.
|
||
* * `before_invoke:<command>` (1) - Just before a command is invoked.
|
||
* * `after_invoke:<command>` (1) - Just after a command is invoked.
|
||
* * `find_command_to_run_pre` - Just before WP-CLI finds the command to run.
|
||
* * `before_registering_contexts` (1) - Before the contexts are registered.
|
||
* * `before_wp_load` - Just before the WP load process begins.
|
||
* * `before_wp_config_load` - After wp-config.php has been located.
|
||
* * `after_wp_config_load` - After wp-config.php has been loaded into scope.
|
||
* * `after_wp_load` - Just after the WP load process has completed.
|
||
* * `before_run_command` (3) - Just before the command is executed.
|
||
*
|
||
* The parentheses behind the hook name denote the number of arguments
|
||
* being passed into the hook. For such hooks, the callback should return
|
||
* the first argument again, making them work like a WP filter.
|
||
*
|
||
* WP-CLI commands can create their own hooks with `WP_CLI::do_hook()`.
|
||
*
|
||
* If additional arguments are passed through the `WP_CLI::do_hook()` call,
|
||
* these will be passed on to the callback provided by `WP_CLI::add_hook()`.
|
||
*
|
||
* ```
|
||
* # `wp network meta` confirms command is executing in multisite context.
|
||
* WP_CLI::add_command( 'network meta', 'Network_Meta_Command', array(
|
||
* 'before_invoke' => function ( $name ) {
|
||
* if ( !is_multisite() ) {
|
||
* WP_CLI::error( 'This is not a multisite installation.' );
|
||
* }
|
||
* }
|
||
* ) );
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Registration
|
||
*
|
||
* @param string $when Identifier for the hook.
|
||
* @param mixed $callback Callback to execute when hook is called.
|
||
* @return void
|
||
*/
|
||
public static function add_hook($when, $callback)
|
||
{
|
||
}
|
||
/**
|
||
* Execute callbacks registered to a given hook.
|
||
*
|
||
* See `WP_CLI::add_hook()` for details on WP-CLI's internal hook system.
|
||
* Commands can provide and call their own hooks.
|
||
*
|
||
* @access public
|
||
* @category Registration
|
||
*
|
||
* @param string $when Identifier for the hook.
|
||
* @param mixed ...$args Optional. Arguments that will be passed onto the
|
||
* callback provided by `WP_CLI::add_hook()`.
|
||
* @return null|mixed Returns the first optional argument if optional
|
||
* arguments were passed, otherwise returns null.
|
||
*/
|
||
public static function do_hook($when, ...$args)
|
||
{
|
||
}
|
||
/**
|
||
* Add a callback to a WordPress action or filter.
|
||
*
|
||
* `add_action()` without needing access to `add_action()`. If WordPress is
|
||
* already loaded though, you should use `add_action()` (and `add_filter()`)
|
||
* instead.
|
||
*
|
||
* @access public
|
||
* @category Registration
|
||
*
|
||
* @param string $tag Named WordPress action or filter.
|
||
* @param mixed $function_to_add Callable to execute when the action or filter is evaluated.
|
||
* @param integer $priority Priority to add the callback as.
|
||
* @param integer $accepted_args Number of arguments to pass to callback.
|
||
* @return true
|
||
*/
|
||
public static function add_wp_hook($tag, $function_to_add, $priority = 10, $accepted_args = 1)
|
||
{
|
||
}
|
||
/**
|
||
* Build Unique ID for storage and retrieval.
|
||
*
|
||
* Essentially _wp_filter_build_unique_id() without needing access to _wp_filter_build_unique_id()
|
||
*/
|
||
private static function wp_hook_build_unique_id($tag, $function, $priority)
|
||
{
|
||
}
|
||
/**
|
||
* Register a command to WP-CLI.
|
||
*
|
||
* WP-CLI supports using any callable class, function, or closure as a
|
||
* command. `WP_CLI::add_command()` is used for both internal and
|
||
* third-party command registration.
|
||
*
|
||
* Command arguments are parsed from PHPDoc by default, but also can be
|
||
* supplied as an optional third argument during registration.
|
||
*
|
||
* ```
|
||
* # Register a custom 'foo' command to output a supplied positional param.
|
||
* #
|
||
* # $ wp foo bar --append=qux
|
||
* # Success: bar qux
|
||
*
|
||
* /**
|
||
* * My awesome closure command
|
||
* *
|
||
* * <message>
|
||
* * : An awesome message to display
|
||
* *
|
||
* * --append=<message>
|
||
* * : An awesome message to append to the original message.
|
||
* *
|
||
* * @when before_wp_load
|
||
* *\/
|
||
* $foo = function( $args, $assoc_args ) {
|
||
* WP_CLI::success( $args[0] . ' ' . $assoc_args['append'] );
|
||
* };
|
||
* WP_CLI::add_command( 'foo', $foo );
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Registration
|
||
*
|
||
* @param string $name Name for the command (e.g. "post list" or "site empty").
|
||
* @param callable|object|string $callable Command implementation as a class, function or closure.
|
||
* @param array $args {
|
||
* Optional. An associative array with additional registration parameters.
|
||
*
|
||
* @type callable $before_invoke Callback to execute before invoking the command.
|
||
* @type callable $after_invoke Callback to execute after invoking the command.
|
||
* @type string $shortdesc Short description (80 char or less) for the command.
|
||
* @type string $longdesc Description of arbitrary length for examples, etc.
|
||
* @type string $synopsis The synopsis for the command (string or array).
|
||
* @type string $when Execute callback on a named WP-CLI hook (e.g. before_wp_load).
|
||
* @type bool $is_deferred Whether the command addition had already been deferred.
|
||
* }
|
||
* @return bool True on success, false if deferred, hard error if registration failed.
|
||
*/
|
||
public static function add_command($name, $callable, $args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Merge the sub-commands of two commands into a single command to keep.
|
||
*
|
||
* @param CompositeCommand $command_to_keep Command to merge the sub commands into. This is typically one of the
|
||
* two others.
|
||
* @param CompositeCommand $old_command Command that was already registered.
|
||
* @param CompositeCommand $new_command New command that is being added.
|
||
*/
|
||
private static function merge_sub_commands(\WP_CLI\Dispatcher\CompositeCommand $command_to_keep, \WP_CLI\Dispatcher\CompositeCommand $old_command, \WP_CLI\Dispatcher\CompositeCommand $new_command)
|
||
{
|
||
}
|
||
/**
|
||
* Defer command addition for a sub-command if the parent command is not yet
|
||
* registered.
|
||
*
|
||
* @param string $name Name for the sub-command.
|
||
* @param string $parent Name for the parent command.
|
||
* @param string $callable Command implementation as a class, function or closure.
|
||
* @param array $args Optional. See `WP_CLI::add_command()` for details.
|
||
*/
|
||
private static function defer_command_addition($name, $parent, $callable, $args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Get the list of outstanding deferred command additions.
|
||
*
|
||
* @return array Array of outstanding command additions.
|
||
*/
|
||
public static function get_deferred_additions()
|
||
{
|
||
}
|
||
/**
|
||
* Remove a command addition from the list of outstanding deferred additions.
|
||
*/
|
||
public static function remove_deferred_addition($name)
|
||
{
|
||
}
|
||
/**
|
||
* Display informational message without prefix, and ignore `--quiet`.
|
||
*
|
||
* Message is written to STDOUT. `WP_CLI::log()` is typically recommended;
|
||
* `WP_CLI::line()` is included for historical compat.
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string $message Message to display to the end user.
|
||
* @return void
|
||
*/
|
||
public static function line($message = '')
|
||
{
|
||
}
|
||
/**
|
||
* Display informational message without prefix.
|
||
*
|
||
* Message is written to STDOUT, or discarded when `--quiet` flag is supplied.
|
||
*
|
||
* ```
|
||
* # `wp cli update` lets user know of each step in the update process.
|
||
* WP_CLI::log( sprintf( 'Downloading from %s...', $download_url ) );
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string $message Message to write to STDOUT.
|
||
*/
|
||
public static function log($message)
|
||
{
|
||
}
|
||
/**
|
||
* Display success message prefixed with "Success: ".
|
||
*
|
||
* Success message is written to STDOUT, or discarded when `--quiet` flag is supplied.
|
||
*
|
||
* Typically recommended to inform user of successful script conclusion.
|
||
*
|
||
* ```
|
||
* # wp rewrite flush expects 'rewrite_rules' option to be set after flush.
|
||
* flush_rewrite_rules( \WP_CLI\Utils\get_flag_value( $assoc_args, 'hard' ) );
|
||
* if ( ! get_option( 'rewrite_rules' ) ) {
|
||
* WP_CLI::warning( "Rewrite rules are empty." );
|
||
* } else {
|
||
* WP_CLI::success( 'Rewrite rules flushed.' );
|
||
* }
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string $message Message to write to STDOUT.
|
||
* @return void
|
||
*/
|
||
public static function success($message)
|
||
{
|
||
}
|
||
/**
|
||
* Display debug message prefixed with "Debug: " when `--debug` is used.
|
||
*
|
||
* Debug message is written to STDERR, and includes script execution time.
|
||
*
|
||
* Helpful for optionally showing greater detail when needed. Used throughout
|
||
* WP-CLI bootstrap process for easier debugging and profiling.
|
||
*
|
||
* ```
|
||
* # Called in `WP_CLI\Runner::set_wp_root()`.
|
||
* private static function set_wp_root( $path ) {
|
||
* define( 'ABSPATH', Utils\trailingslashit( $path ) );
|
||
* WP_CLI::debug( 'ABSPATH defined: ' . ABSPATH );
|
||
* $_SERVER['DOCUMENT_ROOT'] = realpath( $path );
|
||
* }
|
||
*
|
||
* # Debug details only appear when `--debug` is used.
|
||
* # $ wp --debug
|
||
* # [...]
|
||
* # Debug: ABSPATH defined: /srv/www/wordpress-develop.dev/src/ (0.225s)
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string|WP_Error|Exception|Throwable $message Message to write to STDERR.
|
||
* @param string|bool $group Organize debug message to a specific group.
|
||
* Use `false` to not group the message.
|
||
* @return void
|
||
*/
|
||
public static function debug($message, $group = \false)
|
||
{
|
||
}
|
||
/**
|
||
* Display warning message prefixed with "Warning: ".
|
||
*
|
||
* Warning message is written to STDERR, or discarded when `--quiet` flag is supplied.
|
||
*
|
||
* Use instead of `WP_CLI::debug()` when script execution should be permitted
|
||
* to continue.
|
||
*
|
||
* ```
|
||
* # `wp plugin activate` skips activation when plugin is network active.
|
||
* $status = $this->get_status( $plugin->file );
|
||
* // Network-active is the highest level of activation status
|
||
* if ( 'active-network' === $status ) {
|
||
* WP_CLI::warning( "Plugin '{$plugin->name}' is already network active." );
|
||
* continue;
|
||
* }
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string|WP_Error|Exception|Throwable $message Message to write to STDERR.
|
||
* @return void
|
||
*/
|
||
public static function warning($message)
|
||
{
|
||
}
|
||
/**
|
||
* Display error message prefixed with "Error: " and exit script.
|
||
*
|
||
* Error message is written to STDERR. Defaults to halting script execution
|
||
* with return code 1.
|
||
*
|
||
* Use `WP_CLI::warning()` instead when script execution should be permitted
|
||
* to continue.
|
||
*
|
||
* ```
|
||
* # `wp cache flush` considers flush failure to be a fatal error.
|
||
* if ( false === wp_cache_flush() ) {
|
||
* WP_CLI::error( 'The object cache could not be flushed.' );
|
||
* }
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string|WP_Error|Exception|Throwable $message Message to write to STDERR.
|
||
* @param boolean|integer $exit True defaults to exit(1).
|
||
* @return null
|
||
*/
|
||
public static function error($message, $exit = \true)
|
||
{
|
||
}
|
||
/**
|
||
* Halt script execution with a specific return code.
|
||
*
|
||
* Permits script execution to be overloaded by `WP_CLI::runcommand()`
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param integer $return_code
|
||
* @return never
|
||
*/
|
||
public static function halt($return_code)
|
||
{
|
||
}
|
||
/**
|
||
* Display a multi-line error message in a red box. Doesn't exit script.
|
||
*
|
||
* Error message is written to STDERR.
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param array $message_lines Multi-line error message to be displayed.
|
||
*/
|
||
public static function error_multi_line($message_lines)
|
||
{
|
||
}
|
||
/**
|
||
* Ask for confirmation before running a destructive operation.
|
||
*
|
||
* If 'y' is provided to the question, the script execution continues. If
|
||
* 'n' or any other response is provided to the question, script exits.
|
||
*
|
||
* ```
|
||
* # `wp db drop` asks for confirmation before dropping the database.
|
||
*
|
||
* WP_CLI::confirm( "Are you sure you want to drop the database?", $assoc_args );
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param string $question Question to display before the prompt.
|
||
* @param array $assoc_args Skips prompt if 'yes' is provided.
|
||
*/
|
||
public static function confirm($question, $assoc_args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Read value from a positional argument or from STDIN.
|
||
*
|
||
* @param array $args The list of positional arguments.
|
||
* @param int $index At which position to check for the value.
|
||
*
|
||
* @return string
|
||
*/
|
||
public static function get_value_from_arg_or_stdin($args, $index)
|
||
{
|
||
}
|
||
/**
|
||
* Read a value, from various formats.
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param mixed $raw_value
|
||
* @param array $assoc_args
|
||
*/
|
||
public static function read_value($raw_value, $assoc_args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Display a value, in various formats
|
||
*
|
||
* @param mixed $value Value to display.
|
||
* @param array $assoc_args Arguments passed to the command, determining format.
|
||
*/
|
||
public static function print_value($value, $assoc_args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Convert a WP_Error or Exception into a string
|
||
*
|
||
* @param string|WP_Error|Exception|Throwable $errors
|
||
* @throws InvalidArgumentException
|
||
*
|
||
* @return string
|
||
*/
|
||
public static function error_to_string($errors)
|
||
{
|
||
}
|
||
/**
|
||
* Launch an arbitrary external process that takes over I/O.
|
||
*
|
||
* ```
|
||
* # `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;
|
||
* }
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Execution
|
||
*
|
||
* @param string $command External process to launch.
|
||
* @param boolean $exit_on_error Whether to exit if the command returns an elevated return code.
|
||
* @param boolean $return_detailed Whether to return an exit status (default) or detailed execution results.
|
||
* @return int|ProcessRun The command exit status, or a ProcessRun object for full details.
|
||
*/
|
||
public static function launch($command, $exit_on_error = \true, $return_detailed = \false)
|
||
{
|
||
}
|
||
/**
|
||
* Run a WP-CLI command in a new process reusing the current runtime arguments.
|
||
*
|
||
* 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.
|
||
*
|
||
* @access public
|
||
* @category Execution
|
||
*
|
||
* @param string $command WP-CLI command to call.
|
||
* @param array $args Positional arguments to include when calling the command.
|
||
* @param array $assoc_args Associative arguments to include when calling the command.
|
||
* @param bool $exit_on_error Whether to exit if the command returns an elevated return code.
|
||
* @param bool $return_detailed Whether to return an exit status (default) or detailed execution results.
|
||
* @param array $runtime_args Override one or more global args (path,url,user,allow-root)
|
||
* @return int|ProcessRun The command exit status, or a ProcessRun instance
|
||
*/
|
||
public static function launch_self($command, $args = [], $assoc_args = [], $exit_on_error = \true, $return_detailed = \false, $runtime_args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the PHP binary used when executing WP-CLI.
|
||
*
|
||
* Environment values permit specific binaries to be indicated.
|
||
*
|
||
* Note: moved to Utils, left for BC.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
*
|
||
* @return string
|
||
*/
|
||
public static function get_php_binary()
|
||
{
|
||
}
|
||
/**
|
||
* Confirm that a global configuration parameter does exist.
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param string $key Config parameter key to check.
|
||
*
|
||
* @return bool
|
||
*/
|
||
public static function has_config($key)
|
||
{
|
||
}
|
||
/**
|
||
* Get values of global configuration parameters.
|
||
*
|
||
* Provides access to `--path=<path>`, `--url=<url>`, and other values of
|
||
* the [global configuration parameters](https://make.wordpress.org/cli/handbook/references/config/).
|
||
*
|
||
* ```
|
||
* WP_CLI::log( 'The --url=<url> value is: ' . WP_CLI::get_config( 'url' ) );
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param string $key Get value for a specific global configuration parameter.
|
||
* @return mixed
|
||
*/
|
||
public static function get_config($key = \null)
|
||
{
|
||
}
|
||
/**
|
||
* Run a WP-CLI command.
|
||
*
|
||
* Launches a new child process to run a specified WP-CLI command.
|
||
* Optionally:
|
||
*
|
||
* * Run the command in an existing process.
|
||
* * Prevent halting script execution on error.
|
||
* * Capture and return STDOUT, or full details about command execution.
|
||
* * Parse JSON output if the command rendered it.
|
||
* * Include additional arguments that are passed to the command.
|
||
*
|
||
* ```
|
||
* $options = array(
|
||
* 'return' => true, // Return 'STDOUT'; use 'all' for full object.
|
||
* 'parse' => 'json', // Parse captured STDOUT to JSON array.
|
||
* 'launch' => false, // Reuse the current process.
|
||
* 'exit_error' => true, // Halt script execution on error.
|
||
* 'command_args' => [ '--skip-themes' ], // Additional arguments to be passed to the $command.
|
||
* );
|
||
* $plugins = WP_CLI::runcommand( 'plugin list --format=json', $options );
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Execution
|
||
*
|
||
* @param string $command WP-CLI command to run, including arguments.
|
||
* @param array $options {
|
||
* Configuration options for command execution.
|
||
*
|
||
* @type bool $launch Launches a new process (true) or reuses the existing process (false). Default: true.
|
||
* @type bool $exit_error Halts the script on error. Default: true.
|
||
* @type bool|string $return Returns output as an object when set to 'all' (string), return just the 'stdout', 'stderr', or 'return_code' (string) of command, or print directly to stdout/stderr (false). Default: false.
|
||
* @type bool|string $parse Parse returned output as 'json' (string); otherwise, output is unchanged (false). Default: false.
|
||
* @param array $command_args Contains additional command line arguments for the command. Each element represents a single argument. Default: empty array.
|
||
* }
|
||
* @return mixed
|
||
*/
|
||
public static function runcommand($command, $options = [])
|
||
{
|
||
}
|
||
/**
|
||
* Run a given command within the current process using the same global
|
||
* parameters.
|
||
*
|
||
* Use `WP_CLI::runcommand()` instead, which is easier to use and works better.
|
||
*
|
||
* To run a command using a new process with the same global parameters,
|
||
* use WP_CLI::launch_self(). To run a command using a new process with
|
||
* different global parameters, use WP_CLI::launch().
|
||
*
|
||
* ```
|
||
* ob_start();
|
||
* WP_CLI::run_command( array( 'cli', 'cmd-dump' ) );
|
||
* $ret = ob_get_clean();
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Execution
|
||
*
|
||
* @param array $args Positional arguments including command name.
|
||
* @param array $assoc_args
|
||
*/
|
||
public static function run_command($args, $assoc_args = [])
|
||
{
|
||
}
|
||
// DEPRECATED STUFF.
|
||
public static function add_man_dir()
|
||
{
|
||
}
|
||
// back-compat.
|
||
public static function out($str)
|
||
{
|
||
}
|
||
// back-compat.
|
||
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid -- Deprecated method.
|
||
public static function addCommand($name, $class)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Retrieves, sets and updates aliases for WordPress Installations.
|
||
*
|
||
* Aliases are shorthand references to WordPress installs. For instance,
|
||
* `@dev` could refer to a development install and `@prod` could refer to a production install.
|
||
* This command gives you and option to add, update and delete, the registered aliases you have available.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # List alias information.
|
||
* $ wp cli alias list
|
||
* list
|
||
* ---
|
||
* @all: Run command against every registered alias.
|
||
* @local:
|
||
* user: wpcli
|
||
* path: /Users/wpcli/sites/testsite
|
||
*
|
||
* # Get alias information.
|
||
* $ wp cli alias get @dev
|
||
* ssh: dev@somedeve.env:12345/home/dev/
|
||
*
|
||
* # Add alias.
|
||
* $ wp cli alias add @prod --set-ssh=login@host --set-path=/path/to/wordpress/install/ --set-user=wpcli
|
||
* Success: Added '@prod' alias.
|
||
*
|
||
* # Update alias.
|
||
* $ wp cli alias update @prod --set-user=newuser --set-path=/new/path/to/wordpress/install/
|
||
* Success: Updated 'prod' alias.
|
||
*
|
||
* # Delete alias.
|
||
* $ wp cli alias delete @prod
|
||
* Success: Deleted '@prod' alias.
|
||
*
|
||
* @package wp-cli
|
||
* @when before_wp_load
|
||
*/
|
||
class CLI_Alias_Command extends \WP_CLI_Command
|
||
{
|
||
/**
|
||
* Lists available WP-CLI aliases.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* [--format=<format>]
|
||
* : Render output in a particular format.
|
||
* ---
|
||
* default: yaml
|
||
* options:
|
||
* - yaml
|
||
* - json
|
||
* - var_export
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # List all available aliases.
|
||
* $ wp cli alias list
|
||
* ---
|
||
* @all: Run command against every registered alias.
|
||
* @prod:
|
||
* ssh: runcommand@runcommand.io~/webapps/production
|
||
* @dev:
|
||
* ssh: vagrant@192.168.50.10/srv/www/runcommand.dev
|
||
* @both:
|
||
* - @prod
|
||
* - @dev
|
||
*
|
||
* @subcommand list
|
||
*/
|
||
public function list_($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Gets the value for an alias.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* <key>
|
||
* : Key for the alias.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Get alias.
|
||
* $ wp cli alias get @prod
|
||
* ssh: dev@somedeve.env:12345/home/dev/
|
||
*/
|
||
public function get($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Creates an alias.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* <key>
|
||
* : Key for the alias.
|
||
*
|
||
* [--set-user=<user>]
|
||
* : Set user for alias.
|
||
*
|
||
* [--set-url=<url>]
|
||
* : Set url for alias.
|
||
*
|
||
* [--set-path=<path>]
|
||
* : Set path for alias.
|
||
*
|
||
* [--set-ssh=<ssh>]
|
||
* : Set ssh for alias.
|
||
*
|
||
* [--set-http=<http>]
|
||
* : Set http for alias.
|
||
*
|
||
* [--grouping=<grouping>]
|
||
* : For grouping multiple aliases.
|
||
*
|
||
* [--config=<config>]
|
||
* : Config file to be considered for operations.
|
||
* ---
|
||
* default: global
|
||
* options:
|
||
* - global
|
||
* - project
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Add alias to global config.
|
||
* $ wp cli alias add @prod --set-ssh=login@host --set-path=/path/to/wordpress/install/ --set-user=wpcli
|
||
* Success: Added '@prod' alias.
|
||
*
|
||
* # Add alias to project config.
|
||
* $ wp cli alias add @prod --set-ssh=login@host --set-path=/path/to/wordpress/install/ --set-user=wpcli --config=project
|
||
* Success: Added '@prod' alias.
|
||
*
|
||
* # Add group of aliases.
|
||
* $ wp cli alias add @multiservers --grouping=servera,serverb
|
||
* Success: Added '@multiservers' alias.
|
||
*/
|
||
public function add($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Deletes an alias.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* <key>
|
||
* : Key for the alias.
|
||
*
|
||
* [--config=<config>]
|
||
* : Config file to be considered for operations.
|
||
* ---
|
||
* options:
|
||
* - global
|
||
* - project
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Delete alias.
|
||
* $ wp cli alias delete @prod
|
||
* Success: Deleted '@prod' alias.
|
||
*
|
||
* # Delete project alias.
|
||
* $ wp cli alias delete @prod --config=project
|
||
* Success: Deleted '@prod' alias.
|
||
*/
|
||
public function delete($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Updates an alias.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* <key>
|
||
* : Key for the alias.
|
||
*
|
||
* [--set-user=<user>]
|
||
* : Set user for alias.
|
||
*
|
||
* [--set-url=<url>]
|
||
* : Set url for alias.
|
||
*
|
||
* [--set-path=<path>]
|
||
* : Set path for alias.
|
||
*
|
||
* [--set-ssh=<ssh>]
|
||
* : Set ssh for alias.
|
||
*
|
||
* [--set-http=<http>]
|
||
* : Set http for alias.
|
||
*
|
||
* [--grouping=<grouping>]
|
||
* : For grouping multiple aliases.
|
||
*
|
||
* [--config=<config>]
|
||
* : Config file to be considered for operations.
|
||
* ---
|
||
* options:
|
||
* - global
|
||
* - project
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Update alias.
|
||
* $ wp cli alias update @prod --set-user=newuser --set-path=/new/path/to/wordpress/install/
|
||
* Success: Updated 'prod' alias.
|
||
*
|
||
* # Update project alias.
|
||
* $ wp cli alias update @prod --set-user=newuser --set-path=/new/path/to/wordpress/install/ --config=project
|
||
* Success: Updated 'prod' alias.
|
||
*/
|
||
public function update($args, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether an alias is a group.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* <key>
|
||
* : Key for the alias.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Checks whether the alias is a group; exit status 0 if it is, otherwise 1.
|
||
* $ wp cli alias is-group @prod
|
||
* $ echo $?
|
||
* 1
|
||
*
|
||
* @subcommand is-group
|
||
*/
|
||
public function is_group($args, $assoc_args = array())
|
||
{
|
||
}
|
||
/**
|
||
* Get config path and aliases data based on config type.
|
||
*
|
||
* @param string $config Type of config to get data from.
|
||
* @param string $alias Alias to be used for Add/Update/Delete.
|
||
* @param bool $create_config_file Optional. If a config file doesn't exist,
|
||
* should it be created? Defaults to false.
|
||
*
|
||
* @return array Config Path and Aliases in it.
|
||
* @throws ExitException
|
||
*/
|
||
private function get_aliases_data($config, $alias, $create_config_file = \false)
|
||
{
|
||
}
|
||
/**
|
||
* Check if the config file exists and is writable.
|
||
*
|
||
* @param string $config_path Path to config file.
|
||
*
|
||
* @return void
|
||
*/
|
||
private function validate_config_file($config_path)
|
||
{
|
||
}
|
||
/**
|
||
* Return aliases array.
|
||
*
|
||
* @param array $aliases Current aliases data.
|
||
* @param string $alias Name of alias.
|
||
* @param array $assoc_args Associative arguments.
|
||
* @param bool $is_grouping Check if its a grouping operation.
|
||
* @param string $grouping Grouping value.
|
||
* @param bool $is_update Is this an update operation?
|
||
*
|
||
* @return mixed
|
||
*/
|
||
private function build_aliases($aliases, $alias, $assoc_args, $is_grouping, $grouping = '', $is_update = \false)
|
||
{
|
||
}
|
||
/**
|
||
* Validate input of passed arguments.
|
||
*
|
||
* @param array $assoc_args Arguments array.
|
||
* @param string $grouping Grouping argument value.
|
||
*
|
||
* @throws ExitException
|
||
*/
|
||
private function validate_input($assoc_args, $grouping)
|
||
{
|
||
}
|
||
/**
|
||
* Validate alias type before update.
|
||
*
|
||
* @param array $aliases Existing aliases data.
|
||
* @param string $alias Alias Name.
|
||
* @param array $assoc_args Arguments array.
|
||
* @param string $grouping Grouping argument value.
|
||
*
|
||
* @throws ExitException
|
||
*/
|
||
private function validate_alias_type($aliases, $alias, $assoc_args, $grouping)
|
||
{
|
||
}
|
||
/**
|
||
* Save aliases data to config file.
|
||
*
|
||
* @param array $aliases Current aliases data.
|
||
* @param string $alias Name of alias.
|
||
* @param string $config_path Path to config file.
|
||
* @param string $operation Current operation string fro message.
|
||
*/
|
||
private function process_aliases($aliases, $alias, $config_path, $operation = '')
|
||
{
|
||
}
|
||
/**
|
||
* Normalize the alias to an expected format.
|
||
*
|
||
* - Add @ if not present.
|
||
*
|
||
* @param string $alias Name of alias.
|
||
*/
|
||
private function normalize_alias($alias)
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Manages the internal WP-CLI cache,.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Remove all cached files.
|
||
* $ wp cli cache clear
|
||
* Success: Cache cleared.
|
||
*
|
||
* # Remove all cached files except for the newest version of each one.
|
||
* $ wp cli cache prune
|
||
* Success: Cache pruned.
|
||
*
|
||
* @when before_wp_load
|
||
*/
|
||
class CLI_Cache_Command extends \WP_CLI_Command
|
||
{
|
||
/**
|
||
* Clears the internal cache.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* $ wp cli cache clear
|
||
* Success: Cache cleared.
|
||
*
|
||
* @subcommand clear
|
||
*/
|
||
public function cache_clear()
|
||
{
|
||
}
|
||
/**
|
||
* Prunes the internal cache.
|
||
*
|
||
* Removes all cached files except for the newest version of each one.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* $ wp cli cache prune
|
||
* Success: Cache pruned.
|
||
*
|
||
* @subcommand prune
|
||
*/
|
||
public function cache_prune()
|
||
{
|
||
}
|
||
}
|
||
/**
|
||
* Reviews current WP-CLI info, checks for updates, or views defined aliases.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Display the version currently installed.
|
||
* $ wp cli version
|
||
* WP-CLI 0.24.1
|
||
*
|
||
* # Check for updates to WP-CLI.
|
||
* $ wp cli check-update
|
||
* Success: WP-CLI is at the latest version.
|
||
*
|
||
* # Update WP-CLI to the latest stable release.
|
||
* $ wp cli update
|
||
* You have version 0.24.0. Would you like to update to 0.24.1? [y/n] y
|
||
* Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar...
|
||
* New version works. Proceeding to replace.
|
||
* Success: Updated WP-CLI to 0.24.1.
|
||
*
|
||
* # Clear the internal WP-CLI cache.
|
||
* $ wp cli cache clear
|
||
* Success: Cache cleared.
|
||
*
|
||
* @when before_wp_load
|
||
*/
|
||
class CLI_Command extends \WP_CLI_Command
|
||
{
|
||
private function command_to_array($command)
|
||
{
|
||
}
|
||
/**
|
||
* Prints WP-CLI version.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Display CLI version.
|
||
* $ wp cli version
|
||
* WP-CLI 0.24.1
|
||
*/
|
||
public function version()
|
||
{
|
||
}
|
||
/**
|
||
* Prints various details about the WP-CLI environment.
|
||
*
|
||
* Helpful for diagnostic purposes, this command shares:
|
||
*
|
||
* * OS information.
|
||
* * Shell information.
|
||
* * PHP binary used.
|
||
* * PHP binary version.
|
||
* * php.ini configuration file used (which is typically different than web).
|
||
* * WP-CLI root dir: where WP-CLI is installed (if non-Phar install).
|
||
* * WP-CLI global config: where the global config YAML file is located.
|
||
* * WP-CLI project config: where the project config YAML file is located.
|
||
* * WP-CLI version: currently installed version.
|
||
*
|
||
* See [config docs](https://make.wordpress.org/cli/handbook/references/config/) for more details on global
|
||
* and project config YAML files.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* [--format=<format>]
|
||
* : Render output in a particular format.
|
||
* ---
|
||
* default: list
|
||
* options:
|
||
* - list
|
||
* - json
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Display various data about the CLI environment.
|
||
* $ wp cli info
|
||
* OS: Linux 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64
|
||
* Shell: /usr/bin/zsh
|
||
* PHP binary: /usr/bin/php
|
||
* PHP version: 7.1.12-1+ubuntu16.04.1+deb.sury.org+1
|
||
* php.ini used: /etc/php/7.1/cli/php.ini
|
||
* WP-CLI root dir: phar://wp-cli.phar
|
||
* WP-CLI packages dir: /home/person/.wp-cli/packages/
|
||
* WP-CLI global config:
|
||
* WP-CLI project config:
|
||
* WP-CLI version: 1.5.0
|
||
*/
|
||
public function info($_, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Checks to see if there is a newer version of WP-CLI available.
|
||
*
|
||
* Queries the GitHub releases API. Returns available versions if there are
|
||
* updates available, or success message if using the latest release.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* [--patch]
|
||
* : Only list patch updates.
|
||
*
|
||
* [--minor]
|
||
* : Only list minor updates.
|
||
*
|
||
* [--major]
|
||
* : Only list major updates.
|
||
*
|
||
* [--field=<field>]
|
||
* : Prints the value of a single field for each update.
|
||
*
|
||
* [--fields=<fields>]
|
||
* : Limit the output to specific object fields. Defaults to version,update_type,package_url,status,requires_php.
|
||
*
|
||
* [--format=<format>]
|
||
* : Render output in a particular format.
|
||
* ---
|
||
* default: table
|
||
* options:
|
||
* - table
|
||
* - csv
|
||
* - json
|
||
* - count
|
||
* - yaml
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Check for update.
|
||
* $ wp cli check-update
|
||
* Success: WP-CLI is at the latest version.
|
||
*
|
||
* # Check for update and new version is available.
|
||
* $ wp cli check-update
|
||
* +---------+-------------+-------------------------------------------------------------------------------+
|
||
* | version | update_type | package_url |
|
||
* +---------+-------------+-------------------------------------------------------------------------------+
|
||
* | 0.24.1 | patch | https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar |
|
||
* +---------+-------------+-------------------------------------------------------------------------------+
|
||
*
|
||
* @subcommand check-update
|
||
*/
|
||
public function check_update($_, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Updates WP-CLI to the latest release.
|
||
*
|
||
* Default behavior is to check the releases API for the newest stable
|
||
* version, and prompt if one is available.
|
||
*
|
||
* Use `--stable` to install or reinstall the latest stable version.
|
||
*
|
||
* Use `--nightly` to install the latest built version of the master branch.
|
||
* While not recommended for production, nightly contains the latest and
|
||
* greatest, and should be stable enough for development and staging
|
||
* environments.
|
||
*
|
||
* Only works for the Phar installation mechanism.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* [--patch]
|
||
* : Only perform patch updates.
|
||
*
|
||
* [--minor]
|
||
* : Only perform minor updates.
|
||
*
|
||
* [--major]
|
||
* : Only perform major updates.
|
||
*
|
||
* [--stable]
|
||
* : Update to the latest stable release. Skips update check.
|
||
*
|
||
* [--nightly]
|
||
* : Update to the latest built version of the master branch. Potentially unstable.
|
||
*
|
||
* [--yes]
|
||
* : Do not prompt for confirmation.
|
||
*
|
||
* [--insecure]
|
||
* : Retry without certificate validation if TLS handshake fails. Note: This makes the request vulnerable to a MITM attack.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Update CLI.
|
||
* $ wp cli update
|
||
* You are currently using WP-CLI version 0.24.0. Would you like to update to 0.24.1? [y/n] y
|
||
* Downloading from https://github.com/wp-cli/wp-cli/releases/download/v0.24.1/wp-cli-0.24.1.phar...
|
||
* New version works. Proceeding to replace.
|
||
* Success: Updated WP-CLI to 0.24.1.
|
||
*/
|
||
public function update($_, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* @param string $file Release file path.
|
||
* @param string $sha512_url URL to sha512 hash.
|
||
* @param string $md5_url URL to md5 hash.
|
||
*
|
||
* @return void
|
||
* @throws \WP_CLI\ExitException
|
||
*/
|
||
private function validate_hashes($file, $sha512_url, $md5_url)
|
||
{
|
||
}
|
||
/**
|
||
* Returns update information.
|
||
*/
|
||
private function get_updates($assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Returns the the first element of the passed array for which the
|
||
* callback returns true.
|
||
*
|
||
* Polyfill for the `array_find()` function introduced in PHP 8.3.
|
||
*
|
||
* @param array $arr Array to search.
|
||
* @param callable $callback The callback function for each element in the array.
|
||
* @return mixed First array element for which the callback returns true, null otherwise.
|
||
*/
|
||
private function array_find($arr, $callback)
|
||
{
|
||
}
|
||
/**
|
||
* Dumps the list of global parameters, as JSON or in var_export format.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* [--with-values]
|
||
* : Display current values also.
|
||
*
|
||
* [--format=<format>]
|
||
* : Render output in a particular format.
|
||
* ---
|
||
* default: json
|
||
* options:
|
||
* - var_export
|
||
* - json
|
||
* ---
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Dump the list of global parameters.
|
||
* $ wp cli param-dump --format=var_export
|
||
* array (
|
||
* 'path' =>
|
||
* array (
|
||
* 'runtime' => '=<path>',
|
||
* 'file' => '<path>',
|
||
* 'synopsis' => '',
|
||
* 'default' => NULL,
|
||
* 'multiple' => false,
|
||
* 'desc' => 'Path to the WordPress files.',
|
||
* ),
|
||
* 'url' =>
|
||
* array (
|
||
*
|
||
* @subcommand param-dump
|
||
*/
|
||
public function param_dump($_, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Dumps the list of installed commands, as JSON.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Dump the list of installed commands.
|
||
* $ wp cli cmd-dump
|
||
* {"name":"wp","description":"Manage WordPress through the command-line.","longdesc":"\n\n## GLOBAL PARAMETERS\n\n --path=<path>\n Path to the WordPress files.\n\n --ssh=<ssh>\n Perform operation against a remote server over SSH (or a container using scheme of "docker" or "docker-compose").\n\n --url=<url>\n Pretend request came from given URL. In multisite, this argument is how the target site is specified. \n\n --user=<id|login|email>\n
|
||
*
|
||
* @subcommand cmd-dump
|
||
*/
|
||
public function cmd_dump()
|
||
{
|
||
}
|
||
/**
|
||
* Generates tab completion strings.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* --line=<line>
|
||
* : The current command line to be executed.
|
||
*
|
||
* --point=<point>
|
||
* : The index to the current cursor position relative to the beginning of the command.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # Generate tab completion strings.
|
||
* $ wp cli completions --line='wp eva' --point=100
|
||
* eval
|
||
* eval-file
|
||
*/
|
||
public function completions($_, $assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Get a string representing the type of update being checked for.
|
||
*/
|
||
private function get_update_type_str($assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Detects if a command exists
|
||
*
|
||
* This commands checks if a command is registered with WP-CLI.
|
||
* If the command is found then it returns with exit status 0.
|
||
* If the command doesn't exist, then it will exit with status 1.
|
||
*
|
||
* ## OPTIONS
|
||
* <command_name>...
|
||
* : The command
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # The "site delete" command is registered.
|
||
* $ wp cli has-command "site delete"
|
||
* $ echo $?
|
||
* 0
|
||
*
|
||
* # The "foo bar" command is not registered.
|
||
* $ wp cli has-command "foo bar"
|
||
* $ echo $?
|
||
* 1
|
||
*
|
||
* # Install a WP-CLI package if not already installed
|
||
* $ if ! $(wp cli has-command doctor); then wp package install wp-cli/doctor-command; fi
|
||
* Installing package wp-cli/doctor-command (dev-main || dev-master || dev-trunk)
|
||
* Updating /home/person/.wp-cli/packages/composer.json to require the package...
|
||
* Using Composer to install the package...
|
||
* ---
|
||
* Success: Package installed.
|
||
*
|
||
* @subcommand has-command
|
||
*
|
||
* @when after_wp_load
|
||
*/
|
||
public function has_command($_, $assoc_args)
|
||
{
|
||
}
|
||
}
|
||
class Help_Command extends \WP_CLI_Command
|
||
{
|
||
/**
|
||
* Gets help on WP-CLI, or on a specific command.
|
||
*
|
||
* ## OPTIONS
|
||
*
|
||
* [<command>...]
|
||
* : Get help on a specific command.
|
||
*
|
||
* ## EXAMPLES
|
||
*
|
||
* # get help for `core` command
|
||
* wp help core
|
||
*
|
||
* # get help for `core download` subcommand
|
||
* wp help core download
|
||
*/
|
||
public function __invoke($args, $assoc_args)
|
||
{
|
||
}
|
||
private static function show_help($command)
|
||
{
|
||
}
|
||
private static function rewrap_param_desc($matches)
|
||
{
|
||
}
|
||
private static function indent($whitespace, $text)
|
||
{
|
||
}
|
||
private static function pass_through_pager($out)
|
||
{
|
||
}
|
||
private static function get_initial_markdown($command)
|
||
{
|
||
}
|
||
private static function render_subcommands($command)
|
||
{
|
||
}
|
||
private static function get_max_len($strings)
|
||
{
|
||
}
|
||
/**
|
||
* Parse reference links from longdescription.
|
||
*
|
||
* @param string $longdesc The longdescription from the `$command->get_longdesc()`.
|
||
* @return string The longdescription which has links as footnote.
|
||
*/
|
||
private static function parse_reference_links($longdesc)
|
||
{
|
||
}
|
||
}
|
||
}
|
||
namespace WP_CLI {
|
||
/**
|
||
* Get the list of ordered steps that need to be processed to bootstrap WP-CLI.
|
||
*
|
||
* Each entry is a fully qualified class name for a class implementing the
|
||
* `WP_CLI\Bootstrap\BootstrapStep` interface.
|
||
*
|
||
* @return string[]
|
||
*/
|
||
function get_bootstrap_steps()
|
||
{
|
||
}
|
||
/**
|
||
* Register the classes needed for the bootstrap process.
|
||
*
|
||
* The Composer autoloader is not active yet at this point, so we need to use a
|
||
* custom autoloader to fetch the bootstrap classes in a flexible way.
|
||
*/
|
||
function prepare_bootstrap()
|
||
{
|
||
}
|
||
/**
|
||
* Initialize and return the bootstrap state to pass from step to step.
|
||
*
|
||
* @return BootstrapState
|
||
*/
|
||
function initialize_bootstrap_state()
|
||
{
|
||
}
|
||
/**
|
||
* Process the bootstrapping steps.
|
||
*
|
||
* Loops over each of the provided steps, instantiates it and then calls its
|
||
* `process()` method.
|
||
*/
|
||
function bootstrap()
|
||
{
|
||
}
|
||
}
|
||
namespace WP_CLI\Dispatcher {
|
||
/**
|
||
* Get the path to a command, e.g. "core download"
|
||
*
|
||
* @param Subcommand|CompositeCommand $command
|
||
* @return string[]
|
||
*/
|
||
function get_path($command)
|
||
{
|
||
}
|
||
}
|
||
// Utilities that depend on WordPress code.
|
||
namespace WP_CLI\Utils {
|
||
/**
|
||
* @return void
|
||
*/
|
||
function wp_not_installed()
|
||
{
|
||
}
|
||
// phpcs:disable WordPress.PHP.IniSet -- Intentional & correct usage.
|
||
/**
|
||
* @return void
|
||
*/
|
||
function wp_debug_mode()
|
||
{
|
||
}
|
||
// phpcs:enable
|
||
/**
|
||
* @return void
|
||
*/
|
||
function replace_wp_die_handler()
|
||
{
|
||
}
|
||
/**
|
||
* @return never
|
||
*/
|
||
function wp_die_handler($message)
|
||
{
|
||
}
|
||
/**
|
||
* Clean HTML error message so suitable for text display.
|
||
*
|
||
* @param string $message
|
||
* @return string
|
||
*/
|
||
function wp_clean_error_message($message)
|
||
{
|
||
}
|
||
/**
|
||
* @param string $url
|
||
* @return string
|
||
*/
|
||
function wp_redirect_handler($url)
|
||
{
|
||
}
|
||
/**
|
||
* @param string $since Version number.
|
||
* @param string $path File to include.
|
||
* @return void
|
||
*/
|
||
function maybe_require($since, $path)
|
||
{
|
||
}
|
||
/**
|
||
*
|
||
* @param class-string $class_name
|
||
* @param bool $insecure
|
||
*
|
||
* @return \WP_Upgrader Upgrader instance.
|
||
* @throws \ReflectionException
|
||
*/
|
||
function get_upgrader($class_name, $insecure = false)
|
||
{
|
||
}
|
||
/**
|
||
* Converts a plugin basename back into a friendly slug.
|
||
*
|
||
* @param string $basename
|
||
* @return string
|
||
*/
|
||
function get_plugin_name($basename)
|
||
{
|
||
}
|
||
/**
|
||
* Determine whether a plugin is skipped.
|
||
*
|
||
* @param string $file
|
||
* @return bool
|
||
*/
|
||
function is_plugin_skipped($file)
|
||
{
|
||
}
|
||
/**
|
||
* Get theme name from path.
|
||
*
|
||
* @param string $path
|
||
* @return string
|
||
*/
|
||
function get_theme_name($path)
|
||
{
|
||
}
|
||
/**
|
||
* Determine whether a theme is skipped.
|
||
*
|
||
* @param string $path
|
||
* @return bool
|
||
*/
|
||
function is_theme_skipped($path)
|
||
{
|
||
}
|
||
/**
|
||
* Register the sidebar for unused widgets.
|
||
* Core does this in /wp-admin/widgets.php, which isn't helpful.
|
||
*
|
||
* @return void
|
||
*/
|
||
function wp_register_unused_sidebar()
|
||
{
|
||
}
|
||
/**
|
||
* Attempts to determine which object cache is being used.
|
||
*
|
||
* Note that the guesses made by this function are based on the WP_Object_Cache classes
|
||
* that define the 3rd party object cache extension. Changes to those classes could render
|
||
* problems with this function's ability to determine which object cache is being used.
|
||
*
|
||
* @return string
|
||
*/
|
||
function wp_get_cache_type()
|
||
{
|
||
}
|
||
/**
|
||
* Clear WordPress internal object caches.
|
||
*
|
||
* In long-running scripts, the internal caches on `$wp_object_cache` and `$wpdb`
|
||
* can grow to consume gigabytes of memory. Periodically calling this utility
|
||
* can help with memory management.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
* @deprecated 1.5.0
|
||
*
|
||
* @return void
|
||
*/
|
||
function wp_clear_object_cache()
|
||
{
|
||
}
|
||
/**
|
||
* Get a set of tables in the database.
|
||
*
|
||
* Interprets common command-line options into a resolved set of table names.
|
||
*
|
||
* @param array<string> $args Provided table names, or tables with wildcards.
|
||
* @param array<string, string> $assoc_args Optional flags for groups of tables (e.g. --network)
|
||
* @return array<string>
|
||
*/
|
||
function wp_get_table_names($args, $assoc_args = [])
|
||
{
|
||
}
|
||
/**
|
||
* Failsafe use of the WordPress wp_strip_all_tags() function.
|
||
*
|
||
* Automatically falls back to strip_tags() function if the WP function is not
|
||
* available.
|
||
*
|
||
* @param string $string String to strip the tags from.
|
||
* @return string String devoid of tags.
|
||
*/
|
||
function strip_tags($string)
|
||
{
|
||
}
|
||
}
|
||
// Utilities that do NOT depend on WordPress code.
|
||
namespace WP_CLI\Utils {
|
||
/**
|
||
* Check if a certain path is within a Phar archive.
|
||
*
|
||
* If no path is provided, the function checks whether the current WP_CLI instance is
|
||
* running from within a Phar archive.
|
||
*
|
||
* @param string|null $path Optional. Path to check. Defaults to null, which checks WP_CLI_ROOT.
|
||
* @return bool Whether path is within a Phar archive.
|
||
*/
|
||
function inside_phar($path = null)
|
||
{
|
||
}
|
||
/**
|
||
* Extract a file from a Phar archive.
|
||
*
|
||
* Files that need to be read by external programs have to be extracted from the Phar archive.
|
||
* If the file is not within a Phar archive, the function returns the path unchanged.
|
||
*
|
||
* @param string $path Path to the file to extract.
|
||
* @return string Path to the extracted file.
|
||
*/
|
||
function extract_from_phar($path)
|
||
{
|
||
}
|
||
/**
|
||
* Load dependencies.
|
||
*
|
||
* @return void|never
|
||
*/
|
||
function load_dependencies()
|
||
{
|
||
}
|
||
/**
|
||
* Return vendor paths.
|
||
*
|
||
* @return array<string> List of paths.
|
||
*/
|
||
function get_vendor_paths()
|
||
{
|
||
}
|
||
/**
|
||
* Load a file.
|
||
*
|
||
* Using require() directly inside a class grants access
|
||
* to private methods to the loaded code, hence this wrapper helper.
|
||
*
|
||
* @param string $path
|
||
* @return void
|
||
*/
|
||
function load_file($path)
|
||
{
|
||
}
|
||
/**
|
||
* Load a command.
|
||
*
|
||
* @param string $name
|
||
* @return void
|
||
*/
|
||
function load_command($name)
|
||
{
|
||
}
|
||
/**
|
||
* Like array_map(), except it returns a new iterator, instead of a modified array.
|
||
*
|
||
* Example:
|
||
*
|
||
* $arr = array('Football', 'Socker');
|
||
*
|
||
* $it = iterator_map($arr, 'strtolower', function($val) {
|
||
* return str_replace('foo', 'bar', $val);
|
||
* });
|
||
*
|
||
* foreach ( $it as $val ) {
|
||
* var_dump($val);
|
||
* }
|
||
*
|
||
* @param array|object $it Either a plain array or another iterator.
|
||
* @param callable $fn The function to apply to an element.
|
||
* @return object An iterator that applies the given callback(s).
|
||
*/
|
||
function iterator_map($it, $fn)
|
||
{
|
||
}
|
||
/**
|
||
* Search for file by walking up the directory tree until the first file is found or until $stop_check($dir) returns true.
|
||
*
|
||
* @param string|array<string> $files The files (or file) to search for.
|
||
* @param string|null $dir The directory to start searching from; defaults to CWD.
|
||
* @param callable $stop_check Function which is passed the current dir each time a directory level is traversed.
|
||
* @return null|string Null if the file was not found.
|
||
*/
|
||
function find_file_upward($files, $dir = null, $stop_check = null)
|
||
{
|
||
}
|
||
/**
|
||
* Determine whether a path is absolute.
|
||
* @param string $path
|
||
* @return bool
|
||
*/
|
||
function is_path_absolute($path)
|
||
{
|
||
}
|
||
/**
|
||
* Composes positional arguments into a command string.
|
||
*
|
||
* @param array<string> $args Positional arguments to compose.
|
||
* @return string
|
||
*/
|
||
function args_to_str($args)
|
||
{
|
||
}
|
||
/**
|
||
* Composes associative arguments into a command string.
|
||
*
|
||
* @param array<string, string> $assoc_args Associative arguments to compose.
|
||
* @return string
|
||
*/
|
||
function assoc_args_to_str($assoc_args)
|
||
{
|
||
}
|
||
/**
|
||
* Given a template string and an arbitrary number of arguments,
|
||
* returns the final command, with the parameters escaped.
|
||
*
|
||
* @param array<string> $cmd
|
||
*/
|
||
function esc_cmd($cmd)
|
||
{
|
||
}
|
||
/**
|
||
* Gets path to WordPress configuration.
|
||
*
|
||
* @return string
|
||
*/
|
||
function locate_wp_config()
|
||
{
|
||
}
|
||
/**
|
||
* Compare a WordPress version.
|
||
*
|
||
* @param string $since
|
||
* @param string $operator
|
||
* @return bool
|
||
*/
|
||
function wp_version_compare($since, $operator)
|
||
{
|
||
}
|
||
/**
|
||
* Render a collection of items as an ASCII table, JSON, CSV, YAML, list of ids, or count.
|
||
*
|
||
* Given a collection of items with a consistent data structure:
|
||
*
|
||
* ```
|
||
* $items = array(
|
||
* array(
|
||
* 'key' => 'foo',
|
||
* 'value' => 'bar',
|
||
* )
|
||
* );
|
||
* ```
|
||
*
|
||
* Render `$items` as an ASCII table:
|
||
*
|
||
* ```
|
||
* WP_CLI\Utils\format_items( 'table', $items, array( 'key', 'value' ) );
|
||
*
|
||
* # +-----+-------+
|
||
* # | key | value |
|
||
* # +-----+-------+
|
||
* # | foo | bar |
|
||
* # +-----+-------+
|
||
* ```
|
||
*
|
||
* Or render `$items` as YAML:
|
||
*
|
||
* ```
|
||
* WP_CLI\Utils\format_items( 'yaml', $items, array( 'key', 'value' ) );
|
||
*
|
||
* # ---
|
||
* # -
|
||
* # key: foo
|
||
* # value: bar
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string $format Format to use: 'table', 'json', 'csv', 'yaml', 'ids', 'count'.
|
||
* @param array<mixed> $items An array of items to output.
|
||
* @param array<string>|string $fields Named fields for each item of data. Can be array or comma-separated list.
|
||
*/
|
||
function format_items($format, $items, $fields)
|
||
{
|
||
}
|
||
/**
|
||
* Write data as CSV to a given file.
|
||
*
|
||
* @access public
|
||
*
|
||
* @param resource $fd File descriptor.
|
||
* @param array<string> $rows Array of rows to output.
|
||
* @param array<string> $headers List of CSV columns (optional).
|
||
*/
|
||
function write_csv($fd, $rows, $headers = [])
|
||
{
|
||
}
|
||
/**
|
||
* Pick fields from an associative array or object.
|
||
*
|
||
* @param array<string, mixed>|object $item Associative array or object to pick fields from.
|
||
* @param array<string> $fields List of fields to pick.
|
||
* @return array<string, mixed>
|
||
*/
|
||
function pick_fields($item, $fields)
|
||
{
|
||
}
|
||
/**
|
||
* Launch system's $EDITOR for the user to edit some text.
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param string $input Some form of text to edit (e.g. post content).
|
||
* @param string $title Title to display in the editor.
|
||
* @param string $ext Extension to use with the temp file.
|
||
* @return string|bool Edited text, if file is saved from editor; false, if no change to file.
|
||
*/
|
||
function launch_editor_for_input($input, $title = 'WP-CLI', $ext = 'tmp')
|
||
{
|
||
}
|
||
/**
|
||
* @param string $raw_host MySQL host string, as defined in wp-config.php.
|
||
*
|
||
* @return array<string, string|int>
|
||
*/
|
||
function mysql_host_to_cli_args($raw_host)
|
||
{
|
||
}
|
||
/**
|
||
* Run a MySQL command and optionally return the output.
|
||
*
|
||
* @since v2.5.0 Deprecated $descriptors argument.
|
||
*
|
||
* @param string $cmd Command to run.
|
||
* @param array<string, mixed> $assoc_args Associative array of arguments to use.
|
||
* @param mixed $_ Deprecated. Former $descriptors argument.
|
||
* @param bool $send_to_shell Optional. Whether to send STDOUT and STDERR
|
||
* immediately to the shell. Defaults to true.
|
||
* @param bool $interactive Optional. Whether MySQL is meant to be
|
||
* executed as an interactive process. Defaults
|
||
* to false.
|
||
*
|
||
* @return array {
|
||
* Associative array containing STDOUT and STDERR output.
|
||
*
|
||
* @type string $stdout Output that was sent to STDOUT.
|
||
* @type string $stderr Output that was sent to STDERR.
|
||
* @type int $exit_code Exit code of the process.
|
||
* }
|
||
*/
|
||
function run_mysql_command($cmd, $assoc_args, $_ = null, $send_to_shell = true, $interactive = false)
|
||
{
|
||
}
|
||
/**
|
||
* Render PHP or other types of files using Mustache templates.
|
||
*
|
||
* IMPORTANT: Automatic HTML escaping is disabled!
|
||
*
|
||
* @param string $template_name
|
||
* @param array<string, mixed> $data
|
||
*/
|
||
function mustache_render($template_name, $data = [])
|
||
{
|
||
}
|
||
/**
|
||
* Create a progress bar to display percent completion of a given operation.
|
||
*
|
||
* Progress bar is written to STDOUT, and disabled when command is piped. Progress
|
||
* advances with `$progress->tick()`, and completes with `$progress->finish()`.
|
||
* Process bar also indicates elapsed time and expected total time.
|
||
*
|
||
* ```
|
||
* # `wp user generate` ticks progress bar each time a new user is created.
|
||
* #
|
||
* # $ wp user generate --count=500
|
||
* # Generating users 22 % [=======> ] 0:05 / 0:23
|
||
*
|
||
* $progress = \WP_CLI\Utils\make_progress_bar( 'Generating users', $count );
|
||
* for ( $i = 0; $i < $count; $i++ ) {
|
||
* // uses wp_insert_user() to insert the user
|
||
* $progress->tick();
|
||
* }
|
||
* $progress->finish();
|
||
* ```
|
||
*
|
||
* @access public
|
||
* @category Output
|
||
*
|
||
* @param string $message Text to display before the progress bar.
|
||
* @param integer $count Total number of ticks to be performed.
|
||
* @param int $interval Optional. The interval in milliseconds between updates. Default 100.
|
||
* @return \cli\progress\Bar|\WP_CLI\NoOp
|
||
*/
|
||
function make_progress_bar($message, $count, $interval = 100)
|
||
{
|
||
}
|
||
/**
|
||
* Helper function to use wp_parse_url when available or fall back to PHP's
|
||
* parse_url if not.
|
||
*
|
||
* Additionally, this adds 'http://' to the URL if no scheme was found.
|
||
*
|
||
* @param string $url The URL to parse.
|
||
* @param int $component Optional. The specific component to retrieve.
|
||
* Use one of the PHP predefined constants to
|
||
* specify which one. Defaults to -1 (= return
|
||
* all parts as an array).
|
||
* @param bool $auto_add_scheme Optional. Automatically add an http:// scheme if
|
||
* none was found. Defaults to true.
|
||
* @return mixed False on parse failure; Array of URL components on success;
|
||
* When a specific component has been requested: null if the
|
||
* component doesn't exist in the given URL; a string or - in the
|
||
* case of PHP_URL_PORT - integer when it does. See parse_url()'s
|
||
* return values.
|
||
*/
|
||
function parse_url($url, $component = -1, $auto_add_scheme = true)
|
||
{
|
||
}
|
||
/**
|
||
* Check if we're running in a Windows environment (cmd.exe).
|
||
*
|
||
* @return bool
|
||
*/
|
||
function is_windows()
|
||
{
|
||
}
|
||
/**
|
||
* Replace magic constants in some PHP source code.
|
||
*
|
||
* Replaces the __FILE__ and __DIR__ magic constants with the values they are
|
||
* supposed to represent at runtime.
|
||
*
|
||
* @param string $source The PHP code to manipulate.
|
||
* @param string $path The path to use instead of the magic constants.
|
||
* @return string Adapted PHP code.
|
||
*/
|
||
function replace_path_consts($source, $path)
|
||
{
|
||
}
|
||
/**
|
||
* Make a HTTP request to a remote URL.
|
||
*
|
||
* Wraps the Requests HTTP library to ensure every request includes a cert.
|
||
*
|
||
* ```
|
||
* # `wp core download` verifies the hash for a downloaded WordPress archive
|
||
*
|
||
* $md5_response = Utils\http_request( 'GET', $download_url . '.md5' );
|
||
* if ( 20 != substr( $md5_response->status_code, 0, 2 ) ) {
|
||
* WP_CLI::error( "Couldn't access md5 hash for release (HTTP code {$response->status_code})" );
|
||
* }
|
||
* ```
|
||
*
|
||
* @access public
|
||
*
|
||
* @param string $method HTTP method (GET, POST, DELETE, etc.).
|
||
* @param string $url URL to make the HTTP request to.
|
||
* @param array|null $data Data to send either as a query string for GET/HEAD requests,
|
||
* or in the body for POST requests.
|
||
* @param array $headers Add specific headers to the request.
|
||
* @param array $options {
|
||
* Optional. An associative array of additional request options.
|
||
*
|
||
* @type bool $halt_on_error Whether or not command execution should be halted on error. Default: true
|
||
* @type bool|string $verify A boolean to use enable/disable SSL verification
|
||
* or string absolute path to CA cert to use.
|
||
* Defaults to detected CA cert bundled with the Requests library.
|
||
* @type bool $insecure Whether to retry automatically without certificate validation.
|
||
* }
|
||
* @return object
|
||
* @throws RuntimeException If the request failed.
|
||
* @throws ExitException If the request failed and $halt_on_error is true.
|
||
*/
|
||
function http_request($method, $url, $data = null, $headers = [], $options = [])
|
||
{
|
||
}
|
||
/**
|
||
* Gets the full path to the default CA cert.
|
||
*
|
||
* @param bool $halt_on_error Whether or not command execution should be halted on error. Default: false
|
||
* @return string Absolute path to the default CA cert.
|
||
* @throws RuntimeException If unable to locate the cert.
|
||
* @throws ExitException If unable to locate the cert and $halt_on_error is true.
|
||
*/
|
||
function get_default_cacert($halt_on_error = false)
|
||
{
|
||
}
|
||
/**
|
||
* Increments a version string using the "x.y.z-pre" format.
|
||
*
|
||
* Can increment the major, minor or patch number by one.
|
||
* If $new_version == "same" the version string is not changed.
|
||
* If $new_version is not a known keyword, it will be used as the new version string directly.
|
||
*
|
||
* @param string $current_version
|
||
* @param string $new_version
|
||
* @return string
|
||
*/
|
||
function increment_version($current_version, $new_version)
|
||
{
|
||
}
|
||
/**
|
||
* Compare two version strings to get the named semantic version.
|
||
*
|
||
* @access public
|
||
*
|
||
* @param string $new_version
|
||
* @param string $original_version
|
||
* @return string 'major', 'minor', 'patch'
|
||
*/
|
||
function get_named_sem_ver($new_version, $original_version)
|
||
{
|
||
}
|
||
/**
|
||
* Return the flag value or, if it's not set, the $default value.
|
||
*
|
||
* Because flags can be negated (e.g. --no-quiet to negate --quiet), this
|
||
* function provides a safer alternative to using
|
||
* `isset( $assoc_args['quiet'] )` or similar.
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param array<string,string|bool> $assoc_args Arguments array.
|
||
* @param string $flag Flag to get the value.
|
||
* @param mixed $default Default value for the flag. Default: NULL.
|
||
* @return mixed
|
||
*/
|
||
function get_flag_value($assoc_args, $flag, $default = null)
|
||
{
|
||
}
|
||
/**
|
||
* Get the home directory.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
*
|
||
* @return string
|
||
*/
|
||
function get_home_dir()
|
||
{
|
||
}
|
||
/**
|
||
* Appends a trailing slash.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
*
|
||
* @param string $string What to add the trailing slash to.
|
||
* @return string String with trailing slash added.
|
||
*/
|
||
function trailingslashit($string)
|
||
{
|
||
}
|
||
/**
|
||
* Normalize a filesystem path.
|
||
*
|
||
* On Windows systems, replaces backslashes with forward slashes
|
||
* and forces upper-case drive letters.
|
||
* Allows for two leading slashes for Windows network shares, but
|
||
* ensures that all other duplicate slashes are reduced to a single one.
|
||
* Ensures upper-case drive letters on Windows systems.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
*
|
||
* @param string $path Path to normalize.
|
||
* @return string Normalized path.
|
||
*/
|
||
function normalize_path($path)
|
||
{
|
||
}
|
||
/**
|
||
* Convert Windows EOLs to *nix.
|
||
*
|
||
* @param string $str String to convert.
|
||
* @return string String with carriage return / newline pairs reduced to newlines.
|
||
*/
|
||
function normalize_eols($str)
|
||
{
|
||
}
|
||
/**
|
||
* Get the system's temp directory. Warns user if it isn't writable.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
*
|
||
* @return string
|
||
*/
|
||
function get_temp_dir()
|
||
{
|
||
}
|
||
/**
|
||
* Parse a SSH url for its host, port, and path.
|
||
*
|
||
* Similar to parse_url(), but adds support for defined SSH aliases.
|
||
*
|
||
* ```
|
||
* host OR host/path/to/wordpress OR host:port/path/to/wordpress
|
||
* ```
|
||
*
|
||
* @access public
|
||
*
|
||
* @param string $url
|
||
* @param int $component
|
||
* @return mixed
|
||
*/
|
||
function parse_ssh_url($url, $component = -1)
|
||
{
|
||
}
|
||
/**
|
||
* Report the results of the same operation against multiple resources.
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param string $noun Resource being affected (e.g. plugin).
|
||
* @param string $verb Type of action happening to the noun (e.g. activate).
|
||
* @param integer $total Total number of resource being affected.
|
||
* @param integer $successes Number of successful operations.
|
||
* @param integer $failures Number of failures.
|
||
* @param null|integer $skips Optional. Number of skipped operations. Default null (don't show skips).
|
||
* @return void
|
||
*/
|
||
function report_batch_operation_results($noun, $verb, $total, $successes, $failures, $skips = null)
|
||
{
|
||
}
|
||
/**
|
||
* Parse a string of command line arguments into an $argv-esqe variable.
|
||
*
|
||
* @access public
|
||
* @category Input
|
||
*
|
||
* @param string $arguments
|
||
* @return array<string>
|
||
*/
|
||
function parse_str_to_argv($arguments)
|
||
{
|
||
}
|
||
/**
|
||
* Locale-independent version of basename()
|
||
*
|
||
* @access public
|
||
*
|
||
* @param string $path
|
||
* @param string $suffix
|
||
* @return string
|
||
*/
|
||
function basename($path, $suffix = '')
|
||
{
|
||
}
|
||
/**
|
||
* Checks whether the output of the current script is a TTY or a pipe / redirect
|
||
*
|
||
* 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 on its
|
||
* value. Strings like `1`, `0`, `yes`, `no`, that validate to booleans are accepted.
|
||
*
|
||
* To enable ASCII formatting even when the shell is piped, use the
|
||
* ENV variable `SHELL_PIPE=0`.
|
||
* ```
|
||
* SHELL_PIPE=0 wp plugin list | cat
|
||
* ```
|
||
*
|
||
* Note that the db command forwards to the mysql client, which is unaware of the env
|
||
* variable. For db commands, pass the `--table` option instead.
|
||
* ```
|
||
* wp db query --table "SELECT 1" | cat
|
||
* ```
|
||
*
|
||
* @access public
|
||
*
|
||
* @return bool
|
||
*/
|
||
function isPiped()
|
||
{
|
||
}
|
||
/**
|
||
* Expand within paths to their matching paths.
|
||
*
|
||
* Has no effect on paths which do not use glob patterns.
|
||
*
|
||
* @param string|array<string> $paths Single path as a string, or an array of paths.
|
||
* @param int|'default' $flags Optional. Flags to pass to glob. Defaults to GLOB_BRACE.
|
||
* @return array<string> Expanded paths.
|
||
*/
|
||
function expand_globs($paths, $flags = 'default')
|
||
{
|
||
}
|
||
/**
|
||
* Simulate a `glob()` with the `GLOB_BRACE` flag set. For systems (eg Alpine Linux) built against a libc library (eg https://www.musl-libc.org/) that lacks it.
|
||
* Copied and adapted from Zend Framework's `Glob::fallbackGlob()` and Glob::nextBraceSub()`.
|
||
*
|
||
* Zend Framework (https://framework.zend.com/)
|
||
*
|
||
* @link https://github.com/zendframework/zf2 for the canonical source repository
|
||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (https://www.zend.com)
|
||
* @license https://framework.zend.com/license/new-bsd New BSD License
|
||
*
|
||
* @param string $pattern Filename pattern.
|
||
* @param void $dummy_flags Not used.
|
||
* @return array<string> Array of paths.
|
||
*/
|
||
function glob_brace($pattern, $dummy_flags = null)
|
||
{
|
||
}
|
||
/**
|
||
* Get the closest suggestion for a mistyped target term amongst a list of
|
||
* options.
|
||
*
|
||
* Uses the Levenshtein algorithm to calculate the relative "distance" between
|
||
* terms.
|
||
*
|
||
* If the "distance" to the closest term is higher than the threshold, an empty
|
||
* string is returned.
|
||
*
|
||
* @param string $target Target term to get a suggestion for.
|
||
* @param array<string> $options Array with possible options.
|
||
* @param int $threshold Threshold above which to return an empty string.
|
||
* @return string
|
||
*/
|
||
function get_suggestion($target, array $options, $threshold = 2)
|
||
{
|
||
}
|
||
/**
|
||
* Get a Phar-safe version of a path.
|
||
*
|
||
* For paths inside a Phar, this strips the outer filesystem's location to
|
||
* reduce the path to what it needs to be within the Phar archive.
|
||
*
|
||
* Use the __FILE__ or __DIR__ constants as a starting point.
|
||
*
|
||
* @param string $path An absolute path that might be within a Phar.
|
||
* @return string A Phar-safe version of the path.
|
||
*/
|
||
function phar_safe_path($path)
|
||
{
|
||
}
|
||
/**
|
||
* Maybe prefix command string with "/usr/bin/env".
|
||
* Removes (if there) if Windows, adds (if not there) if not.
|
||
*
|
||
* @param string $command
|
||
* @return string
|
||
*/
|
||
function force_env_on_nix_systems($command)
|
||
{
|
||
}
|
||
/**
|
||
* Check that `proc_open()` and `proc_close()` haven't been disabled.
|
||
*
|
||
* @param string $context Optional. If set will appear in error message. Default null.
|
||
* @param bool $return Optional. If set will return false rather than error out. Default false.
|
||
* @return bool
|
||
*/
|
||
function check_proc_available($context = null, $return = false)
|
||
{
|
||
}
|
||
/**
|
||
* Returns past tense of verb, with limited accuracy. Only regular verbs catered for, apart from "reset".
|
||
*
|
||
* @param string $verb Verb to return past tense of.
|
||
* @return string
|
||
*/
|
||
function past_tense_verb($verb)
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the PHP binary used when executing WP-CLI.
|
||
*
|
||
* Environment values permit specific binaries to be indicated.
|
||
*
|
||
* @access public
|
||
* @category System
|
||
*
|
||
* @return string
|
||
*/
|
||
function get_php_binary()
|
||
{
|
||
}
|
||
/**
|
||
* Windows compatible `proc_open()`.
|
||
* Works around bug in PHP, and also deals with *nix-like `ENV_VAR=blah cmd` environment variable prefixes.
|
||
*
|
||
* @access public
|
||
*
|
||
* @param string $cmd Command to execute.
|
||
* @param array<int, string> $descriptorspec Indexed array of descriptor numbers and their values.
|
||
* @param array<int, string> &$pipes Indexed array of file pointers that correspond to PHP's end of any pipes that are created.
|
||
* @param string $cwd Initial working directory for the command.
|
||
* @param array<string, string> $env Array of environment variables.
|
||
* @param array<string> $other_options Array of additional options (Windows only).
|
||
* @return resource Command stripped of any environment variable settings.
|
||
*/
|
||
function proc_open_compat($cmd, $descriptorspec, &$pipes, $cwd = null, $env = null, $other_options = null)
|
||
{
|
||
}
|
||
/**
|
||
* For use by `proc_open_compat()` only. Separated out for ease of testing. Windows only.
|
||
* Turns *nix-like `ENV_VAR=blah command` environment variable prefixes into stripped `cmd` with prefixed environment variables added to passed in environment array.
|
||
*
|
||
* @access private
|
||
*
|
||
* @param string $cmd Command to execute.
|
||
* @param array<string, string> &$env Array of existing environment variables. Will be modified if any settings in command.
|
||
* @return string Command stripped of any environment variable settings.
|
||
*/
|
||
function _proc_open_compat_win_env($cmd, &$env)
|
||
{
|
||
}
|
||
/**
|
||
* First half of escaping for LIKE special characters % and _ before preparing for MySQL.
|
||
*
|
||
* Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security.
|
||
*
|
||
* Copied from core "wp-includes/wp-db.php". Avoids dependency on WP 4.4 wpdb.
|
||
*
|
||
* @access public
|
||
*
|
||
* @param string $text The raw text to be escaped. The input typed by the user should have no
|
||
* extra or deleted slashes.
|
||
* @return string Text in the form of a LIKE phrase. The output is not SQL safe. Call $wpdb::prepare()
|
||
* or real_escape next.
|
||
*/
|
||
function esc_like($text)
|
||
{
|
||
}
|
||
/**
|
||
* Escapes (backticks) MySQL identifiers (aka schema object names) - i.e. column names, table names, and database/index/alias/view etc names.
|
||
* See https://dev.mysql.com/doc/refman/5.5/en/identifiers.html
|
||
*
|
||
* @param string|array<string> $idents A single identifier or an array of identifiers.
|
||
* @return string|array<string> An escaped string if given a string, or an array of escaped strings if given an array of strings.
|
||
*/
|
||
function esc_sql_ident($idents)
|
||
{
|
||
}
|
||
/**
|
||
* Check whether a given string is a valid JSON representation.
|
||
*
|
||
* @param string $argument String to evaluate.
|
||
* @param bool $ignore_scalars Optional. Whether to ignore scalar values.
|
||
* Defaults to true.
|
||
* @return bool Whether the provided string is a valid JSON representation.
|
||
*/
|
||
function is_json($argument, $ignore_scalars = true)
|
||
{
|
||
}
|
||
/**
|
||
* Parse known shell arrays included in the $assoc_args array.
|
||
*
|
||
* @param array<string, string> $assoc_args Associative array of arguments.
|
||
* @param array<string> $array_arguments Array of argument keys that should receive an
|
||
* array through the shell.
|
||
* @return array<string, string>
|
||
*/
|
||
function parse_shell_arrays($assoc_args, $array_arguments)
|
||
{
|
||
}
|
||
/**
|
||
* Describe a callable as a string.
|
||
*
|
||
* @param callable $callable The callable to describe.
|
||
* @return string String description of the callable.
|
||
*/
|
||
function describe_callable($callable)
|
||
{
|
||
}
|
||
/**
|
||
* Checks if the given class and method pair is a valid callable.
|
||
*
|
||
* This accommodates changes to `is_callable()` in PHP 8 that mean an array of a
|
||
* classname and instance method is no longer callable.
|
||
*
|
||
* @param array<string> $pair The class and method pair to check.
|
||
* @return bool
|
||
*/
|
||
function is_valid_class_and_method_pair($pair)
|
||
{
|
||
}
|
||
/**
|
||
* Pluralizes a noun in a grammatically correct way.
|
||
*
|
||
* @param string $noun Noun to be pluralized. Needs to be in singular form.
|
||
* @param int|null $count Optional. Count of the nouns, to decide whether to
|
||
* pluralize. Will pluralize unconditionally if none
|
||
* provided.
|
||
* @return string Pluralized noun.
|
||
*/
|
||
function pluralize($noun, $count = null)
|
||
{
|
||
}
|
||
/**
|
||
* Return the detected database type.
|
||
*
|
||
* Can be either 'sqlite' (if in a WordPress installation with the SQLite drop-in),
|
||
* 'mysql', or 'mariadb'.
|
||
*
|
||
* @return string Database type.
|
||
*/
|
||
function get_db_type()
|
||
{
|
||
}
|
||
/**
|
||
* Get the path to the MySQL or MariaDB binary.
|
||
*
|
||
* If the MySQL binary is provided by MariaDB (as determined by the version string),
|
||
* prefers the actual MariaDB binary.
|
||
*
|
||
* @since 2.12.0 Now also checks for MariaDB.
|
||
*
|
||
* @return string Path to the MySQL/MariaDB binary, or an empty string if not found.
|
||
*/
|
||
function get_mysql_binary_path()
|
||
{
|
||
}
|
||
/**
|
||
* Get the version of the MySQL or MariaDB database.
|
||
*
|
||
* @since 2.12.0 Now also checks for MariaDB.
|
||
*
|
||
* @return string Version of the MySQL/MariaDB database,
|
||
* or an empty string if not found.
|
||
*/
|
||
function get_mysql_version()
|
||
{
|
||
}
|
||
/**
|
||
* Returns the correct `dump` command based on the detected database type.
|
||
*
|
||
* @return string The appropriate dump command.
|
||
*/
|
||
function get_sql_dump_command()
|
||
{
|
||
}
|
||
/**
|
||
* Returns the correct `check` command based on the detected database type.
|
||
*
|
||
* @return string The appropriate check command.
|
||
*/
|
||
function get_sql_check_command()
|
||
{
|
||
}
|
||
/**
|
||
* Get the SQL modes of the MySQL session.
|
||
*
|
||
* @return string[] Array of SQL modes, or an empty array if they couldn't be
|
||
* read.
|
||
*/
|
||
function get_sql_modes()
|
||
{
|
||
}
|
||
/**
|
||
* Get the WP-CLI cache directory.
|
||
*
|
||
* @return string
|
||
*/
|
||
function get_cache_dir()
|
||
{
|
||
}
|
||
/**
|
||
* Check whether any input is passed to STDIN.
|
||
*
|
||
* @return bool
|
||
*/
|
||
function has_stdin()
|
||
{
|
||
}
|
||
/**
|
||
* Return description of WP_CLI hooks used in @when tag
|
||
*
|
||
* @param string $hook Name of WP_CLI hook
|
||
*
|
||
* @return string|null
|
||
*/
|
||
function get_hook_description($hook)
|
||
{
|
||
}
|
||
/**
|
||
* Escape a value for CSV output.
|
||
*
|
||
* Values that start with the following characters are escaping with a single
|
||
* quote: =, +, -, @, TAB (0x09) and CR (0x0D).
|
||
*
|
||
* @param string $value Value to escape.
|
||
* @return string Escaped value.
|
||
*/
|
||
function escape_csv_value($value)
|
||
{
|
||
}
|
||
} |