1 backup.mysql.inc | public static BackupMySql::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.mysql.inc, line 68 - Contains the BackupMySQL class.
Class
- BackupMySql
- Creates and restores backups from a MySQL database source.
Code
public static function applies($target) {
list($target_type, $target_key) = explode(':', $target, 2);
if ($target_type === 'db') {
$connection = Database::getConnection($target_key);
return $connection->driver() === 'mysql';
}
return FALSE;
}