CLI_Alias_Command::validate_config_file()privateWP-CLI 1.0

Check if the config file exists and is writable.

Метод класса: CLI_Alias_Command{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->validate_config_file( $config_path );
$config_path(строка) (обязательный)
Path to config file.

Код CLI_Alias_Command::validate_config_file() WP-CLI 2.8.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}" );
	}
}