Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions src/Foundation/Mysqldump.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ private function getViewStructureTable($viewName)
{
if (!$this->dumpSettings['skip-comments']) {
$ret = "--" . PHP_EOL .
"-- Stand-In structure for view `${viewName}`" . PHP_EOL .
"-- Stand-In structure for view `{$viewName}`" . PHP_EOL .
"--" . PHP_EOL . PHP_EOL;
$this->compressManager->write($ret);
}
Expand Down Expand Up @@ -824,7 +824,7 @@ public function createStandInTable($viewName)
{
$ret = array();
foreach ($this->tableColumnTypes[$viewName] as $k => $v) {
$ret[] = "`${k}` ${v['type_sql']}";
$ret[] = "`{$k}` {$v['type_sql']}";
}
$ret = implode(PHP_EOL . ",", $ret);

Expand All @@ -845,7 +845,7 @@ private function getViewStructureView($viewName)
{
if (!$this->dumpSettings['skip-comments']) {
$ret = "--" . PHP_EOL .
"-- View structure for view `${viewName}`" . PHP_EOL .
"-- View structure for view `{$viewName}`" . PHP_EOL .
"--" . PHP_EOL . PHP_EOL;
$this->compressManager->write($ret);
}
Expand Down Expand Up @@ -968,7 +968,7 @@ private function escape($colValue, $colType)
return "NULL";
} elseif ($this->dumpSettings['hex-blob'] && $colType['is_blob']) {
if ($colType['type'] == 'bit' || !empty($colValue)) {
return "0x${colValue}";
return "0x{$colValue}";
} else {
return "''";
}
Expand Down Expand Up @@ -1201,14 +1201,14 @@ public function getColumnStmt($tableName)
$colStmt = array();
foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
if ($colType['type'] == 'bit' && $this->dumpSettings['hex-blob']) {
$colStmt[] = "LPAD(HEX(`${colName}`),2,'0') AS `${colName}`";
$colStmt[] = "LPAD(HEX(`{$colName}`),2,'0') AS `{$colName}`";
} elseif ($colType['is_blob'] && $this->dumpSettings['hex-blob']) {
$colStmt[] = "HEX(`${colName}`) AS `${colName}`";
$colStmt[] = "HEX(`{$colName}`) AS `{$colName}`";
} elseif ($colType['is_virtual']) {
$this->dumpSettings['complete-insert'] = true;
continue;
} else {
$colStmt[] = "`${colName}`";
$colStmt[] = "`{$colName}`";
}
}

Expand All @@ -1230,7 +1230,7 @@ public function getColumnNames($tableName)
$this->dumpSettings['complete-insert'] = true;
continue;
} else {
$colNames[] = "`${colName}`";
$colNames[] = "`{$colName}`";
}
}
return $colNames;
Expand Down Expand Up @@ -1526,7 +1526,7 @@ public function show_columns()

$args = func_get_args();

return "pragma table_info(${args[0]})";
return "pragma table_info({$args[0]})";
}

public function show_procedures()
Expand Down Expand Up @@ -1701,10 +1701,10 @@ public function databases()
$resultSet->closeCursor();
$ret = "";

$ret .= "CREATE DATABASE /* !32312 IF NOT EXISTS*/ `${databaseName}`" .
" /* !40100 DEFAULT CHARACTER SET ${characterSet} " .
" COLLATE ${collationDb} */;" . PHP_EOL . PHP_EOL .
"USE `${databaseName}`;" . PHP_EOL . PHP_EOL;
$ret .= "CREATE DATABASE /* !32312 IF NOT EXISTS*/ `{$databaseName}`" .
" /* !40100 DEFAULT CHARACTER SET {$characterSet} " .
" COLLATE {$collationDb} */;" . PHP_EOL . PHP_EOL .
"USE `{$databaseName}`;" . PHP_EOL . PHP_EOL;

return $ret;
}
Expand Down Expand Up @@ -1880,7 +1880,7 @@ public function show_tables()
$args = func_get_args();
return "SELECT TABLE_NAME AS tbl_name " .
"FROM INFORMATION_SCHEMA.TABLES " .
"WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='${args[0]}'";
"WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='{$args[0]}'";
}

public function show_views()
Expand All @@ -1889,21 +1889,21 @@ public function show_views()
$args = func_get_args();
return "SELECT TABLE_NAME AS tbl_name " .
"FROM INFORMATION_SCHEMA.TABLES " .
"WHERE TABLE_TYPE='VIEW' AND TABLE_SCHEMA='${args[0]}'";
"WHERE TABLE_TYPE='VIEW' AND TABLE_SCHEMA='{$args[0]}'";
}

public function show_triggers()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "SHOW TRIGGERS FROM `${args[0]}`;";
return "SHOW TRIGGERS FROM `{$args[0]}`;";
}

public function show_columns()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "SHOW COLUMNS FROM `${args[0]}`;";
return "SHOW COLUMNS FROM `{$args[0]}`;";
}

public function show_procedures()
Expand All @@ -1912,7 +1912,7 @@ public function show_procedures()
$args = func_get_args();
return "SELECT SPECIFIC_NAME AS procedure_name " .
"FROM INFORMATION_SCHEMA.ROUTINES " .
"WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='${args[0]}'";
"WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='{$args[0]}'";
}

/**
Expand All @@ -1927,7 +1927,7 @@ public function show_events()
$args = func_get_args();
return "SELECT EVENT_NAME AS event_name " .
"FROM INFORMATION_SCHEMA.EVENTS " .
"WHERE EVENT_SCHEMA='${args[0]}'";
"WHERE EVENT_SCHEMA='{$args[0]}'";
}

public function setup_transaction()
Expand All @@ -1949,7 +1949,7 @@ public function lock_table()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return $this->dbHandler->exec("LOCK TABLES `${args[0]}` READ LOCAL");
return $this->dbHandler->exec("LOCK TABLES `{$args[0]}` READ LOCAL");
}

public function unlock_table()
Expand All @@ -1961,7 +1961,7 @@ public function start_add_lock_table()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "LOCK TABLES `${args[0]}` WRITE;" . PHP_EOL;
return "LOCK TABLES `{$args[0]}` WRITE;" . PHP_EOL;
}

public function end_add_lock_table()
Expand All @@ -1973,15 +1973,15 @@ public function start_add_disable_keys()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "/* !40000 ALTER TABLE `${args[0]}` DISABLE KEYS */;" .
return "/* !40000 ALTER TABLE `{$args[0]}` DISABLE KEYS */;" .
PHP_EOL;
}

public function end_add_disable_keys()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "/* !40000 ALTER TABLE `${args[0]}` ENABLE KEYS */;" .
return "/* !40000 ALTER TABLE `{$args[0]}` ENABLE KEYS */;" .
PHP_EOL;
}

Expand All @@ -1999,38 +1999,38 @@ public function add_drop_database()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "/* !40000 DROP DATABASE IF EXISTS `${args[0]}`*/;" .
return "/* !40000 DROP DATABASE IF EXISTS `{$args[0]}`*/;" .
PHP_EOL . PHP_EOL;
}

public function add_drop_trigger()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "DROP TRIGGER IF EXISTS `${args[0]}`;" . PHP_EOL;
return "DROP TRIGGER IF EXISTS `{$args[0]}`;" . PHP_EOL;
}

public function drop_table()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "DROP TABLE IF EXISTS `${args[0]}`;" . PHP_EOL;
return "DROP TABLE IF EXISTS `{$args[0]}`;" . PHP_EOL;
}

public function drop_view()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "DROP TABLE IF EXISTS `${args[0]}`;" . PHP_EOL .
"/* !50001 DROP VIEW IF EXISTS `${args[0]}`*/;" . PHP_EOL;
return "DROP TABLE IF EXISTS `{$args[0]}`;" . PHP_EOL .
"/* !50001 DROP VIEW IF EXISTS `{$args[0]}`*/;" . PHP_EOL;
}

public function getDatabaseHeader()
{
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
$args = func_get_args();
return "--" . PHP_EOL .
"-- Current Database: `${args[0]}`" . PHP_EOL .
"-- Current Database: `{$args[0]}`" . PHP_EOL .
"--" . PHP_EOL . PHP_EOL;
}

Expand Down