CLI_Alias_Command::validate_config_file()privateWP-CLI 1.0

Check if the config file exists and is writable.

Method of the class: CLI_Alias_Command{}

No Hooks.

Return

null. Nothing.

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() code WP-CLI 2.7.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}" );
	}
}