You are here

function _backup_migrate_get_sql_file_header in Backup and Migrate 5

Same name and namespace in other branches
  1. 5.2 includes/db.inc \_backup_migrate_get_sql_file_header()
  2. 6 backup_migrate.module \_backup_migrate_get_sql_file_header()

The header for the top of the sql dump file. These commands set the connection character encoding to help prevent encoding conversion issues.

2 calls to _backup_migrate_get_sql_file_header()
BackupMigrateUnitTest::testGetSQLHeader in tests/BackupMigrateUnitTest.test
_backup_migrate_get_dump_sql in ./backup_migrate.module
Get the sql dump file. Returns a list of sql commands, one command per line. That makes it easier to import without loading the whole file into memory. The files are a little harder to read, but human-readability is not a priority

File

./backup_migrate.module, line 660
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (f.e. cache_*)

Code

function _backup_migrate_get_sql_file_header() {
  return "\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;\n\nSET NAMES utf8;\n";
}