1 backup.config.inc | public static BackupConfig::applies($target) |
Determine if this backup source should be used for a particular target.
This method needs to be implemented by all Backup classes. Up until PHP 7, static methods could not be made abstract. Once PHP 7 is the minimum requirement, this should be made abstract and the function body removed.
Parameters
string $target: The target from which a backup will be created (or restored to). Examples are "db:default" or "config:active".
Return value
boolean:
Overrides Backup::applies
File
- core/
includes/ backup/ backup.config.inc, line 67 - Contains the Backup base class.
Class
- BackupConfig
- Base class for creating backups.
Code
public static function applies($target) {
list($target_type, $target_name) = explode(':', $target, 2);
if ($target_type === 'config') {
$storage = config_get_config_storage($target_name);
if (is_a($storage, 'ConfigFileStorage')) {
return TRUE;
}
}
return FALSE;
}