You are here

function backup_migrate_destination_db::lock_tables in Backup and Migrate 8.2

Same name and namespace in other branches
  1. 8.3 includes/destinations.db.inc \backup_migrate_destination_db::lock_tables()
  2. 6.2 includes/destinations.db.inc \backup_migrate_destination_db::lock_tables()
  3. 7.3 includes/destinations.db.inc \backup_migrate_destination_db::lock_tables()
  4. 7.2 includes/destinations.db.inc \backup_migrate_destination_db::lock_tables()

Lock the database in anticipation of a backup.

File

includes/destinations.db.inc, line 259
Functions to handle the direct to database destination.

Class

backup_migrate_destination_db
A destination type for saving to a database server.

Code

function lock_tables($settings) {
  if ($settings->filters['utils_lock_tables']) {
    $tables = array();
    foreach ($this
      ->get_table_names() as $table) {

      // There's no need to lock excluded or structure only tables because it doesn't matter if they change.
      if (empty($settings->filters['exclude_tables']) || !in_array($table, (array) $settings->filters['exclude_tables'])) {
        $tables[] = $table;
      }
    }
    $this
      ->_lock_tables($tables);
  }
}