1 backup.mysql.inc protected BackupMySql::lockTables()

Lock the database in anticipation of a backup.

Overrides BackupDatabase::lockTables

File

core/includes/backup/backup.mysql.inc, line 208
Contains the BackupMySQL class.

Class

BackupMySql
Creates and restores backups from a MySQL database source.

Code

protected function lockTables() {
  $tables = $this->getLockedTables();
  if ($tables) {
    $tables_escaped = array();
    foreach ($tables as $table) {
      $tables_escaped[] = '`' . db_escape_table($table) . '` WRITE';
    }
    $this->query('LOCK TABLES ' . implode(', ', $tables_escaped));
  }
}