You are here

function backup_migrate_source_db_mysql::_get_sql_file_header in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/sources.db.mysql.inc \backup_migrate_source_db_mysql::_get_sql_file_header()
  2. 7.3 includes/sources.db.mysql.inc \backup_migrate_source_db_mysql::_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.

1 call to backup_migrate_source_db_mysql::_get_sql_file_header()
backup_migrate_source_db_mysql::_backup_db_to_file in includes/sources.db.mysql.inc
Backup the databases to a file.

File

includes/sources.db.mysql.inc, line 340
Functions to handle the direct to database source.

Class

backup_migrate_source_db_mysql
A source type for backing up from database server.

Code

function _get_sql_file_header() {
  $info = $this
    ->_db_info();
  return "-- Backup and Migrate (Drupal) MySQL Dump\n-- Backup and Migrate Version: " . BACKUP_MIGRATE_VERSION . "\n-- http://drupal.org/project/backup_migrate\n-- Drupal Version: " . VERSION . "\n-- http://drupal.org/\n--\n-- Host: " . url('', array(
    'absolute' => TRUE,
  )) . "\n-- Site Name: " . url('', array(
    'absolute' => TRUE,
  )) . "\n-- Generation Time: " . format_date(time(), 'custom', 'r') . "\n-- MySQL Version: " . $info['version'] . "\n\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 SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";\nSET NAMES utf8;\n\n";
}