CLI_Alias_Command::validate_config_file
Check if the config file exists and is writable.
Method of the class: CLI_Alias_Command{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->validate_config_file( $config_path );
- $config_path(string) (required)
- Path to config file.
CLI_Alias_Command::validate_config_file() CLI Alias Command::validate config file code WP-CLI 2.13.0-alpha
private function validate_config_file( $config_path ) {
if ( ! file_exists( $config_path ) || ! is_writable( $config_path ) ) {
WP_CLI::error( "Config file does not exist: {$config_path}" );
}
}