PHP Class WP_CLI\Configurator

Afficher le fichier Open project: wp-cli/wp-cli Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $path )
extract_assoc ( $arguments ) : array(array) Splits positional args from associative args.
get_aliases ( ) : array Get any aliases defined in config files.
get_spec ( ) : array Get configuration specification, i.e. list of accepted keys.
merge_array ( array $config ) Merge an array of values into the configurator config.
merge_yml ( string $path, $current_alias = null ) Load a YAML file of parameters into scope.
parse_args ( $arguments ) : array(array) Splits a list of arguments into positional, associative and config.
to_array ( ) : array Get declared configuration values as an array.

Private Methods

Méthode Description
absolutize ( string &$path, string $base ) Make a path absolute.
arrayify ( mixed &$val ) Conform a variable to an array.
assoc_arg_to_runtime_config ( $key, $value, &$runtime_config ) Handle turning an $assoc_arg into a runtime arg.
load_yml ( string $yml_file ) : array Load values from a YAML file.
unmix_assoc_args ( array $mixed_args, $global_assoc = [], $local_assoc = [] ) : array Separate runtime parameters from command-specific parameters.

Method Details

__construct() public méthode

public __construct ( string $path )
$path string Path to config spec file.

extract_assoc() public static méthode

Splits positional args from associative args.
public static extract_assoc ( $arguments ) : array(array)
Résultat array(array)

get_aliases() public méthode

Get any aliases defined in config files.
public get_aliases ( ) : array
Résultat array

get_spec() public méthode

Get configuration specification, i.e. list of accepted keys.
public get_spec ( ) : array
Résultat array

merge_array() public méthode

Merge an array of values into the configurator config.
public merge_array ( array $config )
$config array

merge_yml() public méthode

Load a YAML file of parameters into scope.
public merge_yml ( string $path, $current_alias = null )
$path string Path to YAML file.

parse_args() public méthode

Splits a list of arguments into positional, associative and config.
public parse_args ( $arguments ) : array(array)
Résultat array(array)

to_array() public méthode

Get declared configuration values as an array.
public to_array ( ) : array
Résultat array