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

The header for the top of the SQL dump file.

These commands set the connection character encoding to help prevent encoding conversion issues.

Note some versions of MySQL are sensitive to the spacing in the dump file. Do not add indents or remove empty lines.

File

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

Class

BackupMySql
Creates and restores backups from a MySQL database source.

Code

protected function getSqlFileHeader() {
  $info = $this->databaseInfo();

  return "-- Backdrop MySQL Dump
-- Backdrop Version: " . BACKDROP_VERSION . "
-- http://backdropcms.org/
--
-- Host: " . url('', array('absolute' => TRUE)) . "
-- Site Name: " . url('', array('absolute' => TRUE)) . "
-- Generation Time: " . format_date(time(), 'custom', 'r') . "
-- MySQL Version: " . $info['version'] . "

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;

SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";
SET NAMES utf8;

";
}