diff --git a/examples/config.manyhosts.inc.php b/examples/config.manyhosts.inc.php index b9ea89306d..ed2e8a0a6a 100644 --- a/examples/config.manyhosts.inc.php +++ b/examples/config.manyhosts.inc.php @@ -12,10 +12,10 @@ declare(strict_types=1); $i = 0; $hosts = [ - "foo.example.com", - "bar.example.com", - "baz.example.com", - "quux.example.com", + 'foo.example.com', + 'bar.example.com', + 'baz.example.com', + 'quux.example.com', ]; foreach ($hosts as $host) { diff --git a/examples/openid.php b/examples/openid.php index 7cb456e78b..f3e9e5ef73 100644 --- a/examples/openid.php +++ b/examples/openid.php @@ -76,7 +76,7 @@ function Show_page($contents) function Die_error($e) { $contents = "
\n"; - $contents .= "
" . htmlspecialchars($e->getMessage()) . "
\n"; + $contents .= '
' . htmlspecialchars($e->getMessage()) . "
\n"; $contents .= "
"; Show_page($contents); exit; @@ -143,7 +143,7 @@ if (isset($_POST['start'])) { $url = $authRequest->getAuthorizeURL(); - header("Location: $url"); + header('Location: ' . $url); exit; } else { /* Grab query string */ diff --git a/import_status.php b/import_status.php index 9ca0e6fd84..1f7d488f8e 100644 --- a/import_status.php +++ b/import_status.php @@ -25,7 +25,7 @@ list( global $containerBuilder; // $_GET["message"] is used for asking for an import message -if (isset($_GET["message"]) && $_GET["message"]) { +if (isset($_GET['message']) && $_GET['message']) { // AJAX requests can't be cached! Core::noCacheHeader(); @@ -62,5 +62,5 @@ if (isset($_GET["message"]) && $_GET["message"]) { 'go_back_url' => $_SESSION['Import_message']['go_back_url'], ]); } else { - ImportAjax::status($_GET["id"]); + ImportAjax::status($_GET['id']); } diff --git a/js/messages.php b/js/messages.php index 621e2696fb..b85102c1e3 100644 --- a/js/messages.php +++ b/js/messages.php @@ -456,7 +456,7 @@ $js_messages['strPrimaryKeyAdded'] = __('Primary key added.'); $js_messages['strToNextStep'] = __('Taking you to next step…'); $js_messages['strFinishMsg'] = __("The first step of normalization is complete for table '%s'."); -$js_messages['strEndStep'] = __("End of step"); +$js_messages['strEndStep'] = __('End of step'); $js_messages['str2NFNormalization'] = __('Second step of normalization (2NF)'); $js_messages['strDone'] = __('Done'); $js_messages['strConfirmPd'] = __('Confirm partial dependencies'); @@ -685,22 +685,22 @@ $js_messages['strUpToDate'] = __('up to date'); $js_messages['strCreateView'] = __('Create view'); /* Error Reporting */ -$js_messages['strSendErrorReport'] = __("Send error report"); -$js_messages['strSubmitErrorReport'] = __("Submit error report"); +$js_messages['strSendErrorReport'] = __('Send error report'); +$js_messages['strSubmitErrorReport'] = __('Submit error report'); $js_messages['strErrorOccurred'] = __( - "A fatal JavaScript error has occurred. Would you like to send an error report?" + 'A fatal JavaScript error has occurred. Would you like to send an error report?' ); -$js_messages['strChangeReportSettings'] = __("Change report settings"); -$js_messages['strShowReportDetails'] = __("Show report details"); -$js_messages['strIgnore'] = __("Ignore"); +$js_messages['strChangeReportSettings'] = __('Change report settings'); +$js_messages['strShowReportDetails'] = __('Show report details'); +$js_messages['strIgnore'] = __('Ignore'); $js_messages['strTimeOutError'] = __( - "Your export is incomplete, due to a low execution time limit at the PHP level!" + 'Your export is incomplete, due to a low execution time limit at the PHP level!' ); $js_messages['strTooManyInputs'] = __( - "Warning: a form on this page has more than %d fields. On submission, " + 'Warning: a form on this page has more than %d fields. On submission, ' . "some of the fields might be ignored, due to PHP's " - . "max_input_vars configuration." + . 'max_input_vars configuration.' ); $js_messages['phpErrorsFound'] = ''; } $linkClass = ''; @@ -1147,7 +1147,7 @@ class NavigationTree } if ($node->type == Node::CONTAINER) { - $retval .= ""; + $retval .= ''; } $divClass = ''; @@ -1178,16 +1178,16 @@ class NavigationTree foreach ($icons as $key => $icon) { $link = vsprintf($iconLinks[$key], $args); if ($linkClass != '') { - $retval .= ""; - $retval .= "{$icon}"; + $retval .= ""; + $retval .= '' . $icon . ''; } else { - $retval .= "{$icon}"; + $retval .= "" . $icon . ''; } } } else { - $retval .= "{$node->icon}"; + $retval .= '' . $node->icon . ''; } - $retval .= ""; + $retval .= ''; if (isset($node->links['text'])) { $args = []; @@ -1197,21 +1197,21 @@ class NavigationTree $link = vsprintf($node->links['text'], $args); $title = isset($node->links['title']) ? $node->links['title'] : ''; if ($node->type == Node::CONTAINER) { - $retval .= " "; + $retval .= " "; $retval .= htmlspecialchars($node->name); - $retval .= ""; + $retval .= ''; } else { - $retval .= ""; $retval .= htmlspecialchars($node->displayName ?? $node->realName); - $retval .= ""; + $retval .= ''; } } else { - $retval .= " {$node->name}"; + $retval .= ' ' . $node->name . ''; } $retval .= $node->getHtmlForControlButtons(); if ($node->type == Node::CONTAINER) { - $retval .= ""; + $retval .= ''; } $retval .= '
'; $wrap = true; @@ -1248,18 +1248,18 @@ class NavigationTree } if (! empty($buffer)) { if ($wrap) { - $retval .= "'; } } } if ($node->hasSiblings()) { - $retval .= ""; + $retval .= ''; } return $retval; @@ -1388,11 +1388,11 @@ class NavigationTree $retval .= 'X'; - $retval .= ""; - $retval .= ""; + $retval .= ''; + $retval .= ''; return $retval; } @@ -1420,10 +1420,10 @@ class NavigationTree $retval .= ""; + . __('Type to filter these, Enter to search all') . "'>"; $retval .= "X"; - $retval .= ""; - $retval .= ""; + $retval .= ''; + $retval .= ''; } return $retval; diff --git a/libraries/classes/Navigation/Nodes/Node.php b/libraries/classes/Navigation/Nodes/Node.php index c9f2ac44f6..1b8802fa93 100644 --- a/libraries/classes/Navigation/Nodes/Node.php +++ b/libraries/classes/Navigation/Nodes/Node.php @@ -32,12 +32,12 @@ class Node * @var string A non-unique identifier for the node * This may be trimmed when grouping nodes */ - public $name = ""; + public $name = ''; /** * @var string A non-unique identifier for the node * This will never change after being assigned */ - public $realName = ""; + public $realName = ''; /** * @var int May be one of CONTAINER or OBJECT */ @@ -372,11 +372,11 @@ class Node if (isset($GLOBALS['cfg']['Server']['DisableIS']) && ! $GLOBALS['cfg']['Server']['DisableIS'] ) { - $query = "SELECT `SCHEMA_NAME` "; - $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; + $query = 'SELECT `SCHEMA_NAME` '; + $query .= 'FROM `INFORMATION_SCHEMA`.`SCHEMATA` '; $query .= $this->getWhereClause('SCHEMA_NAME', $searchClause); - $query .= "ORDER BY `SCHEMA_NAME` "; - $query .= "LIMIT $pos, $maxItems"; + $query .= 'ORDER BY `SCHEMA_NAME` '; + $query .= 'LIMIT ' . $pos . ', ' . $maxItems; $retval = $GLOBALS['dbi']->fetchResult($query); return $retval; @@ -384,7 +384,7 @@ class Node if ($GLOBALS['dbs_to_test'] === false) { $retval = []; - $query = "SHOW DATABASES "; + $query = 'SHOW DATABASES '; $query .= $this->getWhereClause('Database', $searchClause); $handle = $GLOBALS['dbi']->tryQuery($query); if ($handle === false) { @@ -441,33 +441,33 @@ class Node if (isset($GLOBALS['cfg']['Server']['DisableIS']) && ! $GLOBALS['cfg']['Server']['DisableIS'] ) { - $query = "SELECT `SCHEMA_NAME` "; - $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA`, "; - $query .= "("; - $query .= "SELECT DB_first_level "; - $query .= "FROM ( "; - $query .= "SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, "; + $query = 'SELECT `SCHEMA_NAME` '; + $query .= 'FROM `INFORMATION_SCHEMA`.`SCHEMATA`, '; + $query .= '('; + $query .= 'SELECT DB_first_level '; + $query .= 'FROM ( '; + $query .= 'SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, '; $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "', 1) "; - $query .= "DB_first_level "; - $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; + $query .= 'DB_first_level '; + $query .= 'FROM INFORMATION_SCHEMA.SCHEMATA '; $query .= $this->getWhereClause('SCHEMA_NAME', $searchClause); - $query .= ") t "; - $query .= "ORDER BY DB_first_level ASC "; - $query .= "LIMIT $pos, $maxItems"; - $query .= ") t2 "; + $query .= ') t '; + $query .= 'ORDER BY DB_first_level ASC '; + $query .= 'LIMIT ' . $pos . ', ' . $maxItems; + $query .= ') t2 '; $query .= $this->getWhereClause('SCHEMA_NAME', $searchClause); - $query .= "AND 1 = LOCATE(CONCAT(DB_first_level, "; + $query .= 'AND 1 = LOCATE(CONCAT(DB_first_level, '; $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "'), "; - $query .= "CONCAT(SCHEMA_NAME, "; + $query .= 'CONCAT(SCHEMA_NAME, '; $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "')) "; - $query .= "ORDER BY SCHEMA_NAME ASC"; + $query .= 'ORDER BY SCHEMA_NAME ASC'; $retval = $GLOBALS['dbi']->fetchResult($query); return $retval; } if ($GLOBALS['dbs_to_test'] === false) { - $query = "SHOW DATABASES "; + $query = 'SHOW DATABASES '; $query .= $this->getWhereClause('Database', $searchClause); $handle = $GLOBALS['dbi']->tryQuery($query); $prefixes = []; @@ -487,9 +487,9 @@ class Node $prefixes = array_slice(array_keys($prefixMap), (int) $pos); } - $query = "SHOW DATABASES "; + $query = 'SHOW DATABASES '; $query .= $this->getWhereClause('Database', $searchClause); - $query .= "AND ("; + $query .= 'AND ('; $subClauses = []; foreach ($prefixes as $prefix) { $subClauses[] = " LOCATE('" @@ -497,7 +497,7 @@ class Node . "', " . "CONCAT(`Database`, '" . $dbSeparator . "')) = 1 "; } - $query .= implode("OR", $subClauses) . ")"; + $query .= implode('OR', $subClauses) . ')'; $retval = $GLOBALS['dbi']->fetchResult($query); return $retval; @@ -579,8 +579,8 @@ class Node if (isset($GLOBALS['cfg']['Server']['DisableIS']) && ! $GLOBALS['cfg']['Server']['DisableIS'] ) { - $query = "SELECT COUNT(*) "; - $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM INFORMATION_SCHEMA.SCHEMATA '; $query .= $this->getWhereClause('SCHEMA_NAME', $searchClause); $retval = (int) $GLOBALS['dbi']->fetchValue($query); @@ -588,7 +588,7 @@ class Node } if ($GLOBALS['dbs_to_test'] === false) { - $query = "SHOW DATABASES "; + $query = 'SHOW DATABASES '; $query .= $this->getWhereClause('Database', $searchClause); $retval = $GLOBALS['dbi']->numRows( $GLOBALS['dbi']->tryQuery($query) @@ -610,14 +610,14 @@ class Node $dbSeparator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; if (! $GLOBALS['cfg']['Server']['DisableIS']) { - $query = "SELECT COUNT(*) "; - $query .= "FROM ( "; - $query .= "SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, "; - $query .= "'$dbSeparator', 1) "; - $query .= "DB_first_level "; - $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM ( '; + $query .= 'SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, '; + $query .= "'" . $dbSeparator . "', 1) "; + $query .= 'DB_first_level '; + $query .= 'FROM INFORMATION_SCHEMA.SCHEMATA '; $query .= $this->getWhereClause('SCHEMA_NAME', $searchClause); - $query .= ") t "; + $query .= ') t '; $retval = (int) $GLOBALS['dbi']->fetchValue($query); return $retval; @@ -649,7 +649,7 @@ class Node } $prefixMap = []; - $query = "SHOW DATABASES "; + $query = 'SHOW DATABASES '; $query .= $this->getWhereClause('Database', $searchClause); $handle = $GLOBALS['dbi']->tryQuery($query); if ($handle !== false) { @@ -694,7 +694,7 @@ class Node $databases = []; if (! empty($searchClause)) { $databases = [ - "%" . $GLOBALS['dbi']->escapeString($searchClause) . "%", + '%' . $GLOBALS['dbi']->escapeString($searchClause) . '%', ]; } elseif (! empty($GLOBALS['cfg']['Server']['only_db'])) { $databases = $GLOBALS['cfg']['Server']['only_db']; @@ -717,16 +717,16 @@ class Node */ private function getWhereClause($columnName, $searchClause = '') { - $whereClause = "WHERE TRUE "; + $whereClause = 'WHERE TRUE '; if (! empty($searchClause)) { - $whereClause .= "AND " . Util::backquote($columnName) + $whereClause .= 'AND ' . Util::backquote($columnName) . " LIKE '%"; $whereClause .= $GLOBALS['dbi']->escapeString($searchClause); $whereClause .= "%' "; } if (! empty($GLOBALS['cfg']['Server']['hide_db'])) { - $whereClause .= "AND " . Util::backquote($columnName) + $whereClause .= 'AND ' . Util::backquote($columnName) . " NOT REGEXP '" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['hide_db']) . "' "; @@ -738,14 +738,14 @@ class Node $GLOBALS['cfg']['Server']['only_db'], ]; } - $whereClause .= "AND ("; + $whereClause .= 'AND ('; $subClauses = []; foreach ($GLOBALS['cfg']['Server']['only_db'] as $eachOnlyDb) { - $subClauses[] = " " . Util::backquote($columnName) + $subClauses[] = ' ' . Util::backquote($columnName) . " LIKE '" . $GLOBALS['dbi']->escapeString($eachOnlyDb) . "' "; } - $whereClause .= implode("OR", $subClauses) . ") "; + $whereClause .= implode('OR', $subClauses) . ') '; } return $whereClause; @@ -818,15 +818,15 @@ class Node $cfgRelation = $this->relation->getRelationsParam(); if ($cfgRelation['navwork']) { $navTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote( + . '.' . Util::backquote( $cfgRelation['navigationhiding'] ); - $sqlQuery = "SELECT `db_name`, COUNT(*) AS `count` FROM " . $navTable + $sqlQuery = 'SELECT `db_name`, COUNT(*) AS `count` FROM ' . $navTable . " WHERE `username`='" . $GLOBALS['dbi']->escapeString( $GLOBALS['cfg']['Server']['user'] ) . "'" - . " GROUP BY `db_name`"; + . ' GROUP BY `db_name`'; $counts = $GLOBALS['dbi']->fetchResult( $sqlQuery, 'db_name', diff --git a/libraries/classes/Navigation/Nodes/NodeDatabase.php b/libraries/classes/Navigation/Nodes/NodeDatabase.php index b3793a31d7..6faf19d9f2 100644 --- a/libraries/classes/Navigation/Nodes/NodeDatabase.php +++ b/libraries/classes/Navigation/Nodes/NodeDatabase.php @@ -121,12 +121,12 @@ class NodeDatabase extends Node if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`TABLES` "; - $query .= "WHERE `TABLE_SCHEMA`='$db' "; - $query .= "AND `TABLE_TYPE`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM `INFORMATION_SCHEMA`.`TABLES` '; + $query .= "WHERE `TABLE_SCHEMA`='" . $db . "' "; + $query .= 'AND `TABLE_TYPE`' . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'TABLE_NAME' @@ -134,11 +134,11 @@ class NodeDatabase extends Node } $retval = (int) $GLOBALS['dbi']->fetchValue($query); } else { - $query = "SHOW FULL TABLES FROM "; + $query = 'SHOW FULL TABLES FROM '; $query .= Util::backquote($db); - $query .= " WHERE `Table_type`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + $query .= ' WHERE `Table_type`' . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'Tables_in_' . $db @@ -205,13 +205,13 @@ class NodeDatabase extends Node $db = $this->realName; if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; - $query .= "WHERE `ROUTINE_SCHEMA` " - . Util::getCollateForIS() . "='$db'"; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM `INFORMATION_SCHEMA`.`ROUTINES` '; + $query .= 'WHERE `ROUTINE_SCHEMA` ' + . Util::getCollateForIS() . "='" . $db . "'"; $query .= "AND `ROUTINE_TYPE`='PROCEDURE' "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'ROUTINE_NAME' @@ -220,9 +220,9 @@ class NodeDatabase extends Node $retval = (int) $GLOBALS['dbi']->fetchValue($query); } else { $db = $GLOBALS['dbi']->escapeString($db); - $query = "SHOW PROCEDURE STATUS WHERE `Db`='$db' "; + $query = "SHOW PROCEDURE STATUS WHERE `Db`='" . $db . "' "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'Name' @@ -251,13 +251,13 @@ class NodeDatabase extends Node $db = $this->realName; if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; - $query .= "WHERE `ROUTINE_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM `INFORMATION_SCHEMA`.`ROUTINES` '; + $query .= 'WHERE `ROUTINE_SCHEMA` ' + . Util::getCollateForIS() . "='" . $db . "' "; $query .= "AND `ROUTINE_TYPE`='FUNCTION' "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'ROUTINE_NAME' @@ -266,9 +266,9 @@ class NodeDatabase extends Node $retval = (int) $GLOBALS['dbi']->fetchValue($query); } else { $db = $GLOBALS['dbi']->escapeString($db); - $query = "SHOW FUNCTION STATUS WHERE `Db`='$db' "; + $query = "SHOW FUNCTION STATUS WHERE `Db`='" . $db . "' "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'Name' @@ -297,12 +297,12 @@ class NodeDatabase extends Node $db = $this->realName; if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`EVENTS` "; - $query .= "WHERE `EVENT_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM `INFORMATION_SCHEMA`.`EVENTS` '; + $query .= 'WHERE `EVENT_SCHEMA` ' + . Util::getCollateForIS() . "='" . $db . "' "; if (! empty($searchClause)) { - $query .= "AND " . $this->getWhereClauseForSearch( + $query .= 'AND ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'EVENT_NAME' @@ -311,9 +311,9 @@ class NodeDatabase extends Node $retval = (int) $GLOBALS['dbi']->fetchValue($query); } else { $db = Util::backquote($db); - $query = "SHOW EVENTS FROM $db "; + $query = 'SHOW EVENTS FROM ' . $db . ' '; if (! empty($searchClause)) { - $query .= "WHERE " . $this->getWhereClauseForSearch( + $query .= 'WHERE ' . $this->getWhereClauseForSearch( $searchClause, $singleItem, 'Name' @@ -343,10 +343,10 @@ class NodeDatabase extends Node ) { $query = ''; if ($singleItem) { - $query .= Util::backquote($columnName) . " = "; + $query .= Util::backquote($columnName) . ' = '; $query .= "'" . $GLOBALS['dbi']->escapeString($searchClause) . "'"; } else { - $query .= Util::backquote($columnName) . " LIKE "; + $query .= Util::backquote($columnName) . ' LIKE '; $query .= "'%" . $GLOBALS['dbi']->escapeString($searchClause) . "%'"; } @@ -419,8 +419,8 @@ class NodeDatabase extends Node return []; } $navTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['navigationhiding']); - $sqlQuery = "SELECT `item_name` FROM " . $navTable + . '.' . Util::backquote($cfgRelation['navigationhiding']); + $sqlQuery = 'SELECT `item_name` FROM ' . $navTable . " WHERE `username`='" . $cfgRelation['user'] . "'" . " AND `item_type`='" . $type . "' AND `db_name`='" . $GLOBALS['dbi']->escapeString($db) @@ -458,25 +458,25 @@ class NodeDatabase extends Node $db = $this->realName; if (! $GLOBALS['cfg']['Server']['DisableIS']) { $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT `TABLE_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`TABLES` "; - $query .= "WHERE `TABLE_SCHEMA`='$escdDb' "; - $query .= "AND `TABLE_TYPE`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + $query = 'SELECT `TABLE_NAME` AS `name` '; + $query .= 'FROM `INFORMATION_SCHEMA`.`TABLES` '; + $query .= "WHERE `TABLE_SCHEMA`='" . $escdDb . "' "; + $query .= 'AND `TABLE_TYPE`' . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; if (! empty($searchClause)) { $query .= "AND `TABLE_NAME` LIKE '%"; $query .= $GLOBALS['dbi']->escapeString($searchClause); $query .= "%'"; } - $query .= "ORDER BY `TABLE_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $query .= 'ORDER BY `TABLE_NAME` ASC '; + $query .= 'LIMIT ' . intval($pos) . ', ' . $maxItems; $retval = $GLOBALS['dbi']->fetchResult($query); } else { - $query = " SHOW FULL TABLES FROM "; + $query = ' SHOW FULL TABLES FROM '; $query .= Util::backquote($db); - $query .= " WHERE `Table_type`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + $query .= ' WHERE `Table_type`' . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; if (! empty($searchClause)) { - $query .= "AND " . Util::backquote( - "Tables_in_" . $db + $query .= 'AND ' . Util::backquote( + 'Tables_in_' . $db ); $query .= " LIKE '%" . $GLOBALS['dbi']->escapeString( $searchClause @@ -544,22 +544,22 @@ class NodeDatabase extends Node $db = $this->realName; if (! $GLOBALS['cfg']['Server']['DisableIS']) { $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT `ROUTINE_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; - $query .= "WHERE `ROUTINE_SCHEMA` " - . Util::getCollateForIS() . "='$escdDb'"; + $query = 'SELECT `ROUTINE_NAME` AS `name` '; + $query .= 'FROM `INFORMATION_SCHEMA`.`ROUTINES` '; + $query .= 'WHERE `ROUTINE_SCHEMA` ' + . Util::getCollateForIS() . "='" . $escdDb . "'"; $query .= "AND `ROUTINE_TYPE`='" . $routineType . "' "; if (! empty($searchClause)) { $query .= "AND `ROUTINE_NAME` LIKE '%"; $query .= $GLOBALS['dbi']->escapeString($searchClause); $query .= "%'"; } - $query .= "ORDER BY `ROUTINE_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $query .= 'ORDER BY `ROUTINE_NAME` ASC '; + $query .= 'LIMIT ' . intval($pos) . ', ' . $maxItems; $retval = $GLOBALS['dbi']->fetchResult($query); } else { $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SHOW " . $routineType . " STATUS WHERE `Db`='$escdDb' "; + $query = 'SHOW ' . $routineType . " STATUS WHERE `Db`='" . $escdDb . "' "; if (! empty($searchClause)) { $query .= "AND `Name` LIKE '%"; $query .= $GLOBALS['dbi']->escapeString($searchClause); @@ -625,21 +625,21 @@ class NodeDatabase extends Node $db = $this->realName; if (! $GLOBALS['cfg']['Server']['DisableIS']) { $escdDb = $GLOBALS['dbi']->escapeString($db); - $query = "SELECT `EVENT_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`EVENTS` "; - $query .= "WHERE `EVENT_SCHEMA` " - . Util::getCollateForIS() . "='$escdDb' "; + $query = 'SELECT `EVENT_NAME` AS `name` '; + $query .= 'FROM `INFORMATION_SCHEMA`.`EVENTS` '; + $query .= 'WHERE `EVENT_SCHEMA` ' + . Util::getCollateForIS() . "='" . $escdDb . "' "; if (! empty($searchClause)) { $query .= "AND `EVENT_NAME` LIKE '%"; $query .= $GLOBALS['dbi']->escapeString($searchClause); $query .= "%'"; } - $query .= "ORDER BY `EVENT_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $query .= 'ORDER BY `EVENT_NAME` ASC '; + $query .= 'LIMIT ' . intval($pos) . ', ' . $maxItems; $retval = $GLOBALS['dbi']->fetchResult($query); } else { $escdDb = Util::backquote($db); - $query = "SHOW EVENTS FROM $escdDb "; + $query = 'SHOW EVENTS FROM ' . $escdDb . ' '; if (! empty($searchClause)) { $query .= "WHERE `Name` LIKE '%"; $query .= $GLOBALS['dbi']->escapeString($searchClause); diff --git a/libraries/classes/Navigation/Nodes/NodeTable.php b/libraries/classes/Navigation/Nodes/NodeTable.php index 58caa5af0f..02adb0a0d1 100644 --- a/libraries/classes/Navigation/Nodes/NodeTable.php +++ b/libraries/classes/Navigation/Nodes/NodeTable.php @@ -99,15 +99,15 @@ class NodeTable extends NodeDatabaseChild if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` "; - $query .= "WHERE `TABLE_NAME`='$table' "; - $query .= "AND `TABLE_SCHEMA`='$db'"; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM `INFORMATION_SCHEMA`.`COLUMNS` '; + $query .= "WHERE `TABLE_NAME`='" . $table . "' "; + $query .= "AND `TABLE_SCHEMA`='" . $db . "'"; $retval = (int) $GLOBALS['dbi']->fetchValue($query); } else { $db = Util::backquote($db); $table = Util::backquote($table); - $query = "SHOW COLUMNS FROM $table FROM $db"; + $query = 'SHOW COLUMNS FROM ' . $table . ' FROM ' . $db . ''; $retval = (int) $GLOBALS['dbi']->numRows( $GLOBALS['dbi']->tryQuery($query) ); @@ -116,7 +116,7 @@ class NodeTable extends NodeDatabaseChild case 'indexes': $db = Util::backquote($db); $table = Util::backquote($table); - $query = "SHOW INDEXES FROM $table FROM $db"; + $query = 'SHOW INDEXES FROM ' . $table . ' FROM ' . $db; $retval = (int) $GLOBALS['dbi']->numRows( $GLOBALS['dbi']->tryQuery($query) ); @@ -125,17 +125,17 @@ class NodeTable extends NodeDatabaseChild if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT COUNT(*) "; - $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` "; - $query .= "WHERE `EVENT_OBJECT_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; - $query .= "AND `EVENT_OBJECT_TABLE` " - . Util::getCollateForIS() . "='$table'"; + $query = 'SELECT COUNT(*) '; + $query .= 'FROM `INFORMATION_SCHEMA`.`TRIGGERS` '; + $query .= 'WHERE `EVENT_OBJECT_SCHEMA` ' + . Util::getCollateForIS() . "='" . $db . "' "; + $query .= 'AND `EVENT_OBJECT_TABLE` ' + . Util::getCollateForIS() . "='" . $table . "'"; $retval = (int) $GLOBALS['dbi']->fetchValue($query); } else { $db = Util::backquote($db); $table = $GLOBALS['dbi']->escapeString($table); - $query = "SHOW TRIGGERS FROM $db WHERE `Table` = '$table'"; + $query = 'SHOW TRIGGERS FROM ' . $db . " WHERE `Table` = '" . $table . "'"; $retval = (int) $GLOBALS['dbi']->numRows( $GLOBALS['dbi']->tryQuery($query) ); @@ -171,23 +171,23 @@ class NodeTable extends NodeDatabaseChild if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT `COLUMN_NAME` AS `name` "; - $query .= ",`COLUMN_KEY` AS `key` "; - $query .= ",`DATA_TYPE` AS `type` "; - $query .= ",`COLUMN_DEFAULT` AS `default` "; + $query = 'SELECT `COLUMN_NAME` AS `name` '; + $query .= ',`COLUMN_KEY` AS `key` '; + $query .= ',`DATA_TYPE` AS `type` '; + $query .= ',`COLUMN_DEFAULT` AS `default` '; $query .= ",IF (`IS_NULLABLE` = 'NO', '', 'nullable') AS `nullable` "; - $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` "; - $query .= "WHERE `TABLE_NAME`='$table' "; - $query .= "AND `TABLE_SCHEMA`='$db' "; - $query .= "ORDER BY `COLUMN_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $query .= 'FROM `INFORMATION_SCHEMA`.`COLUMNS` '; + $query .= "WHERE `TABLE_NAME`='" . $table . "' "; + $query .= "AND `TABLE_SCHEMA`='" . $db . "' "; + $query .= 'ORDER BY `COLUMN_NAME` ASC '; + $query .= 'LIMIT ' . intval($pos) . ', ' . $maxItems; $retval = $GLOBALS['dbi']->fetchResult($query); break; } $db = Util::backquote($db); $table = Util::backquote($table); - $query = "SHOW COLUMNS FROM $table FROM $db"; + $query = 'SHOW COLUMNS FROM ' . $table . ' FROM ' . $db; $handle = $GLOBALS['dbi']->tryQuery($query); if ($handle === false) { break; @@ -208,7 +208,7 @@ class NodeTable extends NodeDatabaseChild case 'indexes': $db = Util::backquote($db); $table = Util::backquote($table); - $query = "SHOW INDEXES FROM $table FROM $db"; + $query = 'SHOW INDEXES FROM ' . $table . ' FROM ' . $db; $handle = $GLOBALS['dbi']->tryQuery($query); if ($handle === false) { break; @@ -230,21 +230,21 @@ class NodeTable extends NodeDatabaseChild if (! $GLOBALS['cfg']['Server']['DisableIS']) { $db = $GLOBALS['dbi']->escapeString($db); $table = $GLOBALS['dbi']->escapeString($table); - $query = "SELECT `TRIGGER_NAME` AS `name` "; - $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` "; - $query .= "WHERE `EVENT_OBJECT_SCHEMA` " - . Util::getCollateForIS() . "='$db' "; - $query .= "AND `EVENT_OBJECT_TABLE` " - . Util::getCollateForIS() . "='$table' "; - $query .= "ORDER BY `TRIGGER_NAME` ASC "; - $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $query = 'SELECT `TRIGGER_NAME` AS `name` '; + $query .= 'FROM `INFORMATION_SCHEMA`.`TRIGGERS` '; + $query .= 'WHERE `EVENT_OBJECT_SCHEMA` ' + . Util::getCollateForIS() . "='" . $db . "' "; + $query .= 'AND `EVENT_OBJECT_TABLE` ' + . Util::getCollateForIS() . "='" . $table . "' "; + $query .= 'ORDER BY `TRIGGER_NAME` ASC '; + $query .= 'LIMIT ' . intval($pos) . ', ' . $maxItems; $retval = $GLOBALS['dbi']->fetchResult($query); break; } $db = Util::backquote($db); $table = $GLOBALS['dbi']->escapeString($table); - $query = "SHOW TRIGGERS FROM $db WHERE `Table` = '$table'"; + $query = 'SHOW TRIGGERS FROM ' . $db . " WHERE `Table` = '" . $table . "'"; $handle = $GLOBALS['dbi']->tryQuery($query); if ($handle === false) { break; diff --git a/libraries/classes/Normalization.php b/libraries/classes/Normalization.php index 17fe8dcdb6..d0651526f3 100644 --- a/libraries/classes/Normalization.php +++ b/libraries/classes/Normalization.php @@ -87,8 +87,8 @@ class Normalization null, true ); - $type = ""; - $selectColHtml = ""; + $type = ''; + $selectColHtml = ''; foreach ($columns as $column => $def) { if (isset($def['Type'])) { $extractedColumnSpec = Util::extractColumnSpec($def['Type']); @@ -213,11 +213,11 @@ class Normalization $step = 1; $stepTxt = __('Make all columns atomic'); $html = "

" - . __('First step of normalization (1NF)') . "

"; + . __('First step of normalization (1NF)') . ''; $html .= "
" . - "
" . - "" . __('Step 1.') . $step . " " . $stepTxt . "" . - "

" . __( + '
' . + '' . __('Step 1.') . $step . ' ' . $stepTxt . '' . + '

' . __( 'Do you have any column which can be split into more than' . ' one column? ' . 'For example: address can be split into street, city, country and zip.' @@ -226,30 +226,30 @@ class Normalization . "data-pick=false href='#'> " . __( 'Show me the central list of columns that are not already in this table' - ) . " )

" + ) . ' )

' . "

" . __( 'Select a column which can be split into more ' . 'than one (on select of \'no such column\', it\'ll move to next step).' ) - . "

" + . '

' . "
" . "" - . "" . __('split into ') + . '' + . '' . __('split into ') . "" . "
" . "
" . "
" - . "
" - . "
"; + . '' + . ''; return $html; } @@ -266,18 +266,18 @@ class Normalization $step = 2; $stepTxt = __('Have a primary key'); $primary = Index::getPrimary($table, $db); - $hasPrimaryKey = "0"; - $legendText = __('Step 1.') . $step . " " . $stepTxt; + $hasPrimaryKey = '0'; + $legendText = __('Step 1.') . $step . ' ' . $stepTxt; $extra = ''; if ($primary) { - $headText = __("Primary key already exists."); - $subText = __("Taking you to next step…"); - $hasPrimaryKey = "1"; + $headText = __('Primary key already exists.'); + $subText = __('Taking you to next step…'); + $hasPrimaryKey = '1'; } else { $headText = __( - "There is no primary key; please add one.
" - . "Hint: A primary key is a column " - . "(or combination of columns) that uniquely identify all rows." + 'There is no primary key; please add one.
' + . 'Hint: A primary key is a column ' + . '(or combination of columns) that uniquely identify all rows.' ); $subText = '' . Generator::getIcon( @@ -289,8 +289,8 @@ class Normalization . ''; $extra = __( "If it's not possible to make existing " - . "column combinations as primary key" - ) . "
" + . 'column combinations as primary key' + ) . '
' . '' . __('+ Add a new primary key column') . ''; } @@ -315,18 +315,18 @@ class Normalization { $step = 4; $stepTxt = __('Remove redundant columns'); - $legendText = __('Step 1.') . $step . " " . $stepTxt; + $legendText = __('Step 1.') . $step . ' ' . $stepTxt; $headText = __( - "Do you have a group of columns which on combining gives an existing" - . " column? For example, if you have first_name, last_name and" - . " full_name then combining first_name and last_name gives full_name" - . " which is redundant." + 'Do you have a group of columns which on combining gives an existing' + . ' column? For example, if you have first_name, last_name and' + . ' full_name then combining first_name and last_name gives full_name' + . ' which is redundant.' ); $subText = __( - "Check the columns which are redundant and click on remove. " + 'Check the columns which are redundant and click on remove. ' . "If no redundant column, click on 'No redundant column'" ); - $extra = $this->getHtmlForColumnsList($db, $table, 'all', "checkbox") . "
" + $extra = $this->getHtmlForColumnsList($db, $table, 'all', 'checkbox') . '
' . '' . 'getHtmlForColumnsList($db, $table, 'all', "checkbox") . "
" + $extra = $this->getHtmlForColumnsList($db, $table, 'all', 'checkbox') . '
' . '' . 'getColumns(); $pk = []; $subText = ''; - $selectPkForm = ""; - $extra = ""; + $selectPkForm = ''; + $extra = ''; foreach ($primarycols as $col) { $pk[] = $col->getName(); $selectPkForm .= '" . sprintf( + $extra .= '' . sprintf( __('\'%1$s\' depends on:'), htmlspecialchars($column) - ) . "
"; + ) . '
'; $extra .= '
' . $selectPkForm . '


'; @@ -600,7 +600,7 @@ class Normalization */ public function getHtmlForNewTables3NF($dependencies, array $tables, $db) { - $html = ""; + $html = ''; $i = 1; $newTables = []; foreach ($tables as $table => $arrDependson) { @@ -639,8 +639,8 @@ class Normalization . (count($dependents) > 0 ? ', ' : '') . htmlspecialchars(implode(', ', $dependents)) . ' )'; $newTables[$table][$tableName] = [ - "pk" => $key, - "nonpk" => implode(', ', $dependents), + 'pk' => $key, + 'nonpk' => implode(', ', $dependents), ]; $i++; $tableName = 'table' . $i; @@ -827,8 +827,8 @@ class Normalization */ public function getHtmlFor3NFstep1($db, array $tables) { - $legendText = __('Step 3.') . "1 " . __('Find transitive dependencies'); - $extra = ""; + $legendText = __('Step 3.') . '1 ' . __('Find transitive dependencies'); + $extra = ''; $headText = __( 'Please answer the following question(s) ' . 'carefully to obtain a correct normalization.' @@ -845,7 +845,7 @@ class Normalization foreach ($tables as $table) { $primary = Index::getPrimary($table, $db); $primarycols = $primary->getColumns(); - $selectTdForm = ""; + $selectTdForm = ''; $pk = []; foreach ($primarycols as $col) { $pk[] = $col->getName(); @@ -868,11 +868,11 @@ class Normalization foreach ($columns as $column) { if (! in_array($column, $pk)) { $cnt++; - $extra .= "" . sprintf( + $extra .= '' . sprintf( __('\'%1$s\' depends on:'), htmlspecialchars($column) ) - . "
"; + . '

'; $extra .= '
' @@ -881,13 +881,13 @@ class Normalization } } } - if ($extra == "") { + if ($extra == '') { $headText = __( - "No Transitive dependencies possible as the table " + 'No Transitive dependencies possible as the table ' . "doesn't have any non primary key columns" ); - $subText = ""; - $extra = "

" . __("Table is already in Third normal form!") . "

"; + $subText = ''; + $extra = '

' . __('Table is already in Third normal form!') . '

'; } return [ 'legendText' => $legendText, @@ -931,7 +931,7 @@ class Normalization . "" . __( 'Hint: Please follow the procedure carefully in order ' . 'to obtain correct normalization' - ) . "" + ) . '' . '' . '' . '
' diff --git a/libraries/classes/Operations.php b/libraries/classes/Operations.php index 610c5636a4..d285311b9a 100644 --- a/libraries/classes/Operations.php +++ b/libraries/classes/Operations.php @@ -645,8 +645,8 @@ class Operations && $GLOBALS['is_reload_priv'] ) { $this->dbi->selectDb('mysql'); - $newname = str_replace("_", "\_", $newname); - $oldDb = str_replace("_", "\_", $oldDb); + $newname = str_replace('_', '\_', $newname); + $oldDb = str_replace('_', '\_', $oldDb); // For Db specific privileges $query_db_specific = 'UPDATE ' . Util::backquote('db') @@ -673,7 +673,7 @@ class Operations $this->dbi->query($query_proc_specific); // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; + $flush_query = 'FLUSH PRIVILEGES;'; $this->dbi->query($flush_query); } } @@ -693,8 +693,8 @@ class Operations && $GLOBALS['is_reload_priv'] ) { $this->dbi->selectDb('mysql'); - $newname = str_replace("_", "\_", $newname); - $oldDb = str_replace("_", "\_", $oldDb); + $newname = str_replace('_', '\_', $newname); + $oldDb = str_replace('_', '\_', $oldDb); $query_db_specific_old = 'SELECT * FROM ' . Util::backquote('db') . ' WHERE ' @@ -777,7 +777,7 @@ class Operations } // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; + $flush_query = 'FLUSH PRIVILEGES;'; $this->dbi->query($flush_query); } } @@ -2047,7 +2047,7 @@ class Operations $this->dbi->query($query_col_specific); // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; + $flush_query = 'FLUSH PRIVILEGES;'; $this->dbi->query($flush_query); } } @@ -2110,7 +2110,7 @@ class Operations } // Finally FLUSH the new privileges - $flush_query = "FLUSH PRIVILEGES;"; + $flush_query = 'FLUSH PRIVILEGES;'; $this->dbi->query($flush_query); } } diff --git a/libraries/classes/Partition.php b/libraries/classes/Partition.php index 313034fc6d..05f7d656aa 100644 --- a/libraries/classes/Partition.php +++ b/libraries/classes/Partition.php @@ -155,7 +155,7 @@ class Partition extends SubPartition { if (Partition::havePartitioning()) { $result = $GLOBALS['dbi']->fetchResult( - "SELECT * FROM `information_schema`.`PARTITIONS`" + 'SELECT * FROM `information_schema`.`PARTITIONS`' . " WHERE `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($db) . "' AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($table) . "'" ); @@ -196,7 +196,7 @@ class Partition extends SubPartition { if (Partition::havePartitioning()) { return $GLOBALS['dbi']->fetchResult( - "SELECT DISTINCT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`" + 'SELECT DISTINCT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`' . " WHERE `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($db) . "' AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($table) . "'" ); @@ -217,10 +217,10 @@ class Partition extends SubPartition { if (Partition::havePartitioning()) { $partition_method = $GLOBALS['dbi']->fetchResult( - "SELECT `PARTITION_METHOD` FROM `information_schema`.`PARTITIONS`" + 'SELECT `PARTITION_METHOD` FROM `information_schema`.`PARTITIONS`' . " WHERE `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($db) . "'" . " AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($table) . "'" - . " LIMIT 1" + . ' LIMIT 1' ); if (! empty($partition_method)) { return $partition_method[0]; @@ -246,7 +246,7 @@ class Partition extends SubPartition if (! $already_checked) { if ($GLOBALS['dbi']->getVersion() < 50600) { if ($GLOBALS['dbi']->fetchValue( - "SELECT @@have_partitioning;" + 'SELECT @@have_partitioning;' )) { $have_partitioning = true; } @@ -254,7 +254,7 @@ class Partition extends SubPartition $have_partitioning = true; } else { // see https://dev.mysql.com/doc/refman/5.6/en/partitioning.html - $plugins = $GLOBALS['dbi']->fetchResult("SHOW PLUGINS"); + $plugins = $GLOBALS['dbi']->fetchResult('SHOW PLUGINS'); foreach ($plugins as $value) { if ($value['Name'] == 'partition') { $have_partitioning = true; diff --git a/libraries/classes/Plugins.php b/libraries/classes/Plugins.php index 1c735b0742..bc727a9c94 100644 --- a/libraries/classes/Plugins.php +++ b/libraries/classes/Plugins.php @@ -53,7 +53,7 @@ class Plugins . mb_strtolower(mb_substr($plugin_type, 1)) . mb_strtoupper($plugin_format[0]) . mb_strtolower(mb_substr($plugin_format, 1)); - $file = $class_name . ".php"; + $file = $class_name . '.php'; if (is_file($plugins_dir . $file)) { //include_once $plugins_dir . $file; $fqnClass = 'PhpMyAdmin\\' . str_replace('/', '\\', mb_substr($plugins_dir, 18)) . $class_name; @@ -292,7 +292,7 @@ class Plugins $properties = null; if (! $is_subgroup) { // for subgroup headers - if (mb_strpos(get_class($propertyGroup), "PropertyItem")) { + if (mb_strpos(get_class($propertyGroup), 'PropertyItem')) { $properties = [$propertyGroup]; } else { // for main groups @@ -323,7 +323,7 @@ class Plugins foreach ($properties as $propertyItem) { $property_class = get_class($propertyItem); // if the property is a subgroup, we deal with it recursively - if (mb_strpos($property_class, "Subgroup")) { + if (mb_strpos($property_class, 'Subgroup')) { // for subgroups // each subgroup can have a header, which may also be a form element /** @var OptionsPropertyItem $subgroup_header */ @@ -371,7 +371,7 @@ class Plugins } } - if (method_exists($propertyGroup, "getDoc")) { + if (method_exists($propertyGroup, 'getDoc')) { $doc = $propertyGroup->getDoc(); if ($doc != null) { if (count($doc) === 3) { diff --git a/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/libraries/classes/Plugins/Auth/AuthenticationCookie.php index a24f65fd33..c90dad57e0 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationCookie.php +++ b/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -249,7 +249,7 @@ class AuthenticationCookie extends AuthenticationPlugin if (! empty($GLOBALS['cfg']['CaptchaLoginPrivateKey']) && ! empty($GLOBALS['cfg']['CaptchaLoginPublicKey']) ) { - if (! empty($_POST["g-recaptcha-response"])) { + if (! empty($_POST['g-recaptcha-response'])) { if (function_exists('curl_init')) { $reCaptcha = new ReCaptcha\ReCaptcha( $GLOBALS['cfg']['CaptchaLoginPrivateKey'], @@ -269,7 +269,7 @@ class AuthenticationCookie extends AuthenticationPlugin // verify captcha status. $resp = $reCaptcha->verify( - $_POST["g-recaptcha-response"], + $_POST['g-recaptcha-response'], Core::getIp() ); diff --git a/libraries/classes/Plugins/Export/ExportCodegen.php b/libraries/classes/Plugins/Export/ExportCodegen.php index 20017a06c9..82ee8d915f 100644 --- a/libraries/classes/Plugins/Export/ExportCodegen.php +++ b/libraries/classes/Plugins/Export/ExportCodegen.php @@ -60,15 +60,15 @@ class ExportCodegen extends ExportPlugin { $this->_setCgFormats( [ - "NHibernate C# DO", - "NHibernate XML", + 'NHibernate C# DO', + 'NHibernate XML', ] ); $this->_setCgHandlers( [ - "_handleNHibernateCSBody", - "_handleNHibernateXMLBody", + '_handleNHibernateCSBody', + '_handleNHibernateXMLBody', ] ); } @@ -90,16 +90,16 @@ class ExportCodegen extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); + $leaf = new HiddenPropertyItem('structure_or_data'); $generalOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - "format", + 'format', __('Format:') ); $leaf->setValues($this->_getCgFormats()); @@ -203,7 +203,7 @@ class ExportCodegen extends ExportPlugin ); } - return $this->export->outputHandler(sprintf("%s is not supported.", $format)); + return $this->export->outputHandler(sprintf('%s is not supported.', $format)); } /** @@ -357,7 +357,7 @@ class ExportCodegen extends ExportPlugin . 'table="' . ExportCodegen::cgMakeIdentifier($table_alias) . '">'; $result = $GLOBALS['dbi']->query( sprintf( - "DESC %s.%s", + 'DESC %s.%s', Util::backquote($db), Util::backquote($table) ) diff --git a/libraries/classes/Plugins/Export/ExportCsv.php b/libraries/classes/Plugins/Export/ExportCsv.php index 5995a12d5f..d4bfa38980 100644 --- a/libraries/classes/Plugins/Export/ExportCsv.php +++ b/libraries/classes/Plugins/Export/ExportCsv.php @@ -54,29 +54,29 @@ class ExportCsv extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create leaf items and add them to the group $leaf = new TextPropertyItem( - "separator", + 'separator', __('Columns separated with:') ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "enclosed", + 'enclosed', __('Columns enclosed with:') ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "escaped", + 'escaped', __('Columns escaped with:') ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "terminated", + 'terminated', __('Lines terminated with:') ); $generalOptions->addProperty($leaf); @@ -296,7 +296,7 @@ class ExportCsv extends ExportPlugin "\r", "\n", ], - "", + '', $row[$j] ); } diff --git a/libraries/classes/Plugins/Export/ExportExcel.php b/libraries/classes/Plugins/Export/ExportExcel.php index 2c64903638..6391617c21 100644 --- a/libraries/classes/Plugins/Export/ExportExcel.php +++ b/libraries/classes/Plugins/Export/ExportExcel.php @@ -42,11 +42,11 @@ class ExportExcel extends ExportCsv // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group $leaf = new TextPropertyItem( 'null', diff --git a/libraries/classes/Plugins/Export/ExportHtmlword.php b/libraries/classes/Plugins/Export/ExportHtmlword.php index 255c1ca871..3468643675 100644 --- a/libraries/classes/Plugins/Export/ExportHtmlword.php +++ b/libraries/classes/Plugins/Export/ExportHtmlword.php @@ -57,16 +57,16 @@ class ExportHtmlword extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // what to dump (structure/data/both) $dumpWhat = new OptionsPropertyMainGroup( - "dump_what", + 'dump_what', __('Dump table') ); // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); + $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( [ 'structure' => __('structure'), @@ -80,18 +80,18 @@ class ExportHtmlword extends ExportPlugin // data options main group $dataOptions = new OptionsPropertyMainGroup( - "dump_what", + 'dump_what', __('Data dump options') ); $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new TextPropertyItem( - "null", + 'null', __('Replace NULL with:') ); $dataOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "columns", + 'columns', __('Put columns names in the first row') ); $dataOptions->addProperty($leaf); diff --git a/libraries/classes/Plugins/Export/ExportJson.php b/libraries/classes/Plugins/Export/ExportJson.php index 4c0f1fb246..f4311dc391 100644 --- a/libraries/classes/Plugins/Export/ExportJson.php +++ b/libraries/classes/Plugins/Export/ExportJson.php @@ -77,13 +77,13 @@ class ExportJson extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); + $leaf = new HiddenPropertyItem('structure_or_data'); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( @@ -227,7 +227,7 @@ class ExportJson extends ExportPlugin 'type' => 'table', 'name' => $table_alias, 'database' => $db_alias, - 'data' => "@@DATA@@", + 'data' => '@@DATA@@', ] ); list($header, $footer) = explode('"@@DATA@@"', $buffer); diff --git a/libraries/classes/Plugins/Export/ExportLatex.php b/libraries/classes/Plugins/Export/ExportLatex.php index cfcec3f114..1ef97ac088 100644 --- a/libraries/classes/Plugins/Export/ExportLatex.php +++ b/libraries/classes/Plugins/Export/ExportLatex.php @@ -79,14 +79,14 @@ class ExportLatex extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "caption", + 'caption', __('Include table caption') ); $generalOptions->addProperty($leaf); @@ -95,11 +95,11 @@ class ExportLatex extends ExportPlugin // what to dump (structure/data/both) main group $dumpWhat = new OptionsPropertyMainGroup( - "dump_what", + 'dump_what', __('Dump table') ); // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); + $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( [ 'structure' => __('structure'), @@ -114,44 +114,44 @@ class ExportLatex extends ExportPlugin // structure options main group if (! $hide_structure) { $structureOptions = new OptionsPropertyMainGroup( - "structure", + 'structure', __('Object creation options') ); $structureOptions->setForce('data'); // create primary items and add them to the group $leaf = new TextPropertyItem( - "structure_caption", + 'structure_caption', __('Table caption:') ); $leaf->setDoc('faq6-27'); $structureOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "structure_continued_caption", + 'structure_continued_caption', __('Table caption (continued):') ); $leaf->setDoc('faq6-27'); $structureOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "structure_label", + 'structure_label', __('Label key:') ); $leaf->setDoc('faq6-27'); $structureOptions->addProperty($leaf); if (! empty($GLOBALS['cfgRelation']['relation'])) { $leaf = new BoolPropertyItem( - "relation", + 'relation', __('Display foreign key relationships') ); $structureOptions->addProperty($leaf); } $leaf = new BoolPropertyItem( - "comments", + 'comments', __('Display comments') ); $structureOptions->addProperty($leaf); if (! empty($GLOBALS['cfgRelation']['mimework'])) { $leaf = new BoolPropertyItem( - "mime", + 'mime', __('Display media types') ); $structureOptions->addProperty($leaf); @@ -162,30 +162,30 @@ class ExportLatex extends ExportPlugin // data options main group $dataOptions = new OptionsPropertyMainGroup( - "data", + 'data', __('Data dump options') ); $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "columns", + 'columns', __('Put columns names in the first row:') ); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "data_caption", + 'data_caption', __('Table caption:') ); $leaf->setDoc('faq6-27'); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "data_continued_caption", + 'data_continued_caption', __('Table caption (continued):') ); $leaf->setDoc('faq6-27'); $dataOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "data_label", + 'data_label', __('Label key:') ); $leaf->setDoc('faq6-27'); @@ -425,7 +425,7 @@ class ExportLatex extends ExportPlugin if ($i == ($columns_cnt - 1)) { $buffer .= $column_value; } else { - $buffer .= $column_value . " & "; + $buffer .= $column_value . ' & '; } } $buffer .= ' \\\\ \\hline ' . $crlf; diff --git a/libraries/classes/Plugins/Export/ExportMediawiki.php b/libraries/classes/Plugins/Export/ExportMediawiki.php index f2ca9dee62..957645f709 100644 --- a/libraries/classes/Plugins/Export/ExportMediawiki.php +++ b/libraries/classes/Plugins/Export/ExportMediawiki.php @@ -54,19 +54,19 @@ class ExportMediawiki extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group $generalOptions = new OptionsPropertyMainGroup( - "general_opts", + 'general_opts', __('Dump table') ); // what to dump (structure/data/both) $subgroup = new OptionsPropertySubgroup( - "dump_table", - __("Dump table") + 'dump_table', + __('Dump table') ); $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( @@ -81,14 +81,14 @@ class ExportMediawiki extends ExportPlugin // export table name $leaf = new BoolPropertyItem( - "caption", + 'caption', __('Export table names') ); $generalOptions->addProperty($leaf); // export table headers $leaf = new BoolPropertyItem( - "headers", + 'headers', __('Export table headers') ); $generalOptions->addProperty($leaf); @@ -208,12 +208,12 @@ class ExportMediawiki extends ExportPlugin // Print structure comment $output = $this->_exportComment( - "Table structure for " + 'Table structure for ' . Util::backquote($table_alias) ); // Begin the table construction - $output .= "{| class=\"wikitable\" style=\"text-align:center;\"" + $output .= '{| class="wikitable" style="text-align:center;"' . $this->_exportCRLF(); // Add the table name @@ -223,8 +223,8 @@ class ExportMediawiki extends ExportPlugin // Add the table headers if (isset($GLOBALS['mediawiki_headers'])) { - $output .= "|- style=\"background:#ffdead;\"" . $this->_exportCRLF(); - $output .= "! style=\"background:#ffffff\" | " + $output .= '|- style="background:#ffdead;"' . $this->_exportCRLF(); + $output .= '! style="background:#ffffff" | ' . $this->_exportCRLF(); for ($i = 0; $i < $row_cnt; ++$i) { $col_as = $columns[$i]['Field']; @@ -233,36 +233,36 @@ class ExportMediawiki extends ExportPlugin $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; } - $output .= " | " . $col_as . $this->_exportCRLF(); + $output .= ' | ' . $col_as . $this->_exportCRLF(); } } // Add the table structure - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Type" . $this->_exportCRLF(); + $output .= '|-' . $this->_exportCRLF(); + $output .= '! Type' . $this->_exportCRLF(); for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Type'] . $this->_exportCRLF(); + $output .= ' | ' . $columns[$i]['Type'] . $this->_exportCRLF(); } - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Null" . $this->_exportCRLF(); + $output .= '|-' . $this->_exportCRLF(); + $output .= '! Null' . $this->_exportCRLF(); for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Null'] . $this->_exportCRLF(); + $output .= ' | ' . $columns[$i]['Null'] . $this->_exportCRLF(); } - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Default" . $this->_exportCRLF(); + $output .= '|-' . $this->_exportCRLF(); + $output .= '! Default' . $this->_exportCRLF(); for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Default'] . $this->_exportCRLF(); + $output .= ' | ' . $columns[$i]['Default'] . $this->_exportCRLF(); } - $output .= "|-" . $this->_exportCRLF(); - $output .= "! Extra" . $this->_exportCRLF(); + $output .= '|-' . $this->_exportCRLF(); + $output .= '! Extra' . $this->_exportCRLF(); for ($i = 0; $i < $row_cnt; ++$i) { - $output .= " | " . $columns[$i]['Extra'] . $this->_exportCRLF(); + $output .= ' | ' . $columns[$i]['Extra'] . $this->_exportCRLF(); } - $output .= "|}" . str_repeat($this->_exportCRLF(), 2); + $output .= '|}' . str_repeat($this->_exportCRLF(), 2); break; } // end switch @@ -295,13 +295,13 @@ class ExportMediawiki extends ExportPlugin // Print data comment $output = $this->_exportComment( - "Table data for " . Util::backquote($table_alias) + 'Table data for ' . Util::backquote($table_alias) ); // Begin the table construction // Use the "wikitable" class for style // Use the "sortable" class for allowing tables to be sorted by column - $output .= "{| class=\"wikitable sortable\" style=\"text-align:center;\"" + $output .= '{| class="wikitable sortable" style="text-align:center;"' . $this->_exportCRLF(); // Add the table name @@ -317,7 +317,7 @@ class ExportMediawiki extends ExportPlugin // Add column names as table headers if ($column_names !== null) { // Use '|-' for separating rows - $output .= "|-" . $this->_exportCRLF(); + $output .= '|-' . $this->_exportCRLF(); // Use '!' for separating table headers foreach ($column_names as $column) { @@ -326,7 +326,7 @@ class ExportMediawiki extends ExportPlugin $column = $aliases[$db]['tables'][$table]['columns'][$column]; } - $output .= " ! " . $column . "" . $this->_exportCRLF(); + $output .= ' ! ' . $column . '' . $this->_exportCRLF(); } } } @@ -340,16 +340,16 @@ class ExportMediawiki extends ExportPlugin $fields_cnt = $GLOBALS['dbi']->numFields($result); while ($row = $GLOBALS['dbi']->fetchRow($result)) { - $output .= "|-" . $this->_exportCRLF(); + $output .= '|-' . $this->_exportCRLF(); // Use '|' for separating table columns for ($i = 0; $i < $fields_cnt; ++$i) { - $output .= " | " . $row[$i] . "" . $this->_exportCRLF(); + $output .= ' | ' . $row[$i] . '' . $this->_exportCRLF(); } } // End table construction - $output .= "|}" . str_repeat($this->_exportCRLF(), 2); + $output .= '|}' . str_repeat($this->_exportCRLF(), 2); return $this->export->outputHandler($output); } diff --git a/libraries/classes/Plugins/Export/ExportOds.php b/libraries/classes/Plugins/Export/ExportOds.php index fa6709a691..9f37ba6025 100644 --- a/libraries/classes/Plugins/Export/ExportOds.php +++ b/libraries/classes/Plugins/Export/ExportOds.php @@ -58,23 +58,23 @@ class ExportOds extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group $leaf = new TextPropertyItem( - "null", + 'null', __('Replace NULL with:') ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "columns", + 'columns', __('Put columns names in the first row') ); $generalOptions->addProperty($leaf); - $leaf = new HiddenPropertyItem("structure_or_data"); + $leaf = new HiddenPropertyItem('structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); @@ -282,31 +282,31 @@ class ExportOds extends ExportPlugin .= '' . '' . ''; - } elseif ($fields_meta[$j]->type == "date") { + } elseif ($fields_meta[$j]->type == 'date') { $GLOBALS['ods_buffer'] .= '' . '' . htmlspecialchars($row[$j]) . '' . ''; - } elseif ($fields_meta[$j]->type == "time") { + } elseif ($fields_meta[$j]->type == 'time') { $GLOBALS['ods_buffer'] .= '' . '' . htmlspecialchars($row[$j]) . '' . ''; - } elseif ($fields_meta[$j]->type == "datetime") { + } elseif ($fields_meta[$j]->type == 'datetime') { $GLOBALS['ods_buffer'] .= '' . '' . htmlspecialchars($row[$j]) diff --git a/libraries/classes/Plugins/Export/ExportOdt.php b/libraries/classes/Plugins/Export/ExportOdt.php index de63708eae..51e83ee628 100644 --- a/libraries/classes/Plugins/Export/ExportOdt.php +++ b/libraries/classes/Plugins/Export/ExportOdt.php @@ -68,16 +68,16 @@ class ExportOdt extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // what to dump (structure/data/both) main group $dumpWhat = new OptionsPropertyMainGroup( - "general_opts", + 'general_opts', __('Dump table') ); // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); + $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( [ 'structure' => __('structure'), @@ -92,26 +92,26 @@ class ExportOdt extends ExportPlugin // structure options main group if (! $hide_structure) { $structureOptions = new OptionsPropertyMainGroup( - "structure", + 'structure', __('Object creation options') ); $structureOptions->setForce('data'); // create primary items and add them to the group if (! empty($GLOBALS['cfgRelation']['relation'])) { $leaf = new BoolPropertyItem( - "relation", + 'relation', __('Display foreign key relationships') ); $structureOptions->addProperty($leaf); } $leaf = new BoolPropertyItem( - "comments", + 'comments', __('Display comments') ); $structureOptions->addProperty($leaf); if (! empty($GLOBALS['cfgRelation']['mimework'])) { $leaf = new BoolPropertyItem( - "mime", + 'mime', __('Display media types') ); $structureOptions->addProperty($leaf); @@ -122,13 +122,13 @@ class ExportOdt extends ExportPlugin // data options main group $dataOptions = new OptionsPropertyMainGroup( - "data", + 'data', __('Data dump options') ); $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "columns", + 'columns', __('Put columns names in the first row') ); $dataOptions->addProperty($leaf); diff --git a/libraries/classes/Plugins/Export/ExportPdf.php b/libraries/classes/Plugins/Export/ExportPdf.php index 7fc800cae1..8552b6a656 100644 --- a/libraries/classes/Plugins/Export/ExportPdf.php +++ b/libraries/classes/Plugins/Export/ExportPdf.php @@ -92,14 +92,14 @@ class ExportPdf extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group $leaf = new TextPropertyItem( - "report_title", + 'report_title', __('Report title:') ); $generalOptions->addProperty($leaf); @@ -108,10 +108,10 @@ class ExportPdf extends ExportPlugin // what to dump (structure/data/both) main group $dumpWhat = new OptionsPropertyMainGroup( - "dump_what", + 'dump_what', __('Dump table') ); - $leaf = new RadioPropertyItem("structure_or_data"); + $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( [ 'structure' => __('structure'), diff --git a/libraries/classes/Plugins/Export/ExportPhparray.php b/libraries/classes/Plugins/Export/ExportPhparray.php index 2f05fbd3e2..113e0a3ecb 100644 --- a/libraries/classes/Plugins/Export/ExportPhparray.php +++ b/libraries/classes/Plugins/Export/ExportPhparray.php @@ -52,13 +52,13 @@ class ExportPhparray extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); + $leaf = new HiddenPropertyItem('structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); @@ -239,7 +239,7 @@ class ExportPhparray extends ExportPlugin for ($i = 0; $i < $columns_cnt; $i++) { $buffer .= var_export($columns[$i], true) - . " => " . var_export($record[$i], true) + . ' => ' . var_export($record[$i], true) . (($i + 1 >= $columns_cnt) ? '' : ','); } diff --git a/libraries/classes/Plugins/Export/ExportSql.php b/libraries/classes/Plugins/Export/ExportSql.php index d50a0a8f4d..4fe2aee404 100644 --- a/libraries/classes/Plugins/Export/ExportSql.php +++ b/libraries/classes/Plugins/Export/ExportSql.php @@ -88,14 +88,14 @@ class ExportSql extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // comments - $subgroup = new OptionsPropertySubgroup("include_comments"); + $subgroup = new OptionsPropertySubgroup('include_comments'); $leaf = new BoolPropertyItem( 'include_comments', __( @@ -136,7 +136,7 @@ class ExportSql extends ExportPlugin // enclose in a transaction $leaf = new BoolPropertyItem( - "use_transaction", + 'use_transaction', __('Enclose export in a transaction') ); $leaf->setDoc( @@ -150,7 +150,7 @@ class ExportSql extends ExportPlugin // disable foreign key checks $leaf = new BoolPropertyItem( - "disable_fk", + 'disable_fk', __('Disable foreign key checks') ); $leaf->setDoc( @@ -164,14 +164,14 @@ class ExportSql extends ExportPlugin // export views as tables $leaf = new BoolPropertyItem( - "views_as_tables", + 'views_as_tables', __('Export views as tables') ); $generalOptions->addProperty($leaf); // export metadata $leaf = new BoolPropertyItem( - "metadata", + 'metadata', __('Export metadata') ); $generalOptions->addProperty($leaf); @@ -185,7 +185,7 @@ class ExportSql extends ExportPlugin } $leaf = new SelectPropertyItem( - "compatibility", + 'compatibility', __( 'Database system or older MySQL server to maximize output' . ' compatibility with:' @@ -205,8 +205,8 @@ class ExportSql extends ExportPlugin // what to dump (structure/data/both) $subgroup = new OptionsPropertySubgroup( - "dump_table", - __("Dump table") + 'dump_table', + __('Dump table') ); $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( @@ -225,7 +225,7 @@ class ExportSql extends ExportPlugin // structure options main group if (! $hide_structure) { $structureOptions = new OptionsPropertyMainGroup( - "structure", + 'structure', __('Object creation options') ); $structureOptions->setForce('data'); @@ -241,7 +241,7 @@ class ExportSql extends ExportPlugin // server export options if ($plugin_param['export_type'] == 'server') { $leaf = new BoolPropertyItem( - "drop_database", + 'drop_database', sprintf(__('Add %s statement'), 'DROP DATABASE IF EXISTS') ); $subgroup->addProperty($leaf); @@ -343,7 +343,7 @@ class ExportSql extends ExportPlugin $structureOptions->addProperty($subgroup); $leaf = new BoolPropertyItem( - "backquotes", + 'backquotes', __( 'Enclose table and column names with backquotes ' . '(Protects column and table names formed with' @@ -359,12 +359,12 @@ class ExportSql extends ExportPlugin // begin Data options $dataOptions = new OptionsPropertyMainGroup( - "data", + 'data', __('Data creation options') ); $dataOptions->setForce('structure'); $leaf = new BoolPropertyItem( - "truncate", + 'truncate', __('Truncate table before insert') ); $dataOptions->addProperty($leaf); @@ -377,7 +377,7 @@ class ExportSql extends ExportPlugin $subgroup->setSubgroupHeader($leaf); $leaf = new BoolPropertyItem( - "delayed", + 'delayed', __('INSERT DELAYED statements') ); $leaf->setDoc( @@ -389,7 +389,7 @@ class ExportSql extends ExportPlugin $subgroup->addProperty($leaf); $leaf = new BoolPropertyItem( - "ignore", + 'ignore', __('INSERT IGNORE statements') ); $leaf->setDoc( @@ -403,7 +403,7 @@ class ExportSql extends ExportPlugin // Function to use when dumping dat $leaf = new SelectPropertyItem( - "type", + 'type', __('Function to use when dumping data:') ); $leaf->setValues( @@ -423,7 +423,7 @@ class ExportSql extends ExportPlugin ); $subgroup->setSubgroupHeader($leaf); $leaf = new RadioPropertyItem( - "insert_syntax", + 'insert_syntax', __('INSERT IGNORE statements') ); $leaf->setValues( @@ -454,14 +454,14 @@ class ExportSql extends ExportPlugin // Max length of query $leaf = new NumberPropertyItem( - "max_query_size", + 'max_query_size', __('Maximal length of created query') ); $dataOptions->addProperty($leaf); // Dump binary columns in hexadecimal $leaf = new BoolPropertyItem( - "hex_for_binary", + 'hex_for_binary', __( 'Dump binary columns in hexadecimal notation' . ' (for example, "abc" becomes 0x616263)' @@ -471,7 +471,7 @@ class ExportSql extends ExportPlugin // Dump time in UTC $leaf = new BoolPropertyItem( - "utc_time", + 'utc_time', __( 'Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns' . ' to be dumped and reloaded between servers in different' @@ -972,14 +972,14 @@ class ExportSql extends ExportPlugin $delimiter = '$$'; $event_names = $GLOBALS['dbi']->fetchResult( - "SELECT EVENT_NAME FROM information_schema.EVENTS WHERE" + 'SELECT EVENT_NAME FROM information_schema.EVENTS WHERE' . " EVENT_SCHEMA= '" . $GLOBALS['dbi']->escapeString($db) . "';" ); if ($event_names) { $text .= $crlf - . "DELIMITER " . $delimiter . $crlf; + . 'DELIMITER ' . $delimiter . $crlf; $text .= $this->_exportComment() . $this->_exportComment(__('Events')) @@ -987,7 +987,7 @@ class ExportSql extends ExportPlugin foreach ($event_names as $event_name) { if (! empty($GLOBALS['sql_drop_table'])) { - $text .= "DROP EVENT " + $text .= 'DROP EVENT ' . Util::backquote($event_name) . $delimiter . $crlf; } @@ -995,7 +995,7 @@ class ExportSql extends ExportPlugin . $delimiter . $crlf . $crlf; } - $text .= "DELIMITER ;" . $crlf; + $text .= 'DELIMITER ;' . $crlf; } if (! empty($text)) { @@ -1120,10 +1120,10 @@ class ExportSql extends ExportPlugin if (in_array($type, $metadataTypes) && isset($cfgRelation[$type])) { // special case, designer pages and their coordinates if ($type == 'pdf_pages') { - $sql_query = "SELECT `page_nr`, `page_descr` FROM " + $sql_query = 'SELECT `page_nr`, `page_descr` FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation[$type]) - . " WHERE " . Util::backquote($dbNameColumn) + . '.' . Util::backquote($cfgRelation[$type]) + . ' WHERE ' . Util::backquote($dbNameColumn) . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; $result = $GLOBALS['dbi']->fetchResult( @@ -1134,12 +1134,12 @@ class ExportSql extends ExportPlugin foreach ($result as $page => $name) { // insert row for pdf_page - $sql_query_row = "SELECT `db_name`, `page_descr` FROM " + $sql_query_row = 'SELECT `db_name`, `page_descr` FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote( + . '.' . Util::backquote( $cfgRelation[$type] ) - . " WHERE " . Util::backquote( + . ' WHERE ' . Util::backquote( $dbNameColumn ) . " = '" . $GLOBALS['dbi']->escapeString($db) . "'" @@ -1158,16 +1158,16 @@ class ExportSql extends ExportPlugin } $lastPage = $GLOBALS['crlf'] - . "SET @LAST_PAGE = LAST_INSERT_ID();" + . 'SET @LAST_PAGE = LAST_INSERT_ID();' . $GLOBALS['crlf']; if (! $this->export->outputHandler($lastPage)) { return false; } - $sql_query_coords = "SELECT `db_name`, `table_name`, " + $sql_query_coords = 'SELECT `db_name`, `table_name`, ' . "'@LAST_PAGE' AS `pdf_page_number`, `x`, `y` FROM " . Util::backquote($cfgRelation['db']) - . "." . Util::backquote( + . '.' . Util::backquote( $cfgRelation['table_coords'] ) . " WHERE `pdf_page_number` = '" . $page . "'"; @@ -1193,21 +1193,21 @@ class ExportSql extends ExportPlugin // remove auto_incrementing id field for some tables if ($type == 'bookmark') { - $sql_query = "SELECT `dbase`, `user`, `label`, `query` FROM "; + $sql_query = 'SELECT `dbase`, `user`, `label`, `query` FROM '; } elseif ($type == 'column_info') { - $sql_query = "SELECT `db_name`, `table_name`, `column_name`," - . " `comment`, `mimetype`, `transformation`," - . " `transformation_options`, `input_transformation`," - . " `input_transformation_options` FROM"; + $sql_query = 'SELECT `db_name`, `table_name`, `column_name`,' + . ' `comment`, `mimetype`, `transformation`,' + . ' `transformation_options`, `input_transformation`,' + . ' `input_transformation_options` FROM'; } elseif ($type == 'savedsearches') { - $sql_query = "SELECT `username`, `db_name`, `search_name`," - . " `search_data` FROM"; + $sql_query = 'SELECT `username`, `db_name`, `search_name`,' + . ' `search_data` FROM'; } else { - $sql_query = "SELECT * FROM "; + $sql_query = 'SELECT * FROM '; } $sql_query .= Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation[$type]) - . " WHERE " . Util::backquote($dbNameColumn) + . ' WHERE ' . Util::backquote($dbNameColumn) . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; if (isset($table)) { $sql_query .= " AND `table_name` = '" @@ -1298,11 +1298,11 @@ class ExportSql extends ExportPlugin $db_alias = $db; $view_alias = $view; $this->initAlias($aliases, $db_alias, $view_alias); - $create_query = "CREATE TABLE"; + $create_query = 'CREATE TABLE'; if (isset($GLOBALS['sql_if_not_exists'])) { - $create_query .= " IF NOT EXISTS "; + $create_query .= ' IF NOT EXISTS '; } - $create_query .= Util::backquote($view_alias) . "(" . $crlf; + $create_query .= Util::backquote($view_alias) . '(' . $crlf; $columns = $GLOBALS['dbi']->getColumns($db, $view, null, true); @@ -1317,24 +1317,24 @@ class ExportSql extends ExportPlugin ); if (! $firstCol) { - $create_query .= "," . $crlf; + $create_query .= ',' . $crlf; } - $create_query .= " " . Util::backquote($col_alias); - $create_query .= " " . $column['Type']; + $create_query .= ' ' . Util::backquote($col_alias); + $create_query .= ' ' . $column['Type']; if ($extracted_columnspec['can_contain_collation'] && ! empty($column['Collation']) ) { - $create_query .= " COLLATE " . $column['Collation']; + $create_query .= ' COLLATE ' . $column['Collation']; } if ($column['Null'] == 'NO') { - $create_query .= " NOT NULL"; + $create_query .= ' NOT NULL'; } if (isset($column['Default'])) { $create_query .= " DEFAULT '" . $GLOBALS['dbi']->escapeString($column['Default']) . "'"; } else { if ($column['Null'] == 'YES') { - $create_query .= " DEFAULT NULL"; + $create_query .= ' DEFAULT NULL'; } } if (! empty($column['Comment'])) { @@ -1343,7 +1343,7 @@ class ExportSql extends ExportPlugin } $firstCol = false; } - $create_query .= $crlf . ")" . ($add_semicolon ? ';' : '') . $crlf; + $create_query .= $crlf . ')' . ($add_semicolon ? ';' : '') . $crlf; if (isset($GLOBALS['sql_compatibility'])) { $compat = $GLOBALS['sql_compatibility']; @@ -1516,7 +1516,7 @@ class ExportSql extends ExportPlugin // an error can happen, for example the table is crashed $tmp_error = $GLOBALS['dbi']->getError(); if ($tmp_error) { - $message = sprintf(__('Error reading structure for table %s:'), "$db.$table"); + $message = sprintf(__('Error reading structure for table %s:'), $db . '.' . $table); $message .= ' ' . $tmp_error; if (! defined('TESTSUITE')) { trigger_error($message, E_USER_ERROR); @@ -2250,7 +2250,7 @@ class ExportSql extends ExportPlugin // a possible error: the table has crashed $tmp_error = $GLOBALS['dbi']->getError(); if ($tmp_error) { - $message = sprintf(__('Error reading data for table %s:'), "$db.$table"); + $message = sprintf(__('Error reading data for table %s:'), $db . '.' . $table); $message .= ' ' . $tmp_error; if (! defined('TESTSUITE')) { trigger_error($message, E_USER_ERROR); @@ -2333,7 +2333,7 @@ class ExportSql extends ExportPlugin $table_alias, $compat, $sql_backquotes - ) . ";"; + ) . ';'; $truncatehead = $this->_possibleCRLF() . $this->_exportComment() . $this->_exportComment( @@ -2590,7 +2590,7 @@ class ExportSql extends ExportPlugin // 6. DOUBLE field doesn't exists, we will use FLOAT instead $create_query = preg_replace( - "/^CREATE TABLE IF NOT EXISTS/", + '/^CREATE TABLE IF NOT EXISTS/', 'CREATE TABLE', $create_query ); diff --git a/libraries/classes/Plugins/Export/ExportTexytext.php b/libraries/classes/Plugins/Export/ExportTexytext.php index 7587e1bfba..465ca6117f 100644 --- a/libraries/classes/Plugins/Export/ExportTexytext.php +++ b/libraries/classes/Plugins/Export/ExportTexytext.php @@ -56,16 +56,16 @@ class ExportTexytext extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // what to dump (structure/data/both) main group $dumpWhat = new OptionsPropertyMainGroup( - "general_opts", + 'general_opts', __('Dump table') ); // create primary items and add them to the group - $leaf = new RadioPropertyItem("structure_or_data"); + $leaf = new RadioPropertyItem('structure_or_data'); $leaf->setValues( [ 'structure' => __('structure'), @@ -79,13 +79,13 @@ class ExportTexytext extends ExportPlugin // data options main group $dataOptions = new OptionsPropertyMainGroup( - "data", + 'data', __('Data dump options') ); $dataOptions->setForce('structure'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "columns", + 'columns', __('Put columns names in the first row') ); $dataOptions->addProperty($leaf); diff --git a/libraries/classes/Plugins/Export/ExportXml.php b/libraries/classes/Plugins/Export/ExportXml.php index fb016161d9..6206ef6353 100644 --- a/libraries/classes/Plugins/Export/ExportXml.php +++ b/libraries/classes/Plugins/Export/ExportXml.php @@ -87,51 +87,51 @@ class ExportXml extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); + $leaf = new HiddenPropertyItem('structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); // export structure main group $structure = new OptionsPropertyMainGroup( - "structure", + 'structure', __('Object creation options (all are recommended)') ); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "export_events", + 'export_events', __('Events') ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - "export_functions", + 'export_functions', __('Functions') ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - "export_procedures", + 'export_procedures', __('Procedures') ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - "export_tables", + 'export_tables', __('Tables') ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - "export_triggers", + 'export_triggers', __('Triggers') ); $structure->addProperty($leaf); $leaf = new BoolPropertyItem( - "export_views", + 'export_views', __('Views') ); $structure->addProperty($leaf); @@ -139,12 +139,12 @@ class ExportXml extends ExportPlugin // data main group $data = new OptionsPropertyMainGroup( - "data", + 'data', __('Data dump options') ); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "export_contents", + 'export_contents', __('Export contents') ); $data->addProperty($leaf); @@ -200,7 +200,7 @@ class ExportXml extends ExportPlugin $sql = htmlspecialchars(rtrim($sql)); $sql = str_replace("\n", "\n ", $sql); - $head .= " " . $sql . $crlf; + $head .= ' ' . $sql . $crlf; $head .= ' ' . $crlf; } } @@ -311,7 +311,7 @@ class ExportXml extends ExportPlugin $head .= ' ' . $crlf; - $tbl = " " . htmlspecialchars($tbl); + $tbl = ' ' . htmlspecialchars($tbl); $tbl = str_replace("\n", "\n ", $tbl); $head .= $tbl . ';' . $crlf; @@ -330,7 +330,7 @@ class ExportXml extends ExportPlugin // Do some formatting $code = mb_substr(rtrim($code), 0, -3); - $code = " " . htmlspecialchars($code); + $code = ' ' . htmlspecialchars($code); $code = str_replace("\n", "\n ", $code); $head .= $code . $crlf; @@ -359,7 +359,7 @@ class ExportXml extends ExportPlugin ) { // Export events $events = $GLOBALS['dbi']->fetchResult( - "SELECT EVENT_NAME FROM information_schema.EVENTS " + 'SELECT EVENT_NAME FROM information_schema.EVENTS ' . "WHERE EVENT_SCHEMA='" . $GLOBALS['dbi']->escapeString($db) . "'" ); diff --git a/libraries/classes/Plugins/Export/ExportYaml.php b/libraries/classes/Plugins/Export/ExportYaml.php index 23d661c2e8..c008efb812 100644 --- a/libraries/classes/Plugins/Export/ExportYaml.php +++ b/libraries/classes/Plugins/Export/ExportYaml.php @@ -52,13 +52,13 @@ class ExportYaml extends ExportPlugin // $exportPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group - $leaf = new HiddenPropertyItem("structure_or_data"); + $leaf = new HiddenPropertyItem('structure_or_data'); $generalOptions->addProperty($leaf); // add the main group to the root group $exportSpecificOptions->addProperty($generalOptions); diff --git a/libraries/classes/Plugins/Export/Helpers/TableProperty.php b/libraries/classes/Plugins/Export/Helpers/TableProperty.php index ebdaf2c521..2a8415ec0e 100644 --- a/libraries/classes/Plugins/Export/Helpers/TableProperty.php +++ b/libraries/classes/Plugins/Export/Helpers/TableProperty.php @@ -83,7 +83,7 @@ class TableProperty */ public function getPureType() { - $pos = mb_strpos($this->type, "("); + $pos = mb_strpos($this->type, '('); if ($pos > 0) { return mb_substr($this->type, 0, $pos); } @@ -97,7 +97,7 @@ class TableProperty */ public function isNotNull() { - return $this->nullable === "NO" ? "true" : "false"; + return $this->nullable === 'NO' ? 'true' : 'false'; } /** @@ -107,7 +107,7 @@ class TableProperty */ public function isUnique(): string { - return ($this->key === "PRI" || $this->key === "UNI") ? "true" : "false"; + return ($this->key === 'PRI' || $this->key === 'UNI') ? 'true' : 'false'; } /** @@ -117,31 +117,31 @@ class TableProperty */ public function getDotNetPrimitiveType() { - if (mb_strpos($this->type, "int") === 0) { - return "int"; + if (mb_strpos($this->type, 'int') === 0) { + return 'int'; } - if (mb_strpos($this->type, "longtext") === 0) { - return "string"; + if (mb_strpos($this->type, 'longtext') === 0) { + return 'string'; } - if (mb_strpos($this->type, "long") === 0) { - return "long"; + if (mb_strpos($this->type, 'long') === 0) { + return 'long'; } - if (mb_strpos($this->type, "char") === 0) { - return "string"; + if (mb_strpos($this->type, 'char') === 0) { + return 'string'; } - if (mb_strpos($this->type, "varchar") === 0) { - return "string"; + if (mb_strpos($this->type, 'varchar') === 0) { + return 'string'; } - if (mb_strpos($this->type, "text") === 0) { - return "string"; + if (mb_strpos($this->type, 'text') === 0) { + return 'string'; } - if (mb_strpos($this->type, "tinyint") === 0) { - return "bool"; + if (mb_strpos($this->type, 'tinyint') === 0) { + return 'bool'; } - if (mb_strpos($this->type, "datetime") === 0) { - return "DateTime"; + if (mb_strpos($this->type, 'datetime') === 0) { + return 'DateTime'; } - return "unknown"; + return 'unknown'; } /** @@ -151,31 +151,31 @@ class TableProperty */ public function getDotNetObjectType() { - if (mb_strpos($this->type, "int") === 0) { - return "Int32"; + if (mb_strpos($this->type, 'int') === 0) { + return 'Int32'; } - if (mb_strpos($this->type, "longtext") === 0) { - return "String"; + if (mb_strpos($this->type, 'longtext') === 0) { + return 'String'; } - if (mb_strpos($this->type, "long") === 0) { - return "Long"; + if (mb_strpos($this->type, 'long') === 0) { + return 'Long'; } - if (mb_strpos($this->type, "char") === 0) { - return "String"; + if (mb_strpos($this->type, 'char') === 0) { + return 'String'; } - if (mb_strpos($this->type, "varchar") === 0) { - return "String"; + if (mb_strpos($this->type, 'varchar') === 0) { + return 'String'; } - if (mb_strpos($this->type, "text") === 0) { - return "String"; + if (mb_strpos($this->type, 'text') === 0) { + return 'String'; } - if (mb_strpos($this->type, "tinyint") === 0) { - return "Boolean"; + if (mb_strpos($this->type, 'tinyint') === 0) { + return 'Boolean'; } - if (mb_strpos($this->type, "datetime") === 0) { - return "DateTime"; + if (mb_strpos($this->type, 'datetime') === 0) { + return 'DateTime'; } - return "Unknown"; + return 'Unknown'; } /** @@ -186,11 +186,11 @@ class TableProperty public function getIndexName() { if (strlen($this->key) > 0) { - return "index=\"" + return 'index="' . htmlspecialchars($this->name, ENT_COMPAT, 'UTF-8') - . "\""; + . '"'; } - return ""; + return ''; } /** @@ -200,7 +200,7 @@ class TableProperty */ public function isPK(): bool { - return $this->key === "PRI"; + return $this->key === 'PRI'; } /** diff --git a/libraries/classes/Plugins/Import/AbstractImportCsv.php b/libraries/classes/Plugins/Import/AbstractImportCsv.php index 146e75c4df..c2d42963b4 100644 --- a/libraries/classes/Plugins/Import/AbstractImportCsv.php +++ b/libraries/classes/Plugins/Import/AbstractImportCsv.php @@ -39,15 +39,15 @@ abstract class AbstractImportCsv extends ImportPlugin // $importPluginProperties // this will be shown as "Format specific options" $importSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create common items and add them to the group $leaf = new BoolPropertyItem( - "replace", + 'replace', __( 'Update data when duplicate keys found on import (add ON DUPLICATE ' . 'KEY UPDATE)' @@ -55,27 +55,27 @@ abstract class AbstractImportCsv extends ImportPlugin ); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "terminated", + 'terminated', __('Columns separated with:') ); $leaf->setSize(2); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "enclosed", + 'enclosed', __('Columns enclosed with:') ); $leaf->setSize(2); $leaf->setLen(2); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "escaped", + 'escaped', __('Columns escaped with:') ); $leaf->setSize(2); $leaf->setLen(2); $generalOptions->addProperty($leaf); $leaf = new TextPropertyItem( - "new_line", + 'new_line', __('Lines terminated with:') ); $leaf->setSize(2); diff --git a/libraries/classes/Plugins/Import/ImportCsv.php b/libraries/classes/Plugins/Import/ImportCsv.php index df767ed0a8..13beb88b42 100644 --- a/libraries/classes/Plugins/Import/ImportCsv.php +++ b/libraries/classes/Plugins/Import/ImportCsv.php @@ -62,7 +62,7 @@ class ImportCsv extends AbstractImportCsv if ($GLOBALS['plugin_param'] !== 'table') { $leaf = new TextPropertyItem( - "new_tbl_name", + 'new_tbl_name', __( 'Name of the new table (optional):' ) @@ -71,7 +71,7 @@ class ImportCsv extends AbstractImportCsv if ($GLOBALS['plugin_param'] === 'server') { $leaf = new TextPropertyItem( - "new_db_name", + 'new_db_name', __( 'Name of the new database (optional):' ) @@ -80,7 +80,7 @@ class ImportCsv extends AbstractImportCsv } $leaf = new NumberPropertyItem( - "partial_import", + 'partial_import', __( 'Import these many number of rows (optional):' ) @@ -88,7 +88,7 @@ class ImportCsv extends AbstractImportCsv $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "col_names", + 'col_names', __( 'The first line of the file contains the table column names' . ' (if this is unchecked, the first line will become part' @@ -98,7 +98,7 @@ class ImportCsv extends AbstractImportCsv $generalOptions->addProperty($leaf); } else { $leaf = new NumberPropertyItem( - "partial_import", + 'partial_import', __( 'Import these many number of rows (optional):' ) @@ -114,14 +114,14 @@ class ImportCsv extends AbstractImportCsv ) ); $leaf = new TextPropertyItem( - "columns", + 'columns', __('Column names:') . ' ' . Generator::showHint($hint) ); $generalOptions->addProperty($leaf); } $leaf = new BoolPropertyItem( - "ignore", + 'ignore', __('Do not abort on INSERT error') ); $generalOptions->addProperty($leaf); @@ -142,9 +142,9 @@ class ImportCsv extends AbstractImportCsv // but we use directly from $_POST global $error, $timeout_passed, $finished, $message; - $import_file_name = basename($import_file_name, ".csv"); + $import_file_name = basename($import_file_name, '.csv'); $import_file_name = mb_strtolower($import_file_name); - $import_file_name = preg_replace("/[^a-zA-Z0-9_]/", "_", $import_file_name); + $import_file_name = preg_replace('/[^a-zA-Z0-9_]/', '_', $import_file_name); $replacements = [ '\\n' => "\n", @@ -611,13 +611,13 @@ class ImportCsv extends AbstractImportCsv } $sql .= ')'; if (isset($_POST['csv_replace'])) { - $sql .= " ON DUPLICATE KEY UPDATE "; + $sql .= ' ON DUPLICATE KEY UPDATE '; foreach ($fields as $field) { $fieldName = Util::backquote( $field['Field'] ); - $sql .= $fieldName . " = VALUES(" . $fieldName - . "), "; + $sql .= $fieldName . ' = VALUES(' . $fieldName + . '), '; } $sql = rtrim($sql, ', '); } @@ -690,14 +690,14 @@ class ImportCsv extends AbstractImportCsv $tbl_name = $import_file_name; } else { // check to see if {filename} as table exist - $name_array = preg_grep("/{$import_file_name}/isU", $result); + $name_array = preg_grep('/' . $import_file_name . '/isU', $result); // if no use filename as table name if (count($name_array) === 0) { $tbl_name = $import_file_name; } else { // check if {filename}_ as table exist - $name_array = preg_grep("/{$import_file_name}_/isU", $result); - $tbl_name = $import_file_name . "_" . (count($name_array) + 1); + $name_array = preg_grep('/' . $import_file_name . '_/isU', $result); + $tbl_name = $import_file_name . '_' . (count($name_array) + 1); } } } else { diff --git a/libraries/classes/Plugins/Import/ImportLdi.php b/libraries/classes/Plugins/Import/ImportLdi.php index 3947d85b1e..ff7a5b10a9 100644 --- a/libraries/classes/Plugins/Import/ImportLdi.php +++ b/libraries/classes/Plugins/Import/ImportLdi.php @@ -69,19 +69,19 @@ class ImportLdi extends AbstractImportCsv $this->properties->setExtension('ldi'); $leaf = new TextPropertyItem( - "columns", + 'columns', __('Column names: ') ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "ignore", + 'ignore', __('Do not abort on INSERT error') ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "local_option", + 'local_option', __('Use LOCAL keyword') ); $generalOptions->addProperty($leaf); diff --git a/libraries/classes/Plugins/Import/ImportMediawiki.php b/libraries/classes/Plugins/Import/ImportMediawiki.php index fb7371b10f..8b07a077cd 100644 --- a/libraries/classes/Plugins/Import/ImportMediawiki.php +++ b/libraries/classes/Plugins/Import/ImportMediawiki.php @@ -92,7 +92,7 @@ class ImportMediawiki extends ImportPlugin $mediawiki_new_line = "\n"; // Initialize the name of the current table - $cur_table_name = ""; + $cur_table_name = ''; $cur_temp_table_headers = []; $cur_temp_table = []; @@ -145,12 +145,12 @@ class ImportMediawiki extends ImportPlugin $matches = []; // Check beginning of comment - if (! strcmp(mb_substr($cur_buffer_line, 0, 4), "") + if (! strcmp(mb_substr($cur_buffer_line, 0, 4), '-->') ) { // Only data comments are closed. The structure comments // will be closed when a data comment begins (in order to @@ -167,7 +167,7 @@ class ImportMediawiki extends ImportPlugin // Check table name $match_table_name = []; if (preg_match( - "/^Table data for `(.*)`$/", + '/^Table data for `(.*)`$/', $cur_buffer_line, $match_table_name ) @@ -180,7 +180,7 @@ class ImportMediawiki extends ImportPlugin $inside_structure_comment ); } elseif (preg_match( - "/^Table structure for `(.*)`$/", + '/^Table structure for `(.*)`$/', $cur_buffer_line, $match_table_name ) @@ -242,7 +242,7 @@ class ImportMediawiki extends ImportPlugin $this->_importDataOneTable($current_table, $sql_data); // Reset table name - $cur_table_name = ""; + $cur_table_name = ''; } // What's after the row tag is now only attributes } elseif (($first_character === '|') || ($first_character === '!')) { @@ -266,8 +266,8 @@ class ImportMediawiki extends ImportPlugin // Delete the beginning of the column, if there is one $cell = trim($cell); $col_start_chars = [ - "|", - "!", + '|', + '!', ]; foreach ($col_start_chars as $col_start_char) { $cell = $this->_getCellContent($cell, $col_start_char); @@ -420,7 +420,7 @@ class ImportMediawiki extends ImportPlugin private function _delimiterReplace($replace, $subject) { // String that will be returned - $cleaned = ""; + $cleaned = ''; // Possible states of current character $inside_tag = false; $inside_attribute = false; @@ -458,7 +458,7 @@ class ImportMediawiki extends ImportPlugin // not '|', but the previous one was, it means that the single '|' // was not appended, so we append it now if ($partial_separator && $inside_attribute) { - $cleaned .= "|"; + $cleaned .= '|'; } // If the char is different from "|", no separator can be formed $partial_separator = false; @@ -504,7 +504,7 @@ class ImportMediawiki extends ImportPlugin */ private function _explodeMarkup($text) { - $separator = "||"; + $separator = '||'; $placeholder = "\x00"; // Remove placeholder instances diff --git a/libraries/classes/Plugins/Import/ImportOds.php b/libraries/classes/Plugins/Import/ImportOds.php index 4d5810bca9..feac58eae2 100644 --- a/libraries/classes/Plugins/Import/ImportOds.php +++ b/libraries/classes/Plugins/Import/ImportOds.php @@ -54,14 +54,14 @@ class ImportOds extends ImportPlugin // $importPluginProperties // this will be shown as "Format specific options" $importSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group $leaf = new BoolPropertyItem( - "col_names", + 'col_names', __( 'The first line of the file contains the table column names' . ' (if this is unchecked, the first line will become part' @@ -70,19 +70,19 @@ class ImportOds extends ImportPlugin ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "empty_rows", + 'empty_rows', __('Do not import empty rows') ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "recognize_percentages", + 'recognize_percentages', __( 'Import percentages as proper decimals (ex. 12.00% to .12)' ) ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "recognize_currency", + 'recognize_currency', __('Import currencies (ex. $5.00 to 5.00)') ); $generalOptions->addProperty($leaf); @@ -108,7 +108,7 @@ class ImportOds extends ImportPlugin $i = 0; $len = 0; - $buffer = ""; + $buffer = ''; /** * Read in the file via Import::getNextChunk so that @@ -141,7 +141,7 @@ class ImportOds extends ImportPlugin * result in increased performance without the need to * alter the code in any way. It's basically a freebee. */ - $xml = @simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); + $xml = @simplexml_load_string($buffer, 'SimpleXMLElement', LIBXML_COMPACT); unset($buffer); diff --git a/libraries/classes/Plugins/Import/ImportShp.php b/libraries/classes/Plugins/Import/ImportShp.php index 0c1c3937d7..f448baa306 100644 --- a/libraries/classes/Plugins/Import/ImportShp.php +++ b/libraries/classes/Plugins/Import/ImportShp.php @@ -159,7 +159,7 @@ class ImportShp extends ImportPlugin // Load data $shp->loadFromFile(''); - if ($shp->lastError != "") { + if ($shp->lastError != '') { $error = true; $message = Message::error( __('There was an error importing the ESRI shape file: "%s".') diff --git a/libraries/classes/Plugins/Import/ImportSql.php b/libraries/classes/Plugins/Import/ImportSql.php index 2e9e9d5d35..a6663e2b2b 100644 --- a/libraries/classes/Plugins/Import/ImportSql.php +++ b/libraries/classes/Plugins/Import/ImportSql.php @@ -60,14 +60,14 @@ class ImportSql extends ImportPlugin // $importPluginProperties // this will be shown as "Format specific options" $importSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // general options main group - $generalOptions = new OptionsPropertyMainGroup("general_opts"); + $generalOptions = new OptionsPropertyMainGroup('general_opts'); // create primary items and add them to the group $leaf = new SelectPropertyItem( - "compatibility", + 'compatibility', __('SQL compatibility mode:') ); $leaf->setValues($values); @@ -79,7 +79,7 @@ class ImportSql extends ImportPlugin ); $generalOptions->addProperty($leaf); $leaf = new BoolPropertyItem( - "no_auto_value_on_zero", + 'no_auto_value_on_zero', __('Do not use AUTO_INCREMENT for zero values') ); $leaf->setDoc( diff --git a/libraries/classes/Plugins/Import/ImportXml.php b/libraries/classes/Plugins/Import/ImportXml.php index ade1129e5f..658c77ff19 100644 --- a/libraries/classes/Plugins/Import/ImportXml.php +++ b/libraries/classes/Plugins/Import/ImportXml.php @@ -65,7 +65,7 @@ class ImportXml extends ImportPlugin $i = 0; $len = 0; - $buffer = ""; + $buffer = ''; /** * Read in the file via Import::getNextChunk so that @@ -98,7 +98,7 @@ class ImportXml extends ImportPlugin * result in increased performance without the need to * alter the code in any way. It's basically a freebee. */ - $xml = @simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); + $xml = @simplexml_load_string($buffer, 'SimpleXMLElement', LIBXML_COMPACT); unset($buffer); @@ -208,16 +208,16 @@ class ImportXml extends ImportPlugin * into another database. */ $attrs = $val2->attributes(); - $create[] = "USE " + $create[] = 'USE ' . Util::backquote( - $attrs["name"] + $attrs['name'] ); foreach ($val2 as $val3) { /** * Remove the extra cosmetic spacing */ - $val3 = str_replace(" ", "", (string) $val3); + $val3 = str_replace(' ', '', (string) $val3); $create[] = $val3; } } diff --git a/libraries/classes/Plugins/Import/Upload/UploadApc.php b/libraries/classes/Plugins/Import/Upload/UploadApc.php index ed7643c60c..71ec2454df 100644 --- a/libraries/classes/Plugins/Import/Upload/UploadApc.php +++ b/libraries/classes/Plugins/Import/Upload/UploadApc.php @@ -41,7 +41,7 @@ class UploadApc implements UploadInterface { global $SESSION_KEY; - if (trim($id) == "") { + if (trim($id) == '') { return null; } if (! array_key_exists($id, $_SESSION[$SESSION_KEY])) { diff --git a/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php b/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php index 89781a7013..e4c0bcab3f 100644 --- a/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php +++ b/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php @@ -41,7 +41,7 @@ class UploadNoplugin implements UploadInterface { global $SESSION_KEY; - if (trim($id) == "") { + if (trim($id) == '') { return null; } if (! array_key_exists($id, $_SESSION[$SESSION_KEY])) { diff --git a/libraries/classes/Plugins/Import/Upload/UploadProgress.php b/libraries/classes/Plugins/Import/Upload/UploadProgress.php index c25707adbf..05b234bd2a 100644 --- a/libraries/classes/Plugins/Import/Upload/UploadProgress.php +++ b/libraries/classes/Plugins/Import/Upload/UploadProgress.php @@ -41,7 +41,7 @@ class UploadProgress implements UploadInterface { global $SESSION_KEY; - if (trim($id) == "") { + if (trim($id) == '') { return null; } diff --git a/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php b/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php index 5028688254..94a74aa1e9 100644 --- a/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php +++ b/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php @@ -71,7 +71,7 @@ class TableStatsDia extends TableStats { ExportRelationSchema::dieSchema( $this->pageNumber, - "DIA", + 'DIA', sprintf(__('The %s table doesn\'t exist!'), $this->tableName) ); } diff --git a/libraries/classes/Plugins/Schema/Eps/Eps.php b/libraries/classes/Plugins/Schema/Eps/Eps.php index 6b43e9b1fc..e051b82334 100644 --- a/libraries/classes/Plugins/Schema/Eps/Eps.php +++ b/libraries/classes/Plugins/Schema/Eps/Eps.php @@ -36,7 +36,7 @@ class Eps */ public function __construct() { - $this->stringCommands = ""; + $this->stringCommands = ''; $this->stringCommands .= "%!PS-Adobe-3.0 EPSF-3.0 \n"; } @@ -86,11 +86,11 @@ class Eps public function setOrientation($orientation) { $this->stringCommands .= "%%PageOrder: Ascend \n"; - if ($orientation == "L") { - $orientation = "Landscape"; + if ($orientation == 'L') { + $orientation = 'Landscape'; $this->stringCommands .= '%%Orientation: ' . $orientation . "\n"; } else { - $orientation = "Portrait"; + $orientation = 'Portrait'; $this->stringCommands .= '%%Orientation: ' . $orientation . "\n"; } $this->stringCommands .= "%%EndComments \n"; @@ -112,9 +112,9 @@ class Eps { $this->font = $value; $this->fontSize = $size; - $this->stringCommands .= "/" . $value . " findfont % Get the basic font\n"; - $this->stringCommands .= "" - . $size . " scalefont % Scale the font to $size points\n"; + $this->stringCommands .= '/' . $value . " findfont % Get the basic font\n"; + $this->stringCommands .= '' + . $size . ' scalefont % Scale the font to ' . $size . " points\n"; $this->stringCommands .= "setfont % Make it the current font\n"; } @@ -192,10 +192,10 @@ class Eps { $this->stringCommands .= $lineWidth . " setlinewidth \n"; $this->stringCommands .= "newpath \n"; - $this->stringCommands .= $x_from . " " . $y_from . " moveto \n"; - $this->stringCommands .= "0 " . $y_to . " rlineto \n"; + $this->stringCommands .= $x_from . ' ' . $y_from . " moveto \n"; + $this->stringCommands .= '0 ' . $y_to . " rlineto \n"; $this->stringCommands .= $x_to . " 0 rlineto \n"; - $this->stringCommands .= "0 -" . $y_to . " rlineto \n"; + $this->stringCommands .= '0 -' . $y_to . " rlineto \n"; $this->stringCommands .= "closepath \n"; $this->stringCommands .= "stroke \n"; } diff --git a/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php b/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php index 435fdc165f..9addce5cd2 100644 --- a/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php @@ -69,7 +69,7 @@ class EpsRelationSchema extends ExportRelationSchema ) ); $this->diagram->setAuthor('phpMyAdmin ' . PMA_VERSION); - $this->diagram->setDate(date("j F Y, g:i a")); + $this->diagram->setDate(date('j F Y, g:i a')); $this->diagram->setOrientation($this->orientation); $this->diagram->setFont('Verdana', '10'); diff --git a/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php b/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php index 5b6a5c37c9..9341330506 100644 --- a/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php +++ b/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php @@ -89,7 +89,7 @@ class TableStatsEps extends TableStats { ExportRelationSchema::dieSchema( $this->pageNumber, - "EPS", + 'EPS', sprintf(__('The %s table doesn\'t exist!'), $this->tableName) ); } diff --git a/libraries/classes/Plugins/Schema/ExportRelationSchema.php b/libraries/classes/Plugins/Schema/ExportRelationSchema.php index e091c025b6..2a2da072e1 100644 --- a/libraries/classes/Plugins/Schema/ExportRelationSchema.php +++ b/libraries/classes/Plugins/Schema/ExportRelationSchema.php @@ -293,7 +293,7 @@ class ExportRelationSchema */ public static function dieSchema($pageNumber, $type = '', $error_message = '') { - echo "

" , __("SCHEMA ERROR: ") , $type , "

" , "\n"; + echo '

' , __('SCHEMA ERROR: ') , $type , '

' , "\n"; if (! empty($error_message)) { $error_message = htmlspecialchars($error_message); } diff --git a/libraries/classes/Plugins/Schema/Pdf/Pdf.php b/libraries/classes/Plugins/Schema/Pdf/Pdf.php index 9367c42a96..3c0057c7d6 100644 --- a/libraries/classes/Plugins/Schema/Pdf/Pdf.php +++ b/libraries/classes/Plugins/Schema/Pdf/Pdf.php @@ -259,7 +259,7 @@ class Pdf extends PdfLib // This function must be named "Header" to work with the TCPDF library if ($this->_withDoc) { if ($this->_offline || $this->_pageNumber == -1) { - $pg_name = __("PDF export page"); + $pg_name = __('PDF export page'); } else { $test_query = 'SELECT * FROM ' . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' diff --git a/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php b/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php index e9f490e08b..722e8b7a24 100644 --- a/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -501,7 +501,7 @@ class PdfRelationSchema extends ExportRelationSchema $this->diagram->Cell( 0, 6, - __('Page number:') . ' {' . sprintf("%02d", $i) . '}', + __('Page number:') . ' {' . sprintf('%02d', $i) . '}', 0, 0, 'R', @@ -563,7 +563,7 @@ class PdfRelationSchema extends ExportRelationSchema $this->diagram->AddPage($this->orientation); $this->diagram->Bookmark($table); $this->diagram->setAlias( - '{' . sprintf("%02d", $z) . '}', + '{' . sprintf('%02d', $z) . '}', $this->diagram->PageNo() ); $this->diagram->PMA_links['RT'][$table]['-'] diff --git a/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php b/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php index 03872b7761..9377e0938b 100644 --- a/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php +++ b/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php @@ -91,7 +91,7 @@ class TableStatsPdf extends TableStats { ExportRelationSchema::dieSchema( $this->pageNumber, - "PDF", + 'PDF', sprintf(__('The %s table doesn\'t exist!'), $this->tableName) ); } diff --git a/libraries/classes/Plugins/Schema/SchemaDia.php b/libraries/classes/Plugins/Schema/SchemaDia.php index ec9b20e213..e993b31e1e 100644 --- a/libraries/classes/Plugins/Schema/SchemaDia.php +++ b/libraries/classes/Plugins/Schema/SchemaDia.php @@ -48,16 +48,16 @@ class SchemaDia extends SchemaPlugin // $schemaPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); + $specificOptions = new OptionsPropertyMainGroup('general_opts'); // add options common to all plugins $this->addCommonOptions($specificOptions); $leaf = new SelectPropertyItem( - "orientation", + 'orientation', __('Orientation') ); $leaf->setValues( @@ -69,7 +69,7 @@ class SchemaDia extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - "paper", + 'paper', __('Paper size') ); $leaf->setValues($this->getPaperSizeArray()); diff --git a/libraries/classes/Plugins/Schema/SchemaEps.php b/libraries/classes/Plugins/Schema/SchemaEps.php index 453c130e35..1a06b808ce 100644 --- a/libraries/classes/Plugins/Schema/SchemaEps.php +++ b/libraries/classes/Plugins/Schema/SchemaEps.php @@ -49,11 +49,11 @@ class SchemaEps extends SchemaPlugin // $schemaPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); + $specificOptions = new OptionsPropertyMainGroup('general_opts'); // add options common to all plugins $this->addCommonOptions($specificOptions); @@ -65,7 +65,7 @@ class SchemaEps extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - "orientation", + 'orientation', __('Orientation') ); $leaf->setValues( diff --git a/libraries/classes/Plugins/Schema/SchemaPdf.php b/libraries/classes/Plugins/Schema/SchemaPdf.php index 9dbab69773..0261d8309a 100644 --- a/libraries/classes/Plugins/Schema/SchemaPdf.php +++ b/libraries/classes/Plugins/Schema/SchemaPdf.php @@ -49,11 +49,11 @@ class SchemaPdf extends SchemaPlugin // $schemaPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); + $specificOptions = new OptionsPropertyMainGroup('general_opts'); // add options common to all plugins $this->addCommonOptions($specificOptions); @@ -65,7 +65,7 @@ class SchemaPdf extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - "orientation", + 'orientation', __('Orientation') ); $leaf->setValues( @@ -77,7 +77,7 @@ class SchemaPdf extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - "paper", + 'paper', __('Paper size') ); $leaf->setValues($this->getPaperSizeArray()); @@ -96,7 +96,7 @@ class SchemaPdf extends SchemaPlugin $specificOptions->addProperty($leaf); $leaf = new SelectPropertyItem( - "table_order", + 'table_order', __('Order of the tables') ); $leaf->setValues( diff --git a/libraries/classes/Plugins/Schema/SchemaSvg.php b/libraries/classes/Plugins/Schema/SchemaSvg.php index a7452f4e7a..537dc1c61b 100644 --- a/libraries/classes/Plugins/Schema/SchemaSvg.php +++ b/libraries/classes/Plugins/Schema/SchemaSvg.php @@ -48,11 +48,11 @@ class SchemaSvg extends SchemaPlugin // $schemaPluginProperties // this will be shown as "Format specific options" $exportSpecificOptions = new OptionsPropertyRootGroup( - "Format Specific Options" + 'Format Specific Options' ); // specific options main group - $specificOptions = new OptionsPropertyMainGroup("general_opts"); + $specificOptions = new OptionsPropertyMainGroup('general_opts'); // add options common to all plugins $this->addCommonOptions($specificOptions); diff --git a/libraries/classes/Plugins/Schema/Svg/Svg.php b/libraries/classes/Plugins/Schema/Svg/Svg.php index ab395319a7..d664446215 100644 --- a/libraries/classes/Plugins/Schema/Svg/Svg.php +++ b/libraries/classes/Plugins/Schema/Svg/Svg.php @@ -154,7 +154,7 @@ class Svg extends XMLWriter } if ($x != 0 || $y != 0) { - $this->writeAttribute('viewBox', "$x $y $width $height"); + $this->writeAttribute('viewBox', sprintf('%d %d %d %d', $x, $y, $width, $height)); } $this->writeAttribute('width', ($width - $x) . 'px'); $this->writeAttribute('height', ($height - $y) . 'px'); diff --git a/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php b/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php index 1bd34ee8e3..cffd40a547 100644 --- a/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php +++ b/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php @@ -89,7 +89,7 @@ class TableStatsSvg extends TableStats { ExportRelationSchema::dieSchema( $this->pageNumber, - "SVG", + 'SVG', sprintf(__('The %s table doesn\'t exist!'), $this->tableName) ); } diff --git a/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php index 1bc297a41a..97dd32d715 100644 --- a/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php @@ -63,6 +63,6 @@ abstract class Bool2TextTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Bool2Text"; + return 'Bool2Text'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php index bb312b0788..c988d43def 100644 --- a/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php @@ -152,6 +152,6 @@ abstract class DateFormatTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Date Format"; + return 'Date Format'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php index 02ed96617f..c1c0ec5cc8 100644 --- a/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php @@ -91,6 +91,6 @@ abstract class DownloadTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Download"; + return 'Download'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php index 99ecf59a99..4ebde81009 100644 --- a/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php @@ -114,12 +114,12 @@ abstract class ExternalTransformationsPlugin extends TransformationsPlugin $newstring = ''; $descriptorspec = [ 0 => [ - "pipe", - "r", + 'pipe', + 'r', ], 1 => [ - "pipe", - "w", + 'pipe', + 'w', ], ]; $process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes); @@ -154,6 +154,6 @@ abstract class ExternalTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "External"; + return 'External'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php index 25eba5dc38..e101e5d94f 100644 --- a/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php @@ -59,6 +59,6 @@ abstract class FormattedTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Formatted"; + return 'Formatted'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php index 83243f0332..61a773a508 100644 --- a/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php @@ -65,6 +65,6 @@ abstract class HexTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Hex"; + return 'Hex'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php index 25402fdd43..81f3c98265 100644 --- a/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php @@ -62,6 +62,6 @@ abstract class ImageLinkTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "ImageLink"; + return 'ImageLink'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php index 408d624708..b4d794be83 100644 --- a/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php @@ -116,6 +116,6 @@ abstract class ImageUploadTransformationsPlugin extends IOTransformationsPlugin */ public static function getName() { - return "Image upload"; + return 'Image upload'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php index e5eca514c4..fcec97becd 100644 --- a/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php @@ -73,6 +73,6 @@ abstract class InlineTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Inline"; + return 'Inline'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php index d3627dd5c7..1a09f4455d 100644 --- a/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php @@ -60,6 +60,6 @@ abstract class LongToIPv4TransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Long To IPv4"; + return 'Long To IPv4'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php index 702ad9de69..e042d0fb2a 100644 --- a/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php @@ -62,6 +62,6 @@ abstract class PreApPendTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "PreApPend"; + return 'PreApPend'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php index 5d04c3caa3..ba318b1703 100644 --- a/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php @@ -68,6 +68,6 @@ abstract class RegexValidationTransformationsPlugin extends IOTransformationsPlu */ public static function getName() { - return "Regex Validation"; + return 'Regex Validation'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php index 130f8d0db6..84c0dbdd67 100644 --- a/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php @@ -57,6 +57,6 @@ abstract class SQLTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "SQL"; + return 'SQL'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php index cd386d1eb5..d951a21ee0 100644 --- a/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php @@ -87,6 +87,6 @@ abstract class SubstringTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Substring"; + return 'Substring'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php index 628d10269a..2afb99374e 100644 --- a/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php @@ -97,6 +97,6 @@ abstract class TextFileUploadTransformationsPlugin extends IOTransformationsPlug */ public static function getName() { - return "Text file upload"; + return 'Text file upload'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php index 3fb5a6878d..759d2f743e 100644 --- a/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php @@ -74,6 +74,6 @@ abstract class TextImageLinkTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "Image Link"; + return 'Image Link'; } } diff --git a/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php b/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php index 61b3a9c581..4e2d60f843 100644 --- a/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php +++ b/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php @@ -71,6 +71,6 @@ abstract class TextLinkTransformationsPlugin extends TransformationsPlugin */ public static function getName() { - return "TextLink"; + return 'TextLink'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php b/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php index d30086a09a..ad4078f2c6 100644 --- a/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php +++ b/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php @@ -28,7 +28,7 @@ class Image_JPEG_Upload extends ImageUploadTransformationsPlugin */ public static function getMIMEType() { - return "Image"; + return 'Image'; } /** @@ -38,6 +38,6 @@ class Image_JPEG_Upload extends ImageUploadTransformationsPlugin */ public static function getMIMESubtype() { - return "JPEG"; + return 'JPEG'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php index faf3edc979..e9dae72ec1 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php @@ -27,7 +27,7 @@ class Text_Plain_FileUpload extends TextFileUploadTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_FileUpload extends TextFileUploadTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php index b3453ff77f..6c1e8c5824 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php @@ -115,7 +115,7 @@ class Text_Plain_Iptobinary extends IOTransformationsPlugin */ public static function getName() { - return "IPv4/IPv6 To Binary"; + return 'IPv4/IPv6 To Binary'; } /** @@ -125,7 +125,7 @@ class Text_Plain_Iptobinary extends IOTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -135,6 +135,6 @@ class Text_Plain_Iptobinary extends IOTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php index f819901721..43172d29e8 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php @@ -59,7 +59,7 @@ class Text_Plain_JsonEditor extends CodeMirrorEditorTransformationPlugin */ public static function getName() { - return "JSON"; + return 'JSON'; } /** @@ -69,7 +69,7 @@ class Text_Plain_JsonEditor extends CodeMirrorEditorTransformationPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -79,6 +79,6 @@ class Text_Plain_JsonEditor extends CodeMirrorEditorTransformationPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php index 6cb012fe4b..e7959f9ef8 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php @@ -28,7 +28,7 @@ class Text_Plain_RegexValidation extends RegexValidationTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -38,6 +38,6 @@ class Text_Plain_RegexValidation extends RegexValidationTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php index e48234bbd3..3164ca9657 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php @@ -59,7 +59,7 @@ class Text_Plain_SqlEditor extends CodeMirrorEditorTransformationPlugin */ public static function getName() { - return "SQL"; + return 'SQL'; } /** @@ -69,7 +69,7 @@ class Text_Plain_SqlEditor extends CodeMirrorEditorTransformationPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -79,6 +79,6 @@ class Text_Plain_SqlEditor extends CodeMirrorEditorTransformationPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php b/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php index e62a4eeadd..81577b45b1 100644 --- a/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php +++ b/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php @@ -59,7 +59,7 @@ class Text_Plain_XmlEditor extends CodeMirrorEditorTransformationPlugin */ public static function getName() { - return "XML"; + return 'XML'; } /** @@ -69,7 +69,7 @@ class Text_Plain_XmlEditor extends CodeMirrorEditorTransformationPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -79,6 +79,6 @@ class Text_Plain_XmlEditor extends CodeMirrorEditorTransformationPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php b/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php index 109efcd630..8201536233 100644 --- a/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php +++ b/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php @@ -27,7 +27,7 @@ class Application_Octetstream_Download extends DownloadTransformationsPlugin */ public static function getMIMEType() { - return "Application"; + return 'Application'; } /** @@ -37,6 +37,6 @@ class Application_Octetstream_Download extends DownloadTransformationsPlugin */ public static function getMIMESubtype() { - return "OctetStream"; + return 'OctetStream'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php b/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php index 8aaafa1ca9..92a8597d75 100644 --- a/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php +++ b/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php @@ -27,7 +27,7 @@ class Application_Octetstream_Hex extends HexTransformationsPlugin */ public static function getMIMEType() { - return "Application"; + return 'Application'; } /** @@ -37,6 +37,6 @@ class Application_Octetstream_Hex extends HexTransformationsPlugin */ public static function getMIMESubtype() { - return "OctetStream"; + return 'OctetStream'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php b/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php index 23206b3372..38b21edc97 100644 --- a/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php +++ b/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php @@ -27,7 +27,7 @@ class Image_JPEG_Inline extends InlineTransformationsPlugin */ public static function getMIMEType() { - return "Image"; + return 'Image'; } /** @@ -37,6 +37,6 @@ class Image_JPEG_Inline extends InlineTransformationsPlugin */ public static function getMIMESubtype() { - return "JPEG"; + return 'JPEG'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php b/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php index 8bf41d336a..c2c5b56ee0 100644 --- a/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php +++ b/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php @@ -27,7 +27,7 @@ class Image_JPEG_Link extends ImageLinkTransformationsPlugin */ public static function getMIMEType() { - return "Image"; + return 'Image'; } /** @@ -37,6 +37,6 @@ class Image_JPEG_Link extends ImageLinkTransformationsPlugin */ public static function getMIMESubtype() { - return "JPEG"; + return 'JPEG'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php b/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php index cb549f21bc..a5212fbb1f 100644 --- a/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php +++ b/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php @@ -27,7 +27,7 @@ class Image_PNG_Inline extends InlineTransformationsPlugin */ public static function getMIMEType() { - return "Image"; + return 'Image'; } /** @@ -37,6 +37,6 @@ class Image_PNG_Inline extends InlineTransformationsPlugin */ public static function getMIMESubtype() { - return "PNG"; + return 'PNG'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php b/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php index 0dab56e2a2..0849c1a6d1 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php @@ -27,7 +27,7 @@ class Text_Octetstream_Sql extends SQLTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Octetstream_Sql extends SQLTransformationsPlugin */ public static function getMIMESubtype() { - return "Octetstream"; + return 'Octetstream'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php index 649aaad164..98a0b71478 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php @@ -71,7 +71,7 @@ class Text_Plain_Binarytoip extends TransformationsPlugin */ public static function getName() { - return "Binary To IPv4/IPv6"; + return 'Binary To IPv4/IPv6'; } /** @@ -81,7 +81,7 @@ class Text_Plain_Binarytoip extends TransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -91,6 +91,6 @@ class Text_Plain_Binarytoip extends TransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php index 9250eea0ae..8e60570001 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php @@ -29,7 +29,7 @@ class Text_Plain_Bool2Text extends Bool2TextTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -39,6 +39,6 @@ class Text_Plain_Bool2Text extends Bool2TextTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php index eb70bee1e9..d8e11ac8e5 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php @@ -27,7 +27,7 @@ class Text_Plain_Dateformat extends DateFormatTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_Dateformat extends DateFormatTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php index 1839c89d3f..c8f292fe6f 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php @@ -27,7 +27,7 @@ class Text_Plain_External extends ExternalTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_External extends ExternalTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php index 70d3a3cfc9..7b6ca66e64 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php @@ -27,7 +27,7 @@ class Text_Plain_Formatted extends FormattedTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_Formatted extends FormattedTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php index 24b84a265f..2f9ff93ffb 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php @@ -27,7 +27,7 @@ class Text_Plain_Imagelink extends TextImageLinkTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_Imagelink extends TextImageLinkTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php index 7e2475c624..278dc4036d 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php @@ -75,7 +75,7 @@ class Text_Plain_Json extends TransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -85,7 +85,7 @@ class Text_Plain_Json extends TransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } /** @@ -95,6 +95,6 @@ class Text_Plain_Json extends TransformationsPlugin */ public static function getName() { - return "JSON"; + return 'JSON'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php index c61b42eda8..b222d2d655 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php @@ -44,7 +44,7 @@ class Text_Plain_Sql extends SQLTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -54,6 +54,6 @@ class Text_Plain_Sql extends SQLTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php index 01bbd9f1b6..851757a006 100644 --- a/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php +++ b/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php @@ -75,7 +75,7 @@ class Text_Plain_Xml extends TransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -85,7 +85,7 @@ class Text_Plain_Xml extends TransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } /** @@ -95,6 +95,6 @@ class Text_Plain_Xml extends TransformationsPlugin */ public static function getName() { - return "XML"; + return 'XML'; } } diff --git a/libraries/classes/Plugins/Transformations/Text_Plain_Link.php b/libraries/classes/Plugins/Transformations/Text_Plain_Link.php index e31862933f..1283663dd2 100644 --- a/libraries/classes/Plugins/Transformations/Text_Plain_Link.php +++ b/libraries/classes/Plugins/Transformations/Text_Plain_Link.php @@ -27,7 +27,7 @@ class Text_Plain_Link extends TextLinkTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_Link extends TextLinkTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php b/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php index ce4b9da427..d80b66edee 100644 --- a/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php +++ b/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php @@ -27,7 +27,7 @@ class Text_Plain_Longtoipv4 extends LongToIPv4TransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_Longtoipv4 extends LongToIPv4TransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php b/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php index 171f184229..3f23e60d05 100644 --- a/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php +++ b/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php @@ -28,7 +28,7 @@ class Text_Plain_PreApPend extends PreApPendTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -38,6 +38,6 @@ class Text_Plain_PreApPend extends PreApPendTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php b/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php index b598e85a7e..76ab3fbfd9 100644 --- a/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php +++ b/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php @@ -27,7 +27,7 @@ class Text_Plain_Substring extends SubstringTransformationsPlugin */ public static function getMIMEType() { - return "Text"; + return 'Text'; } /** @@ -37,6 +37,6 @@ class Text_Plain_Substring extends SubstringTransformationsPlugin */ public static function getMIMESubtype() { - return "Plain"; + return 'Plain'; } } diff --git a/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php b/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php index 0abd2e306a..d08a9c1db0 100644 --- a/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php +++ b/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php @@ -29,6 +29,6 @@ class OptionsPropertyMainGroup extends OptionsPropertyGroup */ public function getItemType() { - return "main"; + return 'main'; } } diff --git a/libraries/classes/Properties/Options/Groups/OptionsPropertyRootGroup.php b/libraries/classes/Properties/Options/Groups/OptionsPropertyRootGroup.php index ffecafaa39..f29caef1d1 100644 --- a/libraries/classes/Properties/Options/Groups/OptionsPropertyRootGroup.php +++ b/libraries/classes/Properties/Options/Groups/OptionsPropertyRootGroup.php @@ -29,6 +29,6 @@ class OptionsPropertyRootGroup extends OptionsPropertyGroup */ public function getItemType() { - return "root"; + return 'root'; } } diff --git a/libraries/classes/Properties/Options/Groups/OptionsPropertySubgroup.php b/libraries/classes/Properties/Options/Groups/OptionsPropertySubgroup.php index 3a372195d6..cfe8ecfaea 100644 --- a/libraries/classes/Properties/Options/Groups/OptionsPropertySubgroup.php +++ b/libraries/classes/Properties/Options/Groups/OptionsPropertySubgroup.php @@ -38,7 +38,7 @@ class OptionsPropertySubgroup extends OptionsPropertyGroup */ public function getItemType() { - return "subgroup"; + return 'subgroup'; } /** diff --git a/libraries/classes/Properties/Options/Items/BoolPropertyItem.php b/libraries/classes/Properties/Options/Items/BoolPropertyItem.php index 86f90d1af7..9372c98d73 100644 --- a/libraries/classes/Properties/Options/Items/BoolPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/BoolPropertyItem.php @@ -29,6 +29,6 @@ class BoolPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "bool"; + return 'bool'; } } diff --git a/libraries/classes/Properties/Options/Items/DocPropertyItem.php b/libraries/classes/Properties/Options/Items/DocPropertyItem.php index 6657ecd94f..2675b1bba1 100644 --- a/libraries/classes/Properties/Options/Items/DocPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/DocPropertyItem.php @@ -29,6 +29,6 @@ class DocPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "doc"; + return 'doc'; } } diff --git a/libraries/classes/Properties/Options/Items/HiddenPropertyItem.php b/libraries/classes/Properties/Options/Items/HiddenPropertyItem.php index ccffb26f61..e61d730884 100644 --- a/libraries/classes/Properties/Options/Items/HiddenPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/HiddenPropertyItem.php @@ -29,6 +29,6 @@ class HiddenPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "hidden"; + return 'hidden'; } } diff --git a/libraries/classes/Properties/Options/Items/MessageOnlyPropertyItem.php b/libraries/classes/Properties/Options/Items/MessageOnlyPropertyItem.php index 4f500bcd76..28544e2bb9 100644 --- a/libraries/classes/Properties/Options/Items/MessageOnlyPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/MessageOnlyPropertyItem.php @@ -29,6 +29,6 @@ class MessageOnlyPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "messageOnly"; + return 'messageOnly'; } } diff --git a/libraries/classes/Properties/Options/Items/NumberPropertyItem.php b/libraries/classes/Properties/Options/Items/NumberPropertyItem.php index 50d65fbf6e..62fd923b73 100644 --- a/libraries/classes/Properties/Options/Items/NumberPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/NumberPropertyItem.php @@ -29,6 +29,6 @@ class NumberPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "number"; + return 'number'; } } diff --git a/libraries/classes/Properties/Options/Items/RadioPropertyItem.php b/libraries/classes/Properties/Options/Items/RadioPropertyItem.php index 45a4dfc99f..e532e13897 100644 --- a/libraries/classes/Properties/Options/Items/RadioPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/RadioPropertyItem.php @@ -29,6 +29,6 @@ class RadioPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "radio"; + return 'radio'; } } diff --git a/libraries/classes/Properties/Options/Items/SelectPropertyItem.php b/libraries/classes/Properties/Options/Items/SelectPropertyItem.php index eae2194026..e150428a8f 100644 --- a/libraries/classes/Properties/Options/Items/SelectPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/SelectPropertyItem.php @@ -29,6 +29,6 @@ class SelectPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "select"; + return 'select'; } } diff --git a/libraries/classes/Properties/Options/Items/TextPropertyItem.php b/libraries/classes/Properties/Options/Items/TextPropertyItem.php index 5fc16760b1..a7e3b2ab66 100644 --- a/libraries/classes/Properties/Options/Items/TextPropertyItem.php +++ b/libraries/classes/Properties/Options/Items/TextPropertyItem.php @@ -29,6 +29,6 @@ class TextPropertyItem extends OptionsPropertyOneItem */ public function getItemType() { - return "text"; + return 'text'; } } diff --git a/libraries/classes/Properties/Options/OptionsPropertyItem.php b/libraries/classes/Properties/Options/OptionsPropertyItem.php index 132eb99016..557d524cc4 100644 --- a/libraries/classes/Properties/Options/OptionsPropertyItem.php +++ b/libraries/classes/Properties/Options/OptionsPropertyItem.php @@ -130,6 +130,6 @@ abstract class OptionsPropertyItem extends PropertyItem */ public function getPropertyType() { - return "options"; + return 'options'; } } diff --git a/libraries/classes/Properties/Plugins/ExportPluginProperties.php b/libraries/classes/Properties/Plugins/ExportPluginProperties.php index f54c9cfce0..dd9841b488 100644 --- a/libraries/classes/Properties/Plugins/ExportPluginProperties.php +++ b/libraries/classes/Properties/Plugins/ExportPluginProperties.php @@ -36,7 +36,7 @@ class ExportPluginProperties extends PluginPropertyItem */ public function getItemType() { - return "export"; + return 'export'; } /** diff --git a/libraries/classes/Properties/Plugins/ImportPluginProperties.php b/libraries/classes/Properties/Plugins/ImportPluginProperties.php index 758ccf2a40..4ea4ba0913 100644 --- a/libraries/classes/Properties/Plugins/ImportPluginProperties.php +++ b/libraries/classes/Properties/Plugins/ImportPluginProperties.php @@ -27,6 +27,6 @@ class ImportPluginProperties extends PluginPropertyItem */ public function getItemType() { - return "import"; + return 'import'; } } diff --git a/libraries/classes/Properties/Plugins/PluginPropertyItem.php b/libraries/classes/Properties/Plugins/PluginPropertyItem.php index f72f6e933b..442ef86761 100644 --- a/libraries/classes/Properties/Plugins/PluginPropertyItem.php +++ b/libraries/classes/Properties/Plugins/PluginPropertyItem.php @@ -171,6 +171,6 @@ abstract class PluginPropertyItem extends PropertyItem */ public function getPropertyType() { - return "plugin"; + return 'plugin'; } } diff --git a/libraries/classes/Properties/Plugins/SchemaPluginProperties.php b/libraries/classes/Properties/Plugins/SchemaPluginProperties.php index d46f3be4fc..092c978f9e 100644 --- a/libraries/classes/Properties/Plugins/SchemaPluginProperties.php +++ b/libraries/classes/Properties/Plugins/SchemaPluginProperties.php @@ -30,7 +30,7 @@ class SchemaPluginProperties extends PluginPropertyItem */ public function getItemType() { - return "schema"; + return 'schema'; } /** diff --git a/libraries/classes/RecentFavoriteTable.php b/libraries/classes/RecentFavoriteTable.php index 46f4c689e7..b522d660f5 100644 --- a/libraries/classes/RecentFavoriteTable.php +++ b/libraries/classes/RecentFavoriteTable.php @@ -104,7 +104,7 @@ class RecentFavoriteTable { // Read from phpMyAdmin database, if recent tables is not in session $sql_query - = " SELECT `tables` FROM " . $this->_getPmaTable() . + = ' SELECT `tables` FROM ' . $this->_getPmaTable() . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'"; $return = []; @@ -127,7 +127,7 @@ class RecentFavoriteTable { $username = $GLOBALS['cfg']['Server']['user']; $sql_query - = " REPLACE INTO " . $this->_getPmaTable() . " (`username`, `tables`)" . + = ' REPLACE INTO ' . $this->_getPmaTable() . ' (`username`, `tables`)' . " VALUES ('" . $GLOBALS['dbi']->escapeString($username) . "', '" . $GLOBALS['dbi']->escapeString( json_encode($this->_tables) @@ -210,9 +210,9 @@ class RecentFavoriteTable 'remove_favorite' => true, ]); $html .= 'href="' . $fav_rm_url - . '" title="' . __("Remove from Favorites") + . '" title="' . __('Remove from Favorites') . '" data-favtargetn="' - . md5($table['db'] . "." . $table['table']) + . md5($table['db'] . '.' . $table['table']) . '" >' . Generator::getIcon('b_favorite') . ''; @@ -390,7 +390,7 @@ class RecentFavoriteTable if (! empty($cfgRelation['db']) && ! empty($cfgRelation[$this->_tableType]) ) { - return Util::backquote($cfgRelation['db']) . "." + return Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation[$this->_tableType]); } return null; diff --git a/libraries/classes/Relation.php b/libraries/classes/Relation.php index 4cb00234f8..913e0000a7 100644 --- a/libraries/classes/Relation.php +++ b/libraries/classes/Relation.php @@ -775,8 +775,8 @@ class Relation // From 4.3, new input oriented transformation feature was introduced. // Check whether column_info table has input transformation columns $new_cols = [ - "input_transformation", - "input_transformation_options", + 'input_transformation', + 'input_transformation_options', ]; $query = 'SHOW COLUMNS FROM ' . Util::backquote($GLOBALS['cfg']['Server']['pmadb']) @@ -1025,10 +1025,10 @@ class Relation if ($cfgRelation['commwork']) { // pmadb internal db comment - $com_qry = " + $com_qry = ' SELECT `comment` - FROM " . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['column_info']) + FROM ' . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']) . " WHERE db_name = '" . $this->dbi->escapeString($db) . "' AND table_name = '' @@ -1063,10 +1063,10 @@ class Relation if ($cfgRelation['commwork']) { // pmadb internal db comment - $com_qry = " + $com_qry = ' SELECT `db_name`, `comment` - FROM " . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['column_info']) + FROM ' . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']) . " WHERE `column_name` = '(db_comment)'"; $com_rs = $this->queryAsControlUser( @@ -1333,7 +1333,7 @@ class Relation $key = htmlspecialchars($key); } else { $key = '0x' . bin2hex($key); - if (false !== strpos($data, "0x")) { + if (false !== strpos($data, '0x')) { $selected = ($key == trim($data)); } else { $selected = ($key == '0x' . $data); @@ -1789,8 +1789,8 @@ class Relation } else { // if the table is moved out of the database we can no loger keep the // record for table coordinate - $remove_query = "DELETE FROM " - . Util::backquote($GLOBALS['cfgRelation']['db']) . "." + $remove_query = 'DELETE FROM ' + . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . Util::backquote($GLOBALS['cfgRelation']['table_coords']) . " WHERE db_name = '" . $this->dbi->escapeString($source_db) . "'" . " AND table_name = '" . $this->dbi->escapeString($source_table) @@ -1824,8 +1824,8 @@ class Relation ); // update data for hidden table - $query = "UPDATE " - . Util::backquote($GLOBALS['cfgRelation']['db']) . "." + $query = 'UPDATE ' + . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . Util::backquote( $GLOBALS['cfgRelation']['navigationhiding'] ) @@ -1882,9 +1882,9 @@ class Relation { $child_references = []; if (! $GLOBALS['cfg']['Server']['DisableIS']) { - $rel_query = "SELECT `column_name`, `table_name`," - . " `table_schema`, `referenced_column_name`" - . " FROM `information_schema`.`key_column_usage`" + $rel_query = 'SELECT `column_name`, `table_name`,' + . ' `table_schema`, `referenced_column_name`' + . ' FROM `information_schema`.`key_column_usage`' . " WHERE `referenced_table_name` = '" . $this->dbi->escapeString($table) . "'" . " AND `referenced_table_schema` = '" @@ -2046,7 +2046,7 @@ class Relation */ public function createPmaDatabase() { - $this->dbi->tryQuery("CREATE DATABASE IF NOT EXISTS `phpmyadmin`"); + $this->dbi->tryQuery('CREATE DATABASE IF NOT EXISTS `phpmyadmin`'); if ($error = $this->dbi->getError()) { if ($GLOBALS['errno'] == 1044) { $GLOBALS['message'] = __( diff --git a/libraries/classes/RelationCleanup.php b/libraries/classes/RelationCleanup.php index 121bb64feb..ce002d40ef 100644 --- a/libraries/classes/RelationCleanup.php +++ b/libraries/classes/RelationCleanup.php @@ -299,90 +299,90 @@ class RelationCleanup $cfgRelation = $this->relation->getRelationsParam(); if ($cfgRelation['bookmarkwork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['bookmark']) + . '.' . Util::backquote($cfgRelation['bookmark']) . " WHERE `user` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['historywork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['history']) + . '.' . Util::backquote($cfgRelation['history']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['recentwork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['recent']) + . '.' . Util::backquote($cfgRelation['recent']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['favoritework']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['favorite']) + . '.' . Util::backquote($cfgRelation['favorite']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['uiprefswork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['table_uiprefs']) + . '.' . Util::backquote($cfgRelation['table_uiprefs']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['userconfigwork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['userconfig']) + . '.' . Util::backquote($cfgRelation['userconfig']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['menuswork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']) + . '.' . Util::backquote($cfgRelation['users']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['navwork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['navigationhiding']) + . '.' . Util::backquote($cfgRelation['navigationhiding']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['savedsearcheswork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['savedsearches']) + . '.' . Util::backquote($cfgRelation['savedsearches']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); } if ($cfgRelation['designersettingswork']) { - $remove_query = "DELETE FROM " + $remove_query = 'DELETE FROM ' . Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['designer_settings']) + . '.' . Util::backquote($cfgRelation['designer_settings']) . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $this->relation->queryAsControlUser($remove_query); diff --git a/libraries/classes/Replication.php b/libraries/classes/Replication.php index eab03f477e..7624530c93 100644 --- a/libraries/classes/Replication.php +++ b/libraries/classes/Replication.php @@ -35,7 +35,7 @@ class Replication = empty($mysqlInfo[$mysqlKey]) ? [] : explode( - ",", + ',', $mysqlInfo[$mysqlKey] ); @@ -52,7 +52,7 @@ class Replication */ public function extractDbOrTable($string, $what = 'db') { - $list = explode(".", $string); + $list = explode('.', $string); if ('db' == $what) { return $list[0]; } else { @@ -77,14 +77,14 @@ class Replication $action = mb_strtoupper($action); $control = mb_strtoupper($control); - if ($action != "START" && $action != "STOP") { + if ($action != 'START' && $action != 'STOP') { return -1; } - if ($control != "SQL_THREAD" && $control != "IO_THREAD" && $control != null) { + if ($control != 'SQL_THREAD' && $control != 'IO_THREAD' && $control != null) { return -1; } - return $GLOBALS['dbi']->tryQuery($action . " SLAVE " . $control . ";", $link); + return $GLOBALS['dbi']->tryQuery($action . ' SLAVE ' . $control . ';', $link); } /** @@ -113,7 +113,7 @@ class Replication $link = null ) { if ($stop) { - $this->slaveControl("STOP", null, $link); + $this->slaveControl('STOP', null, $link); } $out = $GLOBALS['dbi']->tryQuery( @@ -122,13 +122,13 @@ class Replication 'MASTER_PORT=' . ($port * 1) . ',' . 'MASTER_USER=\'' . $user . '\',' . 'MASTER_PASSWORD=\'' . $password . '\',' . - 'MASTER_LOG_FILE=\'' . $pos["File"] . '\',' . - 'MASTER_LOG_POS=' . $pos["Position"] . ';', + 'MASTER_LOG_FILE=\'' . $pos['File'] . '\',' . + 'MASTER_LOG_POS=' . $pos['Position'] . ';', $link ); if ($start) { - $this->slaveControl("START", null, $link); + $this->slaveControl('START', null, $link); } return $out; @@ -155,9 +155,9 @@ class Replication $server = []; $server['user'] = $user; $server['password'] = $password; - $server["host"] = Core::sanitizeMySQLHost($host); - $server["port"] = $port; - $server["socket"] = $socket; + $server['host'] = Core::sanitizeMySQLHost($host); + $server['port'] = $port; + $server['socket'] = $socket; // 5th parameter set to true means that it's an auxiliary connection // and we must not go back to login page if it fails @@ -178,8 +178,8 @@ class Replication $output = []; if (! empty($data)) { - $output["File"] = $data[0]["File"]; - $output["Position"] = $data[0]["Position"]; + $output['File'] = $data[0]['File']; + $output['Position'] = $data[0]['Position']; } return $output; } diff --git a/libraries/classes/ReplicationGui.php b/libraries/classes/ReplicationGui.php index c35a000062..00aafbf25a 100644 --- a/libraries/classes/ReplicationGui.php +++ b/libraries/classes/ReplicationGui.php @@ -550,9 +550,9 @@ class ReplicationGui $_POST['sr_slave_control_parm'] = null; } if ($_POST['sr_slave_action'] == 'reset') { - $qStop = $this->replication->slaveControl("STOP"); - $qReset = $GLOBALS['dbi']->tryQuery("RESET SLAVE;"); - $qStart = $this->replication->slaveControl("START"); + $qStop = $this->replication->slaveControl('STOP'); + $qReset = $GLOBALS['dbi']->tryQuery('RESET SLAVE;'); + $qStart = $this->replication->slaveControl('START'); $result = ($qStop !== false && $qStop !== -1 && $qReset !== false && $qReset !== -1 && @@ -581,11 +581,11 @@ class ReplicationGui $count = $_POST['sr_skip_errors_count'] * 1; } - $qStop = $this->replication->slaveControl("STOP"); + $qStop = $this->replication->slaveControl('STOP'); $qSkip = $GLOBALS['dbi']->tryQuery( - "SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";" + 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER = ' . $count . ';' ); - $qStart = $this->replication->slaveControl("START"); + $qStart = $this->replication->slaveControl('START'); $result = ($qStop !== false && $qStop !== -1 && $qSkip !== false && $qSkip !== -1 && diff --git a/libraries/classes/Rte/Events.php b/libraries/classes/Rte/Events.php index 18c34c9912..58a7b3b9d1 100644 --- a/libraries/classes/Rte/Events.php +++ b/libraries/classes/Rte/Events.php @@ -164,7 +164,7 @@ class Events 'EVENT', $_POST['item_original_name'] ); - $drop_item = "DROP EVENT " + $drop_item = 'DROP EVENT ' . Util::backquote($_POST['item_original_name']) . ";\n"; $result = $this->dbi->tryQuery($drop_item); @@ -289,7 +289,7 @@ class Events $item = $this->getDataFromRequest(); $mode = 'add'; } elseif (! empty($_REQUEST['edit_item'])) { - $title = __("Edit event"); + $title = __('Edit event'); if (! empty($_REQUEST['item_name']) && empty($_POST['editor_process_edit']) && empty($_POST['item_changetype']) @@ -354,13 +354,13 @@ class Events global $db; $retval = []; - $columns = "`EVENT_NAME`, `STATUS`, `EVENT_TYPE`, `EXECUTE_AT`, " - . "`INTERVAL_VALUE`, `INTERVAL_FIELD`, `STARTS`, `ENDS`, " - . "`EVENT_DEFINITION`, `ON_COMPLETION`, `DEFINER`, `EVENT_COMMENT`"; - $where = "EVENT_SCHEMA " . Util::getCollateForIS() . "=" + $columns = '`EVENT_NAME`, `STATUS`, `EVENT_TYPE`, `EXECUTE_AT`, ' + . '`INTERVAL_VALUE`, `INTERVAL_FIELD`, `STARTS`, `ENDS`, ' + . '`EVENT_DEFINITION`, `ON_COMPLETION`, `DEFINER`, `EVENT_COMMENT`'; + $where = 'EVENT_SCHEMA ' . Util::getCollateForIS() . '=' . "'" . $this->dbi->escapeString($db) . "' " . "AND EVENT_NAME='" . $this->dbi->escapeString($name) . "'"; - $query = "SELECT $columns FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE $where;"; + $query = 'SELECT ' . $columns . ' FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE ' . $where . ';'; $item = $this->dbi->fetchSingleRow($query); if (! $item) { return false; @@ -429,7 +429,7 @@ class Events $original_data = ''; if ($mode == 'edit') { $original_data = "\n"; + . "type='hidden' value='" . $item['item_original_name'] . "'>\n"; } // Handle some logic first if ($operation == 'change') { @@ -449,54 +449,54 @@ class Events $isonetime_class = ' hide'; } // Create the output - $retval = ""; - $retval .= "\n\n"; + $retval = ''; + $retval .= '\n\n"; $retval .= '
' . "\n"; - $retval .= "\n"; + $retval .= "\n"; $retval .= $original_data; $retval .= Url::getHiddenInputs($db, $table) . "\n"; $retval .= "
\n"; - $retval .= "" . __('Details') . "\n"; + $retval .= '' . __('Details') . "\n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; - $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "
" . __('Event name') . "' . __('Event name') . "\n"; + $retval .= ' ' . __('Status') . "\n"; $retval .= " \n"; $retval .= "
" . __('Event type') . "' . __('Event type') . "\n"; if ($response->isAjax()) { $retval .= " \n"; } else { $retval .= " \n"; $retval .= "
\n"; - $retval .= " {$item['item_type']}\n"; + $retval .= ' ' . $item['item_type'] . "\n"; $retval .= "
\n"; $retval .= " \n"; + $retval .= "
' . __('Execute at') . "\n"; $retval .= " \n"; + $retval .= "
' . __('Execute every') . "\n"; $retval .= " \n"; $retval .= " \n"; $retval .= "
" . _pgettext('Start of recurring event', 'Start'); + $retval .= "
' . _pgettext('Start of recurring event', 'Start'); $retval .= " \n"; $retval .= " \n"; + $retval .= "
' . _pgettext('End of recurring event', 'End') . "\n"; $retval .= " \n"; + $retval .= ' ' . __('Definition') . "
" . __('On completion preserve') . "' . __('On completion preserve') . "
" . __('Definer') . "' . __('Definer') . "
" . __('Comment') . "' . __('Comment') . "
\n"; $retval .= "
\n"; if ($response->isAjax()) { - $retval .= "\n"; $retval .= "\n"; } $retval .= "
\n\n"; - $retval .= "\n\n"; + $retval .= '\n\n"; return $retval; } diff --git a/libraries/classes/Rte/Export.php b/libraries/classes/Rte/Export.php index e07aa2613c..3ea0c9c7bb 100644 --- a/libraries/classes/Rte/Export.php +++ b/libraries/classes/Rte/Export.php @@ -67,7 +67,7 @@ class Export $export_data = ''; echo "
\n" - , "$title\n" + , '' . $title . "\n" , $export_data , "
\n"; } diff --git a/libraries/classes/Rte/Footer.php b/libraries/classes/Rte/Footer.php index 965a1b8d22..9fb7bdf6ef 100644 --- a/libraries/classes/Rte/Footer.php +++ b/libraries/classes/Rte/Footer.php @@ -65,10 +65,10 @@ class Footer } $icon = mb_strtolower($name) . '_add'; - $retval = ""; - $retval .= "\n"; + $retval = ''; + $retval .= '\n"; $retval .= "
\n"; - $retval .= "" . _pgettext('Create new procedure', 'New') . "\n"; + $retval .= '' . _pgettext('Create new procedure', 'New') . "\n"; $retval .= " \n"; $retval .= "
\n"; - $retval .= "\n\n"; + $retval .= '\n\n"; return $retval; } @@ -137,12 +137,12 @@ class Footer $options = [ 0 => [ 'label' => __('OFF'), - 'value' => "SET GLOBAL event_scheduler=\"OFF\"", + 'value' => 'SET GLOBAL event_scheduler="OFF"', 'selected' => $es_state != 'on', ], 1 => [ 'label' => __('ON'), - 'value' => "SET GLOBAL event_scheduler=\"ON\"", + 'value' => 'SET GLOBAL event_scheduler="ON"', 'selected' => $es_state == 'on', ], ]; @@ -153,7 +153,7 @@ class Footer $retval .= $this->getLinks('CREATE_EVENT', 'EVENT', 'EVENT'); $retval .= "
\n"; $retval .= " \n"; - $retval .= " " . __('Event scheduler status') . "\n"; + $retval .= ' ' . __('Event scheduler status') . "\n"; $retval .= " \n"; $retval .= "
\n"; // show the toggle button @@ -173,7 +173,7 @@ class Footer $retval .= "
\n"; $retval .= "
\n"; $retval .= "
\n"; - $retval .= ""; + $retval .= ''; $retval .= "\n"; return $retval; diff --git a/libraries/classes/Rte/General.php b/libraries/classes/Rte/General.php index d56f904bdb..83ca6a6a8b 100644 --- a/libraries/classes/Rte/General.php +++ b/libraries/classes/Rte/General.php @@ -58,7 +58,7 @@ class General // this just in case. $errors[] = $error . '
' . __('The backed up query was:') - . "\"" . htmlspecialchars($createStatement) . "\"" . '
' + . '"' . htmlspecialchars($createStatement) . '"' . '
' . __('MySQL said: ') . $this->dbi->getError(); return $errors; @@ -93,7 +93,7 @@ class General $response->addJSON('message', $editor); $response->addJSON('title', $title); } else { - echo "\n\n

$title

\n\n$editor"; + echo "\n\n

" . $title . "

\n\n" . $editor; unset($_POST); } exit; diff --git a/libraries/classes/Rte/Routines.php b/libraries/classes/Rte/Routines.php index fca54a26f5..8f303fb709 100644 --- a/libraries/classes/Rte/Routines.php +++ b/libraries/classes/Rte/Routines.php @@ -194,7 +194,7 @@ class Routines $routine = $this->getDataFromRequest(); $mode = 'add'; } elseif (! empty($_REQUEST['edit_item'])) { - $title = __("Edit routine"); + $title = __('Edit routine'); if (! $operation && ! empty($_GET['item_name']) && empty($_POST['editor_process_edit']) ) { @@ -220,7 +220,7 @@ class Routines $response->addJSON('paramTemplate', $this->getParameterRow()); $response->addJSON('type', $routine['item_type']); } else { - echo "\n\n

$title

\n\n$editor"; + echo "\n\n

" . $title . "

\n\n" . $editor; } exit; } else { @@ -291,7 +291,7 @@ class Routines $privilegesBackup = $this->backupPrivileges(); - $drop_routine = "DROP {$_POST['item_original_type']} " + $drop_routine = 'DROP ' . $_POST['item_original_type'] . ' ' . Util::backquote($_POST['item_original_name']) . ";\n"; $result = $this->dbi->tryQuery($drop_routine); @@ -655,14 +655,14 @@ class Routines $retval = []; // Build and execute the query - $fields = "SPECIFIC_NAME, ROUTINE_TYPE, DTD_IDENTIFIER, " - . "ROUTINE_DEFINITION, IS_DETERMINISTIC, SQL_DATA_ACCESS, " - . "ROUTINE_COMMENT, SECURITY_TYPE"; - $where = "ROUTINE_SCHEMA " . Util::getCollateForIS() . "=" + $fields = 'SPECIFIC_NAME, ROUTINE_TYPE, DTD_IDENTIFIER, ' + . 'ROUTINE_DEFINITION, IS_DETERMINISTIC, SQL_DATA_ACCESS, ' + . 'ROUTINE_COMMENT, SECURITY_TYPE'; + $where = 'ROUTINE_SCHEMA ' . Util::getCollateForIS() . '=' . "'" . $this->dbi->escapeString($db) . "' " . "AND SPECIFIC_NAME='" . $this->dbi->escapeString($name) . "'" . "AND ROUTINE_TYPE='" . $this->dbi->escapeString($type) . "'"; - $query = "SELECT $fields FROM INFORMATION_SCHEMA.ROUTINES WHERE $where;"; + $query = 'SELECT ' . $fields . ' FROM INFORMATION_SCHEMA.ROUTINES WHERE ' . $where . ';'; $routine = $this->dbi->fetchSingleRow($query, 'ASSOC'); @@ -897,10 +897,10 @@ class Routines if ($mode == 'edit') { $original_routine = "\n" + . "value='" . $routine['item_original_name'] . "'>\n" . "\n"; + . "value='" . $routine['item_original_type'] . "'>\n"; } $isfunction_class = ''; $isprocedure_class = ''; @@ -915,32 +915,32 @@ class Routines } // Create the output - $retval = ""; - $retval .= "\n\n"; $retval .= '
' . "\n"; - $retval .= "\n"; + $retval .= "\n"; $retval .= $original_routine; $retval .= Url::getHiddenInputs($db) . "\n"; $retval .= "
\n"; - $retval .= "" . __('Details') . "\n"; + $retval .= '' . __('Details') . "\n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " "; - $retval .= "
" . __('Routine name') . "' . __('Routine name') . "
" . __('Type') . "' . __('Type') . "\n"; if ($response->isAjax()) { $retval .= " \n"; } else { $retval .= "\n" + . " value='" . $routine['item_type'] . "'>\n" . "
\n" . $routine['item_type'] . "\n" . "
\n" @@ -951,58 +951,58 @@ class Routines $retval .= "
" . __('Parameters') . "' . __('Parameters') . "\n"; // parameter handling start $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; + $retval .= ' \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= " \n"; - $retval .= " "; + $retval .= ' '; $retval .= " \n"; $retval .= " \n"; for ($i = 0; $i < $routine['item_num_params']; $i++) { // each parameter $retval .= $this->getParameterRow($routine, $i, $isprocedure_class); } $retval .= " \n"; - $retval .= "
" + $retval .= " " . __('Direction') . "" . __('Name') . "" . __('Type') . "" . __('Length/Values') . "' . __('Name') . "' . __('Type') . "' . __('Length/Values') . "" . __('Options') . " 
"; - $retval .= "
 "; + $retval .= '
'; + $retval .= ' '; + $retval .= ''; + $retval .= ''; + $retval .= '  '; + $retval .= ' '; $retval .= " "; - $retval .= " "; - $retval .= " "; - $retval .= ""; + $retval .= ' '; + $retval .= ''; // parameter handling end $retval .= ""; - $retval .= " " . __('Return type') . ""; + $retval .= ' ' . __('Return type') . ''; $retval .= " "; - $retval .= ""; + $retval .= ' '; + $retval .= ''; $retval .= ""; - $retval .= " " . __('Return length/values') . ""; + $retval .= ' ' . __('Return length/values') . ''; $retval .= " "; $retval .= " ---"; - $retval .= ""; + $retval .= ''; $retval .= ""; - $retval .= " " . __('Return options') . ""; - $retval .= "
"; + $retval .= ' ' . __('Return options') . ''; + $retval .= '
'; $retval .= '' . "\n"; - $retval .= "
"; + $retval .= '
'; $retval .= "
"; + $retval .= ' '; $retval .= "
---
"; - $retval .= ""; - $retval .= ""; - $retval .= ""; - $retval .= " " . __('Definition') . ""; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ' ' . __('Definition') . ''; $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " " . __('Is deterministic') . ""; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ' ' . __('Is deterministic') . ''; $retval .= " "; - $retval .= ""; + . $routine['item_isdeterministic'] . '>'; + $retval .= ''; if (isset($_REQUEST['edit_item']) && ! empty($_REQUEST['edit_item']) ) { - $retval .= ""; - $retval .= " " . __('Adjust privileges'); + $retval .= ''; + $retval .= ' ' . __('Adjust privileges'); $retval .= MySQLDocumentation::showDocumentation('faq', 'faq6-39'); - $retval .= ""; + $retval .= ''; if ($GLOBALS['proc_priv'] && $GLOBALS['is_reload_priv'] ) { @@ -1059,48 +1059,48 @@ class Routines } else { $retval .= " "; } - $retval .= ""; + $retval .= ''; } - $retval .= ""; - $retval .= " " . __('Definer') . ""; + $retval .= ''; + $retval .= ' ' . __('Definer') . ''; $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " " . __('Security type') . ""; + $retval .= ''; + $retval .= ''; + $retval .= ' ' . __('Security type') . ''; $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " " . __('SQL data access') . ""; + . $routine['item_securitytype_invoker'] . '>INVOKER'; + $retval .= ' '; + $retval .= ''; + $retval .= ''; + $retval .= ' ' . __('SQL data access') . ''; $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= " " . __('Comment') . ""; + $retval .= ' '; + $retval .= ''; + $retval .= ''; + $retval .= ' ' . __('Comment') . ''; $retval .= " "; - $retval .= ""; - $retval .= ""; - $retval .= "
"; + $retval .= ''; + $retval .= ''; + $retval .= ''; if ($response->isAjax()) { $retval .= ""; - $retval .= ""; + $retval .= ''; } - $retval .= "
"; - $retval .= ""; + $retval .= ''; + $retval .= ''; return $retval; } @@ -1135,16 +1135,16 @@ class Routines $arr = explode('@', $_POST['item_definer']); $do_backquote = true; - if (substr($arr[0], 0, 1) === "`" - && substr($arr[0], -1) === "`" + if (substr($arr[0], 0, 1) === '`' + && substr($arr[0], -1) === '`' ) { $do_backquote = false; } $query .= 'DEFINER=' . Util::backquote($arr[0], $do_backquote); $do_backquote = true; - if (substr($arr[1], 0, 1) === "`" - && substr($arr[1], -1) === "`" + if (substr($arr[1], 0, 1) === '`' + && substr($arr[1], -1) === '`' ) { $do_backquote = false; } @@ -1191,12 +1191,12 @@ class Routines && ! empty($_POST['item_param_dir'][$i]) && in_array($_POST['item_param_dir'][$i], $param_directions) ) { - $params .= $_POST['item_param_dir'][$i] . " " + $params .= $_POST['item_param_dir'][$i] . ' ' . Util::backquote($item_param_name[$i]) - . " " . $item_param_type[$i]; + . ' ' . $item_param_type[$i]; } elseif ($_POST['item_type'] == 'FUNCTION') { $params .= Util::backquote($item_param_name[$i]) - . " " . $item_param_type[$i]; + . ' ' . $item_param_type[$i]; } elseif (! $warned_about_dir) { $warned_about_dir = true; $errors[] = sprintf( @@ -1212,7 +1212,7 @@ class Routines $item_param_type[$i] ) ) { - $params .= "(" . $item_param_length[$i] . ")"; + $params .= '(' . $item_param_length[$i] . ')'; } elseif ($item_param_length[$i] == '' && preg_match( '@^(ENUM|SET|VARCHAR|VARBINARY)$@i', @@ -1246,7 +1246,7 @@ class Routines } } if ($i != (count($item_param_name) - 1)) { - $params .= ", "; + $params .= ', '; } } else { $errors[] = __( @@ -1256,7 +1256,7 @@ class Routines } } } - $query .= "(" . $params . ") "; + $query .= '(' . $params . ') '; if ($_POST['item_type'] == 'FUNCTION') { $item_returntype = isset($_POST['item_returntype']) ? $_POST['item_returntype'] @@ -1268,7 +1268,7 @@ class Routines Util::getSupportedDatatypes() ) ) { - $query .= "RETURNS " . $item_returntype; + $query .= 'RETURNS ' . $item_returntype; } else { $errors[] = __('You must provide a valid return type for the routine.'); } @@ -1279,7 +1279,7 @@ class Routines $item_returntype ) ) { - $query .= "(" . $_POST['item_returnlength'] . ")"; + $query .= '(' . $_POST['item_returnlength'] . ')'; } elseif (empty($_POST['item_returnlength']) && preg_match( '@^(ENUM|SET|VARCHAR|VARBINARY)$@i', @@ -1393,40 +1393,40 @@ class Routines $all_functions ) ) { - $queries[] = "SET @p$i=" + $queries[] = 'SET @p' . $i . '=' . $_POST['funcs'][$routine['item_param_name'][$i]] - . "('$value');\n"; + . "('" . $value . "');\n"; } else { - $queries[] = "SET @p$i='$value';\n"; + $queries[] = 'SET @p' . $i . "='" . $value . "';\n"; } - $args[] = "@p$i"; + $args[] = '@p' . $i; } else { - $args[] = "@p$i"; + $args[] = '@p' . $i; } if ($routine['item_type'] == 'PROCEDURE') { if ($routine['item_param_dir'][$i] == 'OUT' || $routine['item_param_dir'][$i] == 'INOUT' ) { - $end_query[] = "@p$i AS " + $end_query[] = '@p' . $i . ' AS ' . Util::backquote($routine['item_param_name'][$i]); } } } if ($routine['item_type'] == 'PROCEDURE') { - $queries[] = "CALL " . Util::backquote($routine['item_name']) - . "(" . implode(', ', $args) . ");\n"; + $queries[] = 'CALL ' . Util::backquote($routine['item_name']) + . '(' . implode(', ', $args) . ");\n"; if (count($end_query)) { - $queries[] = "SELECT " . implode(', ', $end_query) . ";\n"; + $queries[] = 'SELECT ' . implode(', ', $end_query) . ";\n"; } } else { - $queries[] = "SELECT " . Util::backquote($routine['item_name']) - . "(" . implode(', ', $args) . ") " - . "AS " . Util::backquote($routine['item_name']) + $queries[] = 'SELECT ' . Util::backquote($routine['item_name']) + . '(' . implode(', ', $args) . ') ' + . 'AS ' . Util::backquote($routine['item_name']) . ";\n"; } // Get all the queries as one SQL statement - $multiple_query = implode("", $queries); + $multiple_query = implode('', $queries); $outcome = true; $affected = 0; @@ -1444,31 +1444,31 @@ class Routines $output = Generator::formatSql(implode("\n", $queries)); // Display results - $output .= "
"; + $output .= '
'; $output .= sprintf( __('Execution results of routine %s'), Util::backquote(htmlspecialchars($routine['item_name'])) ); - $output .= ""; + $output .= ''; do { $result = $this->dbi->storeResult(); $num_rows = $this->dbi->numRows($result); if (($result !== false) && ($num_rows > 0)) { - $output .= ""; + $output .= '
'; foreach ($this->dbi->getFieldsMeta($result) as $field) { - $output .= ""; + $output .= ''; } - $output .= ""; + $output .= ''; while ($row = $this->dbi->fetchAssoc($result)) { - $output .= "" . $this->browseRow($row) . ""; + $output .= '' . $this->browseRow($row) . ''; } - $output .= "
"; + $output .= ''; $output .= htmlspecialchars($field->name); - $output .= "
"; + $output .= ''; $nbResultsetToDisplay++; $affected = $num_rows; } @@ -1477,14 +1477,14 @@ class Routines break; } - $output .= "
"; + $output .= '
'; $this->dbi->freeResult($result); } while ($outcome = $this->dbi->nextResult()); } if ($outcome) { - $output .= "
"; + $output .= '
'; $message = __('Your SQL query has been executed successfully.'); if ($routine['item_type'] == 'PROCEDURE') { @@ -1552,14 +1552,14 @@ class Routines if ($routine !== false) { $form = $this->getExecuteForm($routine); if ($response->isAjax()) { - $title = __("Execute routine") . " " . Util::backquote( + $title = __('Execute routine') . ' ' . Util::backquote( htmlentities($_GET['item_name'], ENT_QUOTES) ); $response->addJSON('message', $form); $response->addJSON('title', $title); $response->addJSON('dialog', true); } else { - echo "\n\n

" . __("Execute routine") . "

\n\n"; + echo "\n\n

" . __('Execute routine') . "

\n\n"; echo $form; } exit; @@ -1595,7 +1595,7 @@ class Routines } else { $value = htmlspecialchars($value); } - $output .= "" . $value . ""; + $output .= '' . $value . ''; } return $output; } @@ -1624,33 +1624,33 @@ class Routines } // Create the output - $retval = ""; + $retval = ''; $retval .= "\n\n"; $retval .= '
\n"; $retval .= "\n"; $retval .= Url::getHiddenInputs($db) . "\n"; $retval .= "
\n"; if (! $response->isAjax()) { - $retval .= "{$routine['item_name']}\n"; + $retval .= '' . $routine['item_name'] . "\n"; $retval .= "\n"; $retval .= "\n"; } else { - $retval .= "" . __('Routine parameters') . "\n"; + $retval .= '' . __('Routine parameters') . "\n"; $retval .= "
\n"; $retval .= __('Routine parameters'); $retval .= "
\n"; } $retval .= "\n"; - $retval .= "\n"; - $retval .= "\n"; + $retval .= '\n"; + $retval .= '\n"; if ($cfg['ShowFunctionFields']) { - $retval .= "\n"; + $retval .= '\n"; } - $retval .= "\n"; + $retval .= '\n"; $retval .= "\n"; // Get a list of data types that are not yet supported. $no_support_types = Util::unsupportedDatatypes(); @@ -1661,8 +1661,8 @@ class Routines continue; } $retval .= "\n\n"; - $retval .= "\n"; - $retval .= "\n"; + $retval .= '\n"; + $retval .= '\n"; if ($cfg['ShowFunctionFields']) { $retval .= "\n"; } @@ -1722,7 +1722,7 @@ class Routines )) { $retval .= "\n"; } else { - $retval .= "\n"; } $retval .= "\n"; diff --git a/libraries/classes/Rte/RteList.php b/libraries/classes/Rte/RteList.php index 8e5f691f3f..6d6c6f5b54 100644 --- a/libraries/classes/Rte/RteList.php +++ b/libraries/classes/Rte/RteList.php @@ -78,7 +78,7 @@ class RteList /** * Generate output */ - $retval = "\n"; + $retval = '\n"; $retval .= '\n"; $retval .= " \n"; - $retval .= " " . $this->words->get('title') . "\n"; - $retval .= " " + $retval .= ' ' . $this->words->get('title') . "\n"; + $retval .= ' ' . MySQLDocumentation::show($this->words->get('docu')) . "\n"; $retval .= " \n"; - $retval .= "
\n"; - $retval .= " " . $this->words->get('nothing') . "\n"; + $retval .= "
\n"; + $retval .= ' ' . $this->words->get('nothing') . "\n"; $retval .= "
\n"; - $retval .= "
" . __('Name') . "" . __('Type') . "' . __('Name') . "' . __('Type') . "" . __('Function') . "' . __('Function') . "" . __('Value') . "' . __('Value') . "
{$routine['item_param_name'][$i]}{$routine['item_param_type'][$i]}' . $routine['item_param_name'][$i] . "' . $routine['item_param_type'][$i] . "\n"; if (false !== stripos($routine['item_param_type'][$i], 'enum') @@ -1687,7 +1687,7 @@ class Routines $retval .= ""; + $retval .= ''; } $retval .= "
\n"; + $retval .= "
\n"; $retval .= " \n"; $retval .= " \n"; // th cells with a colspan need corresponding td cells, according to W3C switch ($type) { case 'routine': $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= " \n"; // see comment above for ($i = 0; $i < 7; $i++) { @@ -127,13 +127,13 @@ class RteList break; case 'trigger': $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; if (empty($table)) { - $retval .= " \n"; + $retval .= ' \n"; } $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= " \n"; // see comment above for ($i = 0; $i < (empty($table) ? 7 : 6); $i++) { @@ -142,10 +142,10 @@ class RteList break; case 'event': $retval .= " \n"; - $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; + $retval .= ' \n"; $retval .= " \n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= " \n"; // see comment above for ($i = 0; $i < 6; $i++) { @@ -207,7 +207,7 @@ class RteList $retval .= "\n"; $retval .= "\n"; - $retval .= "\n"; + $retval .= '\n"; return $retval; } @@ -230,7 +230,7 @@ class RteList Util::backquote($routine['name']) ); - $retval = " \n"; + $retval = " \n"; $retval .= " \n"; @@ -248,11 +248,11 @@ class RteList // this is for our purpose to decide whether to // show the edit link or not, so we need the DEFINER for the routine - $where = "ROUTINE_SCHEMA " . Util::getCollateForIS() . "=" + $where = 'ROUTINE_SCHEMA ' . Util::getCollateForIS() . '=' . "'" . $this->dbi->escapeString($db) . "' " . "AND SPECIFIC_NAME='" . $this->dbi->escapeString($routine['name']) . "'" . "AND ROUTINE_TYPE='" . $this->dbi->escapeString($routine['type']) . "'"; - $query = "SELECT `DEFINER` FROM INFORMATION_SCHEMA.ROUTINES WHERE $where;"; + $query = 'SELECT `DEFINER` FROM INFORMATION_SCHEMA.ROUTINES WHERE ' . $where . ';'; $routine_definer = $this->dbi->fetchValue($query); $curr_user = $this->dbi->getCurrentUser(); @@ -272,7 +272,7 @@ class RteList 'item_type' => $routine['type'], ]) . '">' . $titles['Edit'] . "\n"; } else { - $retval .= " {$titles['NoEdit']}\n"; + $retval .= ' ' . $titles['NoEdit'] . "\n"; } $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; @@ -391,7 +391,7 @@ class RteList { global $db, $table, $titles; - $retval = " \n"; + $retval = " \n"; $retval .= " \n"; if (empty($table)) { @@ -411,7 +411,7 @@ class RteList 'db' => $db, 'table' => $trigger['table'], ]) . '">' - . htmlspecialchars($trigger['table']) . ""; + . htmlspecialchars($trigger['table']) . ''; $retval .= " \n"; } $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; @@ -485,7 +485,7 @@ class RteList Util::backquote($event['name']) ); - $retval = " \n"; + $retval = " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; $retval .= " \n"; diff --git a/libraries/classes/Rte/Triggers.php b/libraries/classes/Rte/Triggers.php index c4e17efd9d..969a28bbc1 100644 --- a/libraries/classes/Rte/Triggers.php +++ b/libraries/classes/Rte/Triggers.php @@ -268,7 +268,7 @@ class Triggers $item = $this->getDataFromRequest(); $mode = 'add'; } elseif (! empty($_REQUEST['edit_item'])) { - $title = __("Edit trigger"); + $title = __('Edit trigger'); if (! empty($_REQUEST['item_name']) && empty($_POST['editor_process_edit']) ) { @@ -373,40 +373,40 @@ class Triggers $original_data = ''; if ($mode == 'edit') { $original_data = "\n"; + . "type='hidden' value='" . $item['item_original_name'] . "'>\n"; } - $query = "SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` "; + $query = 'SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` '; $query .= "WHERE `TABLE_SCHEMA`='" . $this->dbi->escapeString($db) . "' "; $query .= "AND `TABLE_TYPE` IN ('BASE TABLE', 'SYSTEM VERSIONED')"; $tables = $this->dbi->fetchResult($query); // Create the output - $retval = ""; - $retval .= "\n\n"; + $retval = ''; + $retval .= '\n\n"; $retval .= '' . "\n"; - $retval .= "\n"; + $retval .= "\n"; $retval .= $original_data; $retval .= Url::getHiddenInputs($db, $table) . "\n"; $retval .= "
\n"; - $retval .= "" . __('Details') . "\n"; + $retval .= '' . __('Details') . "\n"; $retval .= "
" . __('Name') . "' . __('Name') . "" . __('Action') . "" . __('Type') . "" . __('Returns') . "' . __('Type') . "' . __('Returns') . "
" . __('Name') . "' . __('Name') . "" . __('Table') . "' . __('Table') . "" . __('Action') . "" . __('Time') . "" . __('Event') . "' . __('Time') . "' . __('Event') . "
" . __('Name') . "" . __('Status') . "' . __('Name') . "' . __('Status') . "" . __('Action') . "" . __('Type') . "' . __('Type') . "
\n"; $retval .= ' \n"; $retval .= " \n"; - $retval .= " " + $retval .= ' ' . htmlspecialchars($routine['name']) . "\n"; $retval .= " \n"; $retval .= " \n"; @@ -330,7 +330,7 @@ class RteList ) . '">' . $titles['Execute'] . "\n"; } else { - $retval .= " {$titles['NoExecute']}\n"; + $retval .= ' ' . $titles['NoExecute'] . "\n"; } } @@ -349,7 +349,7 @@ class RteList 'item_type' => $routine['type'], ]) . '">' . $titles['Export'] . "\n"; } else { - $retval .= " {$titles['NoExport']}\n"; + $retval .= ' ' . $titles['NoExport'] . "\n"; } $retval .= " \n"; @@ -368,10 +368,10 @@ class RteList ); $retval .= " \n"; - $retval .= " {$routine['type']}\n"; + $retval .= ' ' . $routine['type'] . "\n"; $retval .= " \n"; - $retval .= " " + $retval .= ' ' . htmlspecialchars($routine['returns']) . "\n"; $retval .= "
\n"; $retval .= ' \n"; $retval .= " \n"; - $retval .= " " . htmlspecialchars($trigger['name']) . "\n"; + $retval .= ' ' . htmlspecialchars($trigger['name']) . "\n"; $retval .= " \n"; $retval .= " \n"; @@ -425,7 +425,7 @@ class RteList 'item_name' => $trigger['name'], ]) . '">' . $titles['Edit'] . "\n"; } else { - $retval .= " {$titles['NoEdit']}\n"; + $retval .= ' ' . $titles['NoEdit'] . "\n"; } $retval .= " \n"; @@ -454,14 +454,14 @@ class RteList ['class' => 'ajax drop_anchor'] ); } else { - $retval .= " {$titles['NoDrop']}\n"; + $retval .= ' ' . $titles['NoDrop'] . "\n"; } $retval .= " \n"; - $retval .= " {$trigger['action_timing']}\n"; + $retval .= ' ' . $trigger['action_timing'] . "\n"; $retval .= " \n"; - $retval .= " {$trigger['event_manipulation']}\n"; + $retval .= ' ' . $trigger['event_manipulation'] . "\n"; $retval .= "
\n"; $retval .= ' \n"; $retval .= " \n"; - $retval .= " " + $retval .= ' ' . htmlspecialchars($event['name']) . "\n"; $retval .= " \n"; $retval .= " \n"; - $retval .= " {$event['status']}\n"; + $retval .= ' ' . $event['status'] . "\n"; $retval .= " \n"; if (Util::currentUserHasPrivilege('EVENT', $db)) { @@ -512,7 +512,7 @@ class RteList 'item_name' => $event['name'], ]) . '">' . $titles['Edit'] . "\n"; } else { - $retval .= " {$titles['NoEdit']}\n"; + $retval .= ' ' . $titles['NoEdit'] . "\n"; } $retval .= " \n"; @@ -540,11 +540,11 @@ class RteList ['class' => 'ajax drop_anchor'] ); } else { - $retval .= " {$titles['NoDrop']}\n"; + $retval .= ' ' . $titles['NoDrop'] . "\n"; } $retval .= " \n"; - $retval .= " {$event['type']}\n"; + $retval .= ' ' . $event['type'] . "\n"; $retval .= "
\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "\n"; - $retval .= " \n"; + $retval .= ' \n"; $retval .= " \n"; $retval .= "\n"; $retval .= "
" . __('Trigger name') . "' . __('Trigger name') . "
" . __('Table') . "' . __('Table') . "\n"; $retval .= "
" . _pgettext('Trigger action time', 'Time') . "' . _pgettext('Trigger action time', 'Time') . "
" . __('Event') . "' . __('Event') . "
" . __('Definition') . "' . __('Definition') . "
" . __('Definer') . "' . __('Definer') . "
\n"; $retval .= "
\n"; if ($response->isAjax()) { - $retval .= "\n"; $retval .= "\n"; } $retval .= "\n\n"; - $retval .= "\n\n"; + $retval .= '\n\n"; return $retval; } diff --git a/libraries/classes/Sanitize.php b/libraries/classes/Sanitize.php index 520b35923d..7835e2826a 100644 --- a/libraries/classes/Sanitize.php +++ b/libraries/classes/Sanitize.php @@ -330,7 +330,7 @@ class Sanitize } elseif (is_array($value)) { $result .= '['; foreach ($value as $val) { - $result .= self::formatJsVal($val) . ","; + $result .= self::formatJsVal($val) . ','; } $result .= "];\n"; } else { diff --git a/libraries/classes/SavedSearches.php b/libraries/classes/SavedSearches.php index b30f53fb72..8f4a2e3da8 100644 --- a/libraries/classes/SavedSearches.php +++ b/libraries/classes/SavedSearches.php @@ -285,7 +285,7 @@ class SavedSearches } $savedSearchesTbl - = Util::backquote($this->_config['cfgRelation']['db']) . "." + = Util::backquote($this->_config['cfgRelation']['db']) . '.' . Util::backquote($this->_config['cfgRelation']['savedsearches']); //If it's an insert. @@ -307,9 +307,9 @@ class SavedSearches exit; } - $sqlQuery = "INSERT INTO " . $savedSearchesTbl - . "(`username`, `db_name`, `search_name`, `search_data`)" - . " VALUES (" + $sqlQuery = 'INSERT INTO ' . $savedSearchesTbl + . '(`username`, `db_name`, `search_name`, `search_data`)' + . ' VALUES (' . "'" . $GLOBALS['dbi']->escapeString($this->getUsername()) . "'," . "'" . $GLOBALS['dbi']->escapeString($this->getDbname()) . "'," . "'" . $GLOBALS['dbi']->escapeString($this->getSearchName()) . "'," @@ -328,7 +328,7 @@ class SavedSearches //Else, it's an update. $wheres = [ - "id != " . $this->getId(), + 'id != ' . $this->getId(), "search_name = '" . $GLOBALS['dbi']->escapeString($this->getSearchName()) . "'", ]; $existingSearches = $this->getList($wheres); @@ -344,12 +344,12 @@ class SavedSearches exit; } - $sqlQuery = "UPDATE " . $savedSearchesTbl + $sqlQuery = 'UPDATE ' . $savedSearchesTbl . "SET `search_name` = '" . $GLOBALS['dbi']->escapeString($this->getSearchName()) . "', " . "`search_data` = '" . $GLOBALS['dbi']->escapeString(json_encode($this->getCriterias())) . "' " - . "WHERE id = " . $this->getId(); + . 'WHERE id = ' . $this->getId(); return (bool) $this->relation->queryAsControlUser($sqlQuery); } @@ -372,10 +372,10 @@ class SavedSearches } $savedSearchesTbl - = Util::backquote($this->_config['cfgRelation']['db']) . "." + = Util::backquote($this->_config['cfgRelation']['db']) . '.' . Util::backquote($this->_config['cfgRelation']['savedsearches']); - $sqlQuery = "DELETE FROM " . $savedSearchesTbl + $sqlQuery = 'DELETE FROM ' . $savedSearchesTbl . "WHERE id = '" . $GLOBALS['dbi']->escapeString($this->getId()) . "'"; return (bool) $this->relation->queryAsControlUser($sqlQuery); @@ -400,10 +400,10 @@ class SavedSearches } $savedSearchesTbl = Util::backquote($this->_config['cfgRelation']['db']) - . "." + . '.' . Util::backquote($this->_config['cfgRelation']['savedsearches']); - $sqlQuery = "SELECT id, search_name, search_data " - . "FROM " . $savedSearchesTbl . " " + $sqlQuery = 'SELECT id, search_name, search_data ' + . 'FROM ' . $savedSearchesTbl . ' ' . "WHERE id = '" . $GLOBALS['dbi']->escapeString($this->getId()) . "' "; $resList = $this->relation->queryAsControlUser($sqlQuery); @@ -439,19 +439,19 @@ class SavedSearches } $savedSearchesTbl = Util::backquote($this->_config['cfgRelation']['db']) - . "." + . '.' . Util::backquote($this->_config['cfgRelation']['savedsearches']); - $sqlQuery = "SELECT id, search_name " - . "FROM " . $savedSearchesTbl . " " - . "WHERE " + $sqlQuery = 'SELECT id, search_name ' + . 'FROM ' . $savedSearchesTbl . ' ' + . 'WHERE ' . "username = '" . $GLOBALS['dbi']->escapeString($this->getUsername()) . "' " . "AND db_name = '" . $GLOBALS['dbi']->escapeString($this->getDbname()) . "' "; foreach ($wheres as $where) { - $sqlQuery .= "AND " . $where . " "; + $sqlQuery .= 'AND ' . $where . ' '; } - $sqlQuery .= "order by search_name ASC "; + $sqlQuery .= 'order by search_name ASC '; $resList = $this->relation->queryAsControlUser($sqlQuery); diff --git a/libraries/classes/Scripts.php b/libraries/classes/Scripts.php index 16038765fd..7adf0fb02c 100644 --- a/libraries/classes/Scripts.php +++ b/libraries/classes/Scripts.php @@ -122,7 +122,7 @@ class Scripts */ public function addCode($code) { - $this->_code .= "$code\n"; + $this->_code .= $code . "\n"; } /** @@ -136,7 +136,7 @@ class Scripts $retval = []; foreach ($this->_files as $file) { //If filename contains a "?", continue. - if (strpos($file['filename'], "?") !== false) { + if (strpos($file['filename'], '?') !== false) { continue; } $retval[] = [ diff --git a/libraries/classes/Server/Privileges.php b/libraries/classes/Server/Privileges.php index 5f732ebed0..2af370a216 100644 --- a/libraries/classes/Server/Privileges.php +++ b/libraries/classes/Server/Privileges.php @@ -513,18 +513,18 @@ class Privileges public function getSqlQueryForDisplayPrivTable($db, $table, $username, $hostname) { if ($db == '*') { - return "SELECT * FROM `mysql`.`user`" + return 'SELECT * FROM `mysql`.`user`' . " WHERE `User` = '" . $this->dbi->escapeString($username) . "'" . " AND `Host` = '" . $this->dbi->escapeString($hostname) . "';"; } elseif ($table == '*') { - return "SELECT * FROM `mysql`.`db`" + return 'SELECT * FROM `mysql`.`db`' . " WHERE `User` = '" . $this->dbi->escapeString($username) . "'" . " AND `Host` = '" . $this->dbi->escapeString($hostname) . "'" . " AND '" . $this->dbi->escapeString(Util::unescapeMysqlWildcards($db)) . "'" - . " LIKE `Db`;"; + . ' LIKE `Db`;'; } - return "SELECT `Table_priv`" - . " FROM `mysql`.`tables_priv`" + return 'SELECT `Table_priv`' + . ' FROM `mysql`.`tables_priv`' . " WHERE `User` = '" . $this->dbi->escapeString($username) . "'" . " AND `Host` = '" . $this->dbi->escapeString($hostname) . "'" . " AND `Db` = '" . $this->dbi->escapeString(Util::unescapeMysqlWildcards($db)) . "'" @@ -543,13 +543,13 @@ class Privileges { $cfgRelation = $this->relation->getRelationsParam(); $groupTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['usergroups']); + . '.' . Util::backquote($cfgRelation['usergroups']); $userTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); + . '.' . Util::backquote($cfgRelation['users']); $userGroup = ''; if (isset($GLOBALS['username'])) { - $sql_query = "SELECT `usergroup` FROM " . $userTable + $sql_query = 'SELECT `usergroup` FROM ' . $userTable . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $userGroup = $this->dbi->fetchValue( $sql_query, @@ -560,7 +560,7 @@ class Privileges } $allUserGroups = ['' => '']; - $sql_query = "SELECT DISTINCT `usergroup` FROM " . $groupTable; + $sql_query = 'SELECT DISTINCT `usergroup` FROM ' . $groupTable; $result = $this->relation->queryAsControlUser($sql_query, false); if ($result) { while ($row = $this->dbi->fetchRow($result)) { @@ -593,9 +593,9 @@ class Privileges } $userTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); + . '.' . Util::backquote($cfgRelation['users']); - $sql_query = "SELECT `usergroup` FROM " . $userTable + $sql_query = 'SELECT `usergroup` FROM ' . $userTable . " WHERE `username` = '" . $this->dbi->escapeString($username) . "'"; $oldUserGroup = $this->dbi->fetchValue( $sql_query, @@ -605,15 +605,15 @@ class Privileges ); if ($oldUserGroup === false) { - $upd_query = "INSERT INTO " . $userTable . "(`username`, `usergroup`)" + $upd_query = 'INSERT INTO ' . $userTable . '(`username`, `usergroup`)' . " VALUES ('" . $this->dbi->escapeString($username) . "', " . "'" . $this->dbi->escapeString($userGroup) . "')"; } else { if (empty($userGroup)) { - $upd_query = "DELETE FROM " . $userTable + $upd_query = 'DELETE FROM ' . $userTable . " WHERE `username`='" . $this->dbi->escapeString($username) . "'"; } elseif ($oldUserGroup != $userGroup) { - $upd_query = "UPDATE " . $userTable + $upd_query = 'UPDATE ' . $userTable . " SET `usergroup`='" . $this->dbi->escapeString($userGroup) . "'" . " WHERE `username`='" . $this->dbi->escapeString($username) . "'"; } @@ -823,8 +823,8 @@ class Privileges */ public function getActiveAuthPlugins() { - $get_plugins_query = "SELECT `PLUGIN_NAME`, `PLUGIN_DESCRIPTION`" - . " FROM `information_schema`.`PLUGINS` " + $get_plugins_query = 'SELECT `PLUGIN_NAME`, `PLUGIN_DESCRIPTION`' + . ' FROM `information_schema`.`PLUGINS` ' . "WHERE `PLUGIN_TYPE` = 'AUTHENTICATION';"; $resultset = $this->dbi->query($get_plugins_query); @@ -1087,7 +1087,7 @@ class Privileges $query_prefix = "ALTER USER '" . $this->dbi->escapeString($username) . "'@'" . $this->dbi->escapeString($hostname) . "'" - . " IDENTIFIED WITH " + . ' IDENTIFIED WITH ' . $authentication_plugin . " BY '"; } else { @@ -1137,7 +1137,7 @@ class Privileges : $hashing_function . '(\'' . preg_replace('@.@s', '*', $_POST['pma_pw']) . '\')'); - $local_query = "UPDATE `mysql`.`user` SET " + $local_query = 'UPDATE `mysql`.`user` SET ' . " `authentication_string` = '" . $hashedPassword . "', `Password` = '', " . " `plugin` = '" . $authentication_plugin . "'" @@ -1150,7 +1150,7 @@ class Privileges 'SELECT @@old_passwords;' ); $orig_value = $row['@@old_passwords']; - $update_plugin_query = "UPDATE `mysql`.`user` SET" + $update_plugin_query = 'UPDATE `mysql`.`user` SET' . " `plugin` = '" . $authentication_plugin . "'" . " WHERE `User` = '" . $username . "' AND Host = '" . $hostname . "';"; @@ -1164,7 +1164,7 @@ class Privileges $err_url ); } - $this->dbi->tryQuery("FLUSH PRIVILEGES;"); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); if ($authentication_plugin == 'mysql_native_password') { // Set the hashing method used by PASSWORD() @@ -1199,7 +1199,7 @@ class Privileges ); } // Flush privileges after successful password change - $this->dbi->tryQuery("FLUSH PRIVILEGES;"); + $this->dbi->tryQuery('FLUSH PRIVILEGES;'); $message = Message::success( __('The password for %s was changed successfully.') @@ -1283,16 +1283,16 @@ class Privileges . $this->dbi->escapeString($arr['x509_subject']) . "'"; } if (count($require)) { - $require_clause = " REQUIRE " . implode(" AND ", $require); + $require_clause = ' REQUIRE ' . implode(' AND ', $require); } else { - $require_clause = " REQUIRE NONE"; + $require_clause = ' REQUIRE NONE'; } } elseif (isset($arr['ssl_type']) && $arr['ssl_type'] == 'X509') { - $require_clause = " REQUIRE X509"; + $require_clause = ' REQUIRE X509'; } elseif (isset($arr['ssl_type']) && $arr['ssl_type'] == 'ANY') { - $require_clause = " REQUIRE SSL"; + $require_clause = ' REQUIRE SSL'; } else { - $require_clause = " REQUIRE NONE"; + $require_clause = ' REQUIRE NONE'; } return $require_clause; @@ -1826,9 +1826,9 @@ class Privileges */ public function getUserSpecificRights($username, $hostname, $type, $dbname = '') { - $user_host_condition = " WHERE `User`" + $user_host_condition = ' WHERE `User`' . " = '" . $this->dbi->escapeString($username) . "'" - . " AND `Host`" + . ' AND `Host`' . " = '" . $this->dbi->escapeString($hostname) . "'"; if ($type == 'database') { @@ -1905,10 +1905,10 @@ class Privileges . $user_host_condition . ' ORDER BY `Table_name` ASC;'; } else { - $sql_query = "SELECT `Routine_name`, `Proc_priv`" - . " FROM `mysql`.`procs_priv`" + $sql_query = 'SELECT `Routine_name`, `Proc_priv`' + . ' FROM `mysql`.`procs_priv`' . $user_host_condition - . " ORDER BY `Routine_name`"; + . ' ORDER BY `Routine_name`'; } $result = $this->dbi->query($sql_query); @@ -2107,7 +2107,7 @@ class Privileges $data['databases'] = $databases; } elseif ($type == 'table') { $result = @$this->dbi->tryQuery( - "SHOW TABLES FROM " . Util::backquote($dbname), + 'SHOW TABLES FROM ' . Util::backquote($dbname), DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_STORE ); @@ -2180,7 +2180,7 @@ class Privileges foreach ($db_rights as $user) { ksort($user); foreach ($user as $host) { - $check_plugin_query = "SELECT * FROM `mysql`.`user` WHERE " + $check_plugin_query = 'SELECT * FROM `mysql`.`user` WHERE ' . "`User` = '" . $host['User'] . "' AND `Host` = '" . $host['Host'] . "'"; $res = $this->dbi->fetchSingleRow($check_plugin_query); @@ -2250,7 +2250,7 @@ class Privileges // just letters. For letters A-Z, we add the non-used letters // as greyed out. - uksort($array_initials, "strnatcasecmp"); + uksort($array_initials, 'strnatcasecmp'); return $this->template->render('server/privileges/initials_row', [ 'array_initials' => $array_initials, @@ -3025,7 +3025,7 @@ class Privileges // $sql_query_all is for counting the total no. of users $sql_query = $sql_query_all = 'SELECT *,' . - " IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . + ' IF(`' . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`'; $sql_query .= (isset($_GET['initial']) @@ -3832,9 +3832,9 @@ class Privileges $password_set_show = null; } else { if ($password_set_real !== null) { - $password_set_real .= ";"; + $password_set_real .= ';'; } - $password_set_show .= ";"; + $password_set_show .= ';'; } return [ @@ -3883,8 +3883,8 @@ class Privileges string $database, string $routine ): array { - $sql = "SELECT `Proc_priv`" - . " FROM `mysql`.`procs_priv`" + $sql = 'SELECT `Proc_priv`' + . ' FROM `mysql`.`procs_priv`' . " WHERE `User` = '" . $this->dbi->escapeString($username) . "'" . " AND `Host` = '" . $this->dbi->escapeString($hostname) . "'" . " AND `Db` = '" diff --git a/libraries/classes/Server/Status/Monitor.php b/libraries/classes/Server/Status/Monitor.php index eb6676caa0..38463672f6 100644 --- a/libraries/classes/Server/Status/Monitor.php +++ b/libraries/classes/Server/Status/Monitor.php @@ -467,7 +467,7 @@ class Monitor $escapedValue = "'" . $escapedValue . "'"; } - if (! preg_match("/[^a-zA-Z0-9_]+/", $name)) { + if (! preg_match('/[^a-zA-Z0-9_]+/', $name)) { $this->dbi->query( 'SET GLOBAL ' . $name . ' = ' . $escapedValue ); diff --git a/libraries/classes/Server/UserGroups.php b/libraries/classes/Server/UserGroups.php index b47478d747..b30fe8ffe8 100644 --- a/libraries/classes/Server/UserGroups.php +++ b/libraries/classes/Server/UserGroups.php @@ -36,8 +36,8 @@ class UserGroups $cfgRelation = $relation->getRelationsParam(); $usersTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); - $sql_query = "SELECT `username` FROM " . $usersTable + . '.' . Util::backquote($cfgRelation['users']); + $sql_query = 'SELECT `username` FROM ' . $usersTable . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "'"; $result = $relation->queryAsControlUser($sql_query, false); @@ -77,8 +77,8 @@ class UserGroups $html_output = '

' . __('User groups') . '

'; $cfgRelation = $relation->getRelationsParam(); $groupTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['usergroups']); - $sql_query = "SELECT * FROM " . $groupTable . " ORDER BY `usergroup` ASC"; + . '.' . Util::backquote($cfgRelation['usergroups']); + $sql_query = 'SELECT * FROM ' . $groupTable . ' ORDER BY `usergroup` ASC'; $result = $relation->queryAsControlUser($sql_query, false); if ($result && $GLOBALS['dbi']->numRows($result)) { @@ -201,14 +201,14 @@ class UserGroups $relation = new Relation($GLOBALS['dbi']); $cfgRelation = $relation->getRelationsParam(); $userTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['users']); + . '.' . Util::backquote($cfgRelation['users']); $groupTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['usergroups']); - $sql_query = "DELETE FROM " . $userTable + . '.' . Util::backquote($cfgRelation['usergroups']); + $sql_query = 'DELETE FROM ' . $userTable . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "'"; $relation->queryAsControlUser($sql_query, true); - $sql_query = "DELETE FROM " . $groupTable + $sql_query = 'DELETE FROM ' . $groupTable . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "'"; $relation->queryAsControlUser($sql_query, true); @@ -266,8 +266,8 @@ class UserGroups if ($userGroup != null) { $cfgRelation = $relation->getRelationsParam(); $groupTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['usergroups']); - $sql_query = "SELECT * FROM " . $groupTable + . '.' . Util::backquote($cfgRelation['usergroups']); + $sql_query = 'SELECT * FROM ' . $groupTable . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "'"; $result = $relation->queryAsControlUser($sql_query, false); @@ -358,32 +358,32 @@ class UserGroups $tabs = Util::getMenuTabList(); $cfgRelation = $relation->getRelationsParam(); $groupTable = Util::backquote($cfgRelation['db']) - . "." . Util::backquote($cfgRelation['usergroups']); + . '.' . Util::backquote($cfgRelation['usergroups']); if (! $new) { - $sql_query = "DELETE FROM " . $groupTable + $sql_query = 'DELETE FROM ' . $groupTable . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "';"; $relation->queryAsControlUser($sql_query, true); } - $sql_query = "INSERT INTO " . $groupTable - . "(`usergroup`, `tab`, `allowed`)" - . " VALUES "; + $sql_query = 'INSERT INTO ' . $groupTable + . '(`usergroup`, `tab`, `allowed`)' + . ' VALUES '; $first = true; foreach ($tabs as $tabGroupName => $tabGroup) { foreach ($tabGroup as $tab => $tabName) { if (! $first) { - $sql_query .= ", "; + $sql_query .= ', '; } $tabName = $tabGroupName . '_' . $tab; $allowed = isset($_POST[$tabName]) && $_POST[$tabName] == 'Y'; $sql_query .= "('" . $GLOBALS['dbi']->escapeString($userGroup) . "', '" . $tabName . "', '" - . ($allowed ? "Y" : "N") . "')"; + . ($allowed ? 'Y' : 'N') . "')"; $first = false; } } - $sql_query .= ";"; + $sql_query .= ';'; $relation->queryAsControlUser($sql_query, true); } } diff --git a/libraries/classes/Setup/ConfigGenerator.php b/libraries/classes/Setup/ConfigGenerator.php index d0fcbbc1b0..f9289575ee 100644 --- a/libraries/classes/Setup/ConfigGenerator.php +++ b/libraries/classes/Setup/ConfigGenerator.php @@ -81,19 +81,19 @@ class ConfigGenerator private static function _getVarExport($var_name, $var_value, $crlf) { if (! is_array($var_value) || empty($var_value)) { - return "\$cfg['$var_name'] = " + return "\$cfg['" . $var_name . "'] = " . var_export($var_value, true) . ';' . $crlf; } $ret = ''; if (self::_isZeroBasedArray($var_value)) { - $ret = "\$cfg['$var_name'] = " + $ret = "\$cfg['" . $var_name . "'] = " . self::_exportZeroBasedArray($var_value, $crlf) . ';' . $crlf; } else { // string keys: $cfg[key][subkey] = value foreach ($var_value as $k => $v) { $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= "\$cfg['$var_name']['$k'] = " + $ret .= "\$cfg['" . $var_name . "']['" . $k . "'] = " . var_export($v, true) . ';' . $crlf; } } @@ -131,7 +131,7 @@ class ConfigGenerator foreach ($array as $v) { $retv[] = var_export($v, true); } - $ret = "array("; + $ret = 'array('; if (count($retv) <= 4) { // up to 4 values - one line $ret .= implode(', ', $retv); @@ -161,15 +161,15 @@ class ConfigGenerator return null; } - $ret = "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf; + $ret = '/* Servers configuration */' . $crlf . '$i = 0;' . $crlf . $crlf; foreach ($servers as $id => $server) { $ret .= '/* Server: ' - . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') - . "*/" . $crlf + . strtr($cf->getServerName($id) . ' [' . $id . '] ', '*/', '-') + . '*/' . $crlf . '$i++;' . $crlf; foreach ($server as $k => $v) { $k = preg_replace('/[^A-Za-z0-9_]/', '_', $k); - $ret .= "\$cfg['Servers'][\$i]['$k'] = " + $ret .= "\$cfg['Servers'][\$i]['" . $k . "'] = " . (is_array($v) && self::_isZeroBasedArray($v) ? self::_exportZeroBasedArray($v, $crlf) : var_export($v, true)) diff --git a/libraries/classes/Sql.php b/libraries/classes/Sql.php index ba45e8603c..129e12b54b 100644 --- a/libraries/classes/Sql.php +++ b/libraries/classes/Sql.php @@ -394,7 +394,7 @@ class Sql private function getFullValuesForSetColumn($db, $table, $column, $where_clause) { $result = $GLOBALS['dbi']->fetchSingleRow( - "SELECT `$column` FROM `$db`.`$table` WHERE $where_clause" + 'SELECT `' . $column . '` FROM `' . $db . '`.`' . $table . '` WHERE ' . $where_clause ); return $result[$column]; @@ -434,7 +434,7 @@ class Sql $converted_curr_value = htmlentities( $curr_value, ENT_COMPAT, - "UTF-8" + 'UTF-8' ); $selected_values = explode(',', $converted_curr_value); @@ -789,7 +789,7 @@ class Sql $column = $_POST['column']; $curr_value = $_POST['curr_value']; $response = Response::getInstance(); - if ($columnType == "enum") { + if ($columnType == 'enum') { $dropdown = $this->getHtmlForEnumColumnDropdown( $db, $table, diff --git a/libraries/classes/StorageEngine.php b/libraries/classes/StorageEngine.php index 49e4f99a4f..eba2b8a823 100644 --- a/libraries/classes/StorageEngine.php +++ b/libraries/classes/StorageEngine.php @@ -119,7 +119,7 @@ class StorageEngine ); } ); - foreach (explode(",", $disabled) as $engine) { + foreach (explode(',', $disabled) as $engine) { if (isset($storage_engines[$engine])) { $storage_engines[$engine]['Support'] = 'DISABLED'; } @@ -232,7 +232,7 @@ class StorageEngine */ public static function isValid($engine) { - if ($engine == "PBMS") { + if ($engine == 'PBMS') { return true; } $storage_engines = self::getStorageEngines(); diff --git a/libraries/classes/SysInfoLinux.php b/libraries/classes/SysInfoLinux.php index 64141cc757..3f7f49531f 100644 --- a/libraries/classes/SysInfoLinux.php +++ b/libraries/classes/SysInfoLinux.php @@ -29,7 +29,7 @@ class SysInfoLinux extends SysInfoBase { $buf = file_get_contents('/proc/stat'); $nums = preg_split( - "/\s+/", + '/\s+/', mb_substr( $buf, 0, diff --git a/libraries/classes/SysInfoWINNT.php b/libraries/classes/SysInfoWINNT.php index 08be66ae46..dc474f0522 100644 --- a/libraries/classes/SysInfoWINNT.php +++ b/libraries/classes/SysInfoWINNT.php @@ -106,7 +106,7 @@ class SysInfoWINNT extends SysInfoBase public function memory() { $buffer = $this->_getWMI( - "Win32_OperatingSystem", + 'Win32_OperatingSystem', [ 'TotalVisibleMemorySize', 'FreePhysicalMemory', diff --git a/libraries/classes/SystemDatabase.php b/libraries/classes/SystemDatabase.php index 754e8fd1ef..bfe93ecc65 100644 --- a/libraries/classes/SystemDatabase.php +++ b/libraries/classes/SystemDatabase.php @@ -86,10 +86,10 @@ class SystemDatabase // Need to store new transformation details for VIEW $new_transformations_sql = sprintf( - "INSERT INTO %s.%s (" - . "`db_name`, `table_name`, `column_name`, " - . "`comment`, `mimetype`, `transformation`, " - . "`transformation_options`) VALUES", + 'INSERT INTO %s.%s (' + . '`db_name`, `table_name`, `column_name`, ' + . '`comment`, `mimetype`, `transformation`, ' + . '`transformation_options`) VALUES', Util::backquote($cfgRelation['db']), Util::backquote($cfgRelation['column_info']) ); diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index 1c076d1fc6..dc72d62f85 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -526,7 +526,7 @@ class Table $query .= ' ' . $attribute; if ($is_timestamp - && false !== stripos($attribute, "TIMESTAMP") + && false !== stripos($attribute, 'TIMESTAMP') && strlen($length) !== 0 && $length !== 0 ) { @@ -1038,8 +1038,8 @@ class Table * @var ExportSql $export_sql_plugin */ $export_sql_plugin = Plugins::getPlugin( - "export", - "sql", + 'export', + 'sql', 'libraries/classes/Plugins/Export/', [ 'export_type' => 'table', @@ -1086,7 +1086,7 @@ class Table // queries. // One of the options that alters the behaviour is `ANSI_QUOTES`. Context::setMode( - $dbi->fetchValue("SELECT @@sql_mode") + $dbi->fetchValue('SELECT @@sql_mode') ); // ----------------------------------------------------------------- @@ -1816,11 +1816,11 @@ class Table protected function getUiPrefsFromDb() { $cfgRelation = $this->relation->getRelationsParam(); - $pma_table = Util::backquote($cfgRelation['db']) . "." + $pma_table = Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation['table_uiprefs']); // Read from phpMyAdmin database - $sql_query = " SELECT `prefs` FROM " . $pma_table + $sql_query = ' SELECT `prefs` FROM ' . $pma_table . " WHERE `username` = '" . $this->_dbi->escapeString($GLOBALS['cfg']['Server']['user']) . "'" . " AND `db_name` = '" . $this->_dbi->escapeString($this->_db_name) . "'" . " AND `table_name` = '" . $this->_dbi->escapeString($this->_name) . "'"; @@ -1841,13 +1841,13 @@ class Table protected function saveUiPrefsToDb() { $cfgRelation = $this->relation->getRelationsParam(); - $pma_table = Util::backquote($cfgRelation['db']) . "." + $pma_table = Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation['table_uiprefs']); $secureDbName = $this->_dbi->escapeString($this->_db_name); $username = $GLOBALS['cfg']['Server']['user']; - $sql_query = " REPLACE INTO " . $pma_table + $sql_query = ' REPLACE INTO ' . $pma_table . " (username, db_name, table_name, prefs) VALUES ('" . $this->_dbi->escapeString($username) . "', '" . $secureDbName . "', '" . $this->_dbi->escapeString($this->_name) . "', '" diff --git a/libraries/classes/Tracker.php b/libraries/classes/Tracker.php index dec6e11048..f33f6c5b9f 100644 --- a/libraries/classes/Tracker.php +++ b/libraries/classes/Tracker.php @@ -143,10 +143,10 @@ class Tracker return false; } - $sql_query = " SELECT tracking_active FROM " . self::_getTrackingTable() . + $sql_query = ' SELECT tracking_active FROM ' . self::_getTrackingTable() . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . " AND table_name = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . - " ORDER BY version DESC LIMIT 1"; + ' ORDER BY version DESC LIMIT 1'; $result = $GLOBALS['dbi']->fetchValue($sql_query, 0, 0, DatabaseInterface::CONNECT_CONTROL) == 1; @@ -165,7 +165,7 @@ class Tracker $date = Util::date('Y-m-d H:i:s'); $user = preg_replace('/\s+/', ' ', $GLOBALS['cfg']['Server']['user']); - return "# log " . $date . " " . $user . "\n"; + return '# log ' . $date . ' ' . $user . "\n"; } /** @@ -203,8 +203,8 @@ class Tracker * @var ExportSql $export_sql_plugin */ $export_sql_plugin = Plugins::getPlugin( - "export", - "sql", + 'export', + 'sql', 'libraries/classes/Plugins/Export/', [ 'export_type' => $export_type, @@ -237,7 +237,7 @@ class Tracker // Get DROP TABLE / DROP VIEW and CREATE TABLE SQL statements $sql_backquotes = true; - $create_sql = ""; + $create_sql = ''; if ($GLOBALS['cfg']['Server']['tracking_add_drop_table'] == true && $is_view === false @@ -254,22 +254,22 @@ class Tracker } $create_sql .= self::getLogComment() . - $export_sql_plugin->getTableDef($dbname, $tablename, "\n", ""); + $export_sql_plugin->getTableDef($dbname, $tablename, "\n", ''); // Save version $sql_query = "/*NOTRACK*/\n" . - "INSERT INTO " . self::_getTrackingTable() . " (" . - "db_name, " . - "table_name, " . - "version, " . - "date_created, " . - "date_updated, " . - "schema_snapshot, " . - "schema_sql, " . - "data_sql, " . - "tracking " . - ") " . + 'INSERT INTO ' . self::_getTrackingTable() . ' (' . + 'db_name, ' . + 'table_name, ' . + 'version, ' . + 'date_created, ' . + 'date_updated, ' . + 'schema_snapshot, ' . + 'schema_sql, ' . + 'data_sql, ' . + 'tracking ' . + ') ' . "values ( '" . $GLOBALS['dbi']->escapeString($dbname) . "', '" . $GLOBALS['dbi']->escapeString($tablename) . "', @@ -309,7 +309,7 @@ class Tracker $relation = new Relation($GLOBALS['dbi']); $sql_query = "/*NOTRACK*/\n" - . "DELETE FROM " . self::_getTrackingTable() + . 'DELETE FROM ' . self::_getTrackingTable() . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "'" . " AND `table_name` = '" @@ -349,7 +349,7 @@ class Tracker = $GLOBALS['cfg']['Server']['tracking_default_statements']; } - $create_sql = ""; + $create_sql = ''; if ($GLOBALS['cfg']['Server']['tracking_add_drop_database'] == true) { $create_sql .= self::getLogComment() @@ -360,17 +360,17 @@ class Tracker // Save version $sql_query = "/*NOTRACK*/\n" . - "INSERT INTO " . self::_getTrackingTable() . " (" . - "db_name, " . - "table_name, " . - "version, " . - "date_created, " . - "date_updated, " . - "schema_snapshot, " . - "schema_sql, " . - "data_sql, " . - "tracking " . - ") " . + 'INSERT INTO ' . self::_getTrackingTable() . ' (' . + 'db_name, ' . + 'table_name, ' . + 'version, ' . + 'date_created, ' . + 'date_updated, ' . + 'schema_snapshot, ' . + 'schema_sql, ' . + 'data_sql, ' . + 'tracking ' . + ') ' . "values ( '" . $GLOBALS['dbi']->escapeString($dbname) . "', '" . $GLOBALS['dbi']->escapeString('') . "', @@ -408,7 +408,7 @@ class Tracker ) { $relation = new Relation($GLOBALS['dbi']); - $sql_query = " UPDATE " . self::_getTrackingTable() . + $sql_query = ' UPDATE ' . self::_getTrackingTable() . " SET `tracking_active` = '" . $new_state . "' " . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . @@ -458,8 +458,8 @@ class Tracker $new_data_processed = $new_data; } - $sql_query = " UPDATE " . self::_getTrackingTable() . - " SET `" . $save_to . "` = '" . $new_data_processed . "' " . + $sql_query = ' UPDATE ' . self::_getTrackingTable() . + ' SET `' . $save_to . "` = '" . $new_data_processed . "' " . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; @@ -519,11 +519,11 @@ class Tracker { $relation = new Relation($GLOBALS['dbi']); - $sql_query = " SELECT MAX(version) FROM " . self::_getTrackingTable() . + $sql_query = ' SELECT MAX(version) FROM ' . self::_getTrackingTable() . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' "; - if ($statement != "") { + if ($statement != '') { $sql_query .= " AND FIND_IN_SET('" . $statement . "',tracking) > 0" ; } @@ -550,7 +550,7 @@ class Tracker { $relation = new Relation($GLOBALS['dbi']); - $sql_query = " SELECT * FROM " . self::_getTrackingTable() . + $sql_query = ' SELECT * FROM ' . self::_getTrackingTable() . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' "; if (! empty($tablename)) { $sql_query .= " AND `table_name` = '" @@ -817,7 +817,7 @@ class Tracker $relation = new Relation($GLOBALS['dbi']); // If query is marked as untouchable, leave - if (mb_strstr($query, "/*NOTRACK*/")) { + if (mb_strstr($query, '/*NOTRACK*/')) { return; } @@ -895,9 +895,9 @@ class Tracker // Mark it as untouchable $sql_query = " /*NOTRACK*/\n" - . " UPDATE " . self::_getTrackingTable() - . " SET " . Util::backquote($save_to) - . " = CONCAT( " . Util::backquote($save_to) . ",'\n" + . ' UPDATE ' . self::_getTrackingTable() + . ' SET ' . Util::backquote($save_to) + . ' = CONCAT( ' . Util::backquote($save_to) . ",'\n" . $GLOBALS['dbi']->escapeString($query) . "') ," . " `date_updated` = '" . $date . "' "; diff --git a/libraries/classes/Tracking.php b/libraries/classes/Tracking.php index 879c210100..697d2c7f03 100644 --- a/libraries/classes/Tracking.php +++ b/libraries/classes/Tracking.php @@ -115,14 +115,14 @@ class Tracking { $relation = $this->relation; $cfgRelation = $relation->getRelationsParam(); - $sql_query = " SELECT * FROM " . - Util::backquote($cfgRelation['db']) . "." . + $sql_query = ' SELECT * FROM ' . + Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation['tracking']) . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['db']) . "' " . " AND table_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['table']) . "' " . - " ORDER BY version DESC "; + ' ORDER BY version DESC '; return $relation->queryAsControlUser($sql_query); } @@ -206,12 +206,12 @@ class Tracking $relation = $this->relation; $cfgRelation = $relation->getRelationsParam(); - $sql_query = " SELECT DISTINCT db_name, table_name FROM " . - Util::backquote($cfgRelation['db']) . "." . + $sql_query = ' SELECT DISTINCT db_name, table_name FROM ' . + Util::backquote($cfgRelation['db']) . '.' . Util::backquote($cfgRelation['tracking']) . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['db']) . "' " . - " ORDER BY db_name, table_name"; + ' ORDER BY db_name, table_name'; return $relation->queryAsControlUser($sql_query); } @@ -490,8 +490,8 @@ class Tracking $str_export2 = ''; - $html .= "
" . sprintf(__('Export as %s'), $str_export1) - . $str_export2 . "
"; + $html .= '
' . sprintf(__('Export as %s'), $str_export1) + . $str_export2 . '
'; $html .= ''; return $html; } @@ -800,13 +800,13 @@ class Tracking public function exportAsSqlDump(array $entries) { $html = ''; - $new_query = "# " + $new_query = '# ' . __( 'You can execute the dump by creating and using a temporary database. ' . 'Please ensure that you have the privileges to do so.' ) . "\n" - . "# " . __('Comment out these two lines if you do not need them.') . "\n" + . '# ' . __('Comment out these two lines if you do not need them.') . "\n" . "\n" . "CREATE database IF NOT EXISTS pma_temp_db; \n" . "USE pma_temp_db; \n" @@ -863,7 +863,7 @@ class Tracking // Replace all multiple whitespaces by a single space $table = htmlspecialchars(preg_replace('/\s+/', ' ', $_POST['table'])); - $dump = "# " . sprintf( + $dump = '# ' . sprintf( __('Tracking report for table `%s`'), $table ) diff --git a/libraries/classes/Transformations.php b/libraries/classes/Transformations.php index b3b0d4aa0c..78e3f61f58 100644 --- a/libraries/classes/Transformations.php +++ b/libraries/classes/Transformations.php @@ -53,7 +53,7 @@ class Transformations $result = []; if (strlen($option_string) === 0 - || ! $transform_options = explode(",", $option_string) + || ! $transform_options = explode(',', $option_string) ) { return $result; } @@ -138,7 +138,7 @@ class Transformations if (preg_match('|^[^.].*_.*_.*\.php$|', $file)) { // File contains transformation functions. $parts = explode('_', str_replace('.php', '', $file)); - $mimetype = $parts[0] . "/" . $parts[1]; + $mimetype = $parts[0] . '/' . $parts[1]; $stack['mimetype'][$mimetype] = $mimetype; $stack[$prefix . 'transformation'][] = $mimetype . ': ' . $parts[2]; @@ -172,7 +172,7 @@ class Transformations public function getClassName($filename) { // get the transformation class name - $class_name = explode(".php", $filename); + $class_name = explode('.php', $filename); $class_name = 'PhpMyAdmin\\' . str_replace('/', '\\', mb_substr($class_name[0], 18)); return $class_name; @@ -230,12 +230,12 @@ class Transformations { $value = str_replace( [ - "jpeg", - "png", + 'jpeg', + 'png', ], [ - "JPEG", - "PNG", + 'JPEG', + 'PNG', ], $value ); @@ -271,11 +271,11 @@ class Transformations $com_qry = ''; if ($fullName) { - $com_qry .= "SELECT CONCAT(" + $com_qry .= 'SELECT CONCAT(' . "`db_name`, '.', `table_name`, '.', `column_name`" - . ") AS column_name, "; + . ') AS column_name, '; } else { - $com_qry = "SELECT `column_name`, "; + $com_qry = 'SELECT `column_name`, '; } $com_qry .= '`mimetype`, `transformation`, diff --git a/libraries/classes/Twig/I18n/NodeTrans.php b/libraries/classes/Twig/I18n/NodeTrans.php index e7db92c2e1..e0bb40bfe5 100644 --- a/libraries/classes/Twig/I18n/NodeTrans.php +++ b/libraries/classes/Twig/I18n/NodeTrans.php @@ -90,7 +90,7 @@ class NodeTrans extends TransNode // line breaks are not allowed cause we want a single line comment $message = str_replace(["\n", "\r"], ' ', $message); - $compiler->write("// l10n: {$message}\n"); + $compiler->write('// l10n: ' . $message . "\n"); } if ($vars) { diff --git a/libraries/classes/Types.php b/libraries/classes/Types.php index ed30986d16..0eb3916ece 100644 --- a/libraries/classes/Types.php +++ b/libraries/classes/Types.php @@ -289,9 +289,9 @@ class Types ); case 'YEAR': return __( - "A year in four-digit (4, default) or two-digit (2) format, the " . - "allowable values are 70 (1970) to 69 (2069) or 1901 to 2155 and " . - "0000" + 'A year in four-digit (4, default) or two-digit (2) format, the ' . + 'allowable values are 70 (1970) to 69 (2069) or 1901 to 2155 and ' . + '0000' ); case 'CHAR': return __( @@ -364,11 +364,11 @@ class Types ); case 'ENUM': return __( - "An enumeration, chosen from the list of up to 65,535 values or " . + 'An enumeration, chosen from the list of up to 65,535 values or ' . "the special '' error value" ); case 'SET': - return __("A single value chosen from a set of up to 64 members"); + return __('A single value chosen from a set of up to 64 members'); case 'GEOMETRY': return __('A type that can store a geometry of any type'); case 'POINT': diff --git a/libraries/classes/UserPassword.php b/libraries/classes/UserPassword.php index 8e0568cca4..8cd156fad3 100644 --- a/libraries/classes/UserPassword.php +++ b/libraries/classes/UserPassword.php @@ -237,7 +237,7 @@ class UserPassword $hashedPassword = $this->serverPrivileges->getHashedPassword($_POST['pma_pw']); - $local_query = "UPDATE `mysql`.`user` SET" + $local_query = 'UPDATE `mysql`.`user` SET' . " `authentication_string` = '" . $hashedPassword . "', `Password` = '', " . " `plugin` = '" . $orig_auth_plugin . "'" @@ -259,7 +259,7 @@ class UserPassword } // Flush privileges after successful password change - $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); + $GLOBALS['dbi']->tryQuery('FLUSH PRIVILEGES;'); } /** diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index ab16bf399c..1fd6741f2e 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -406,7 +406,7 @@ class Util // 5.0.37 has profiling but for example, 5.1.20 does not // (avoid a trip to the server for MySQL before 5.0.37) // and do not set a constant as we might be switching servers - if ($GLOBALS['dbi']->fetchValue("SELECT @@have_profiling") + if ($GLOBALS['dbi']->fetchValue('SELECT @@have_profiling') ) { self::cacheSet('profiling_supported', true); } else { @@ -1421,10 +1421,10 @@ class Util // this would be a BINARY or VARBINARY column type; // by the way, a BLOB should not show the BINARY attribute // because this is not accepted in MySQL syntax. - if (false !== strpos($printtype, "binary") + if (false !== strpos($printtype, 'binary') && ! preg_match('@binary[\(]@', $printtype) ) { - $printtype = str_replace("binary", '', $printtype); + $printtype = str_replace('binary', '', $printtype); $binary = true; } else { $binary = false; @@ -1463,7 +1463,7 @@ class Util $can_contain_collation = false; if (! $binary && preg_match( - "@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@", + '@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@', $type ) ) { @@ -1512,7 +1512,7 @@ class Util return true; } elseif ($engine == 'NDBCLUSTER' || $engine == 'NDB') { $ndbver = strtolower( - $GLOBALS['dbi']->fetchValue("SELECT @@ndb_version_string") + $GLOBALS['dbi']->fetchValue('SELECT @@ndb_version_string') ); if (substr($ndbver, 0, 4) == 'ndb-') { $ndbver = substr($ndbver, 4); @@ -1592,9 +1592,9 @@ class Util $spatialAsText = 'ST_ASTEXT'; $spatialSrid = 'ST_SRID'; } - $wktsql = "SELECT $spatialAsText(x'" . $hex . "')"; + $wktsql = 'SELECT ' . $spatialAsText . "(x'" . $hex . "')"; if ($includeSRID) { - $wktsql .= ", $spatialSrid(x'" . $hex . "')"; + $wktsql .= ', ' . $spatialSrid . "(x'" . $hex . "')"; } $wktresult = $GLOBALS['dbi']->tryQuery( @@ -1909,7 +1909,7 @@ class Util . 'POLYGON|MULTIPOLYGON|GEOMETRYCOLLECTION)'; if (preg_match("/^'" . $geom_types . "\(.*\)',[0-9]*$/i", $gis_string)) { return $geomFromText . '(' . $gis_string . ')'; - } elseif (preg_match("/^" . $geom_types . "\(.*\)$/i", $gis_string)) { + } elseif (preg_match('/^' . $geom_types . '\(.*\)$/i', $gis_string)) { return $geomFromText . "('" . $gis_string . "')"; } @@ -2191,7 +2191,7 @@ class Util $username .= "''"; // Prepare the query - $query = "SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`%s` " + $query = 'SELECT `PRIVILEGE_TYPE` FROM `INFORMATION_SCHEMA`.`%s` ' . "WHERE GRANTEE='%s' AND PRIVILEGE_TYPE='%s'"; // Check global privileges first. @@ -2283,7 +2283,7 @@ class Util */ public static function parseEnumSetValues($definition, $escapeHtml = true) { - $values_string = htmlentities($definition, ENT_COMPAT, "UTF-8"); + $values_string = htmlentities($definition, ENT_COMPAT, 'UTF-8'); // There is a JS port of the below parser in functions.js // If you are fixing something here, // you need to also update the JS port. @@ -2299,13 +2299,13 @@ class Util if (! $in_string && $curr == "'") { $in_string = true; - } elseif (($in_string && $curr == "\\") && $next == "\\") { - $buffer .= "\"; + } elseif (($in_string && $curr == '\\') && $next == '\\') { + $buffer .= '\'; $i++; } elseif (($in_string && $next == "'") - && ($curr == "'" || $curr == "\\") + && ($curr == "'" || $curr == '\\') ) { - $buffer .= "'"; + $buffer .= '''; $i++; } elseif ($in_string && $curr == "'") { $in_string = false; @@ -2484,11 +2484,11 @@ class Util { $names = $GLOBALS['dbi']->getLowerCaseNames(); if ($names === '0') { - return "COLLATE utf8_bin"; + return 'COLLATE utf8_bin'; } elseif ($names === '2') { - return "COLLATE utf8_general_ci"; + return 'COLLATE utf8_general_ci'; } - return ""; + return ''; } /** @@ -2756,7 +2756,7 @@ class Util // is there at least one "in use" table? if (count($sot_cache) > 0) { - $tblGroupSql = ""; + $tblGroupSql = ''; $whereAdded = false; if (Core::isValid($_REQUEST['tbl_group'])) { $group = self::escapeMysqlWildcards($_REQUEST['tbl_group']); @@ -2764,16 +2764,16 @@ class Util $_REQUEST['tbl_group'] . $GLOBALS['cfg']['NavigationTreeTableSeparator'] ); - $tblGroupSql .= " WHERE (" + $tblGroupSql .= ' WHERE (' . self::backquote('Tables_in_' . $db) . " LIKE '" . $groupWithSeparator . "%'" - . " OR " + . ' OR ' . self::backquote('Tables_in_' . $db) . " LIKE '" . $group . "')"; $whereAdded = true; } if (Core::isValid($_REQUEST['tbl_type'], ['table', 'view'])) { - $tblGroupSql .= $whereAdded ? " AND" : " WHERE"; + $tblGroupSql .= $whereAdded ? ' AND' : ' WHERE'; if ($_REQUEST['tbl_type'] == 'view') { $tblGroupSql .= " `Table_type` NOT IN ('BASE TABLE', 'SYSTEM VERSIONED')"; } else { diff --git a/libraries/classes/Utils/HttpRequest.php b/libraries/classes/Utils/HttpRequest.php index 45ec37765d..c484c5ad81 100644 --- a/libraries/classes/Utils/HttpRequest.php +++ b/libraries/classes/Utils/HttpRequest.php @@ -120,14 +120,14 @@ class HttpRequest } $curlStatus &= curl_setopt($curlHandle, CURLOPT_USERAGENT, 'phpMyAdmin'); - if ($method != "GET") { + if ($method != 'GET') { $curlStatus &= curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, $method); } if ($header) { $curlStatus &= curl_setopt($curlHandle, CURLOPT_HTTPHEADER, [$header]); } - if ($method == "POST") { + if ($method == 'POST') { $curlStatus &= curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $content); } @@ -208,13 +208,13 @@ class HttpRequest 'request_fulluri' => true, 'timeout' => 10, 'user_agent' => 'phpMyAdmin', - 'header' => "Accept: */*", + 'header' => 'Accept: */*', ], ]; if ($header) { $context['http']['header'] .= "\n" . $header; } - if ($method == "POST") { + if ($method == 'POST') { $context['http']['content'] = $content; } $context = $this->handleContext($context); @@ -224,7 +224,7 @@ class HttpRequest stream_context_create($context) ); if (isset($http_response_header)) { - preg_match("#HTTP/[0-9\.]+\s+([0-9]+)#", $http_response_header[0], $out); + preg_match('#HTTP/[0-9\.]+\s+([0-9]+)#', $http_response_header[0], $out); $httpStatus = intval($out[1]); return $this->response($response, $httpStatus, $returnOnlyStatus); } diff --git a/libraries/classes/VersionInformation.php b/libraries/classes/VersionInformation.php index 3ac57c181b..2fffda7285 100644 --- a/libraries/classes/VersionInformation.php +++ b/libraries/classes/VersionInformation.php @@ -142,7 +142,7 @@ class VersionInformation { foreach ($releases as $release) { $phpVersions = $release->php_versions; - $phpConditions = explode(",", $phpVersions); + $phpConditions = explode(',', $phpVersions); foreach ($phpConditions as $phpCondition) { if (! $this->evaluateVersionCondition('PHP', $phpCondition)) { continue 2; @@ -153,7 +153,7 @@ class VersionInformation // one server configured. if (count($GLOBALS['cfg']['Servers']) === 1) { $mysqlVersions = $release->mysql_versions; - $mysqlConditions = explode(",", $mysqlVersions); + $mysqlConditions = explode(',', $mysqlVersions); foreach ($mysqlConditions as $mysqlCondition) { if (! $this->evaluateVersionCondition('MySQL', $mysqlCondition)) { continue 2; @@ -184,13 +184,13 @@ class VersionInformation $operator = null; $version = null; $operators = [ - "<=", - ">=", - "!=", - "<>", - "<", - ">", - "=", + '<=', + '>=', + '!=', + '<>', + '<', + '>', + '=', ]; // preserve order foreach ($operators as $oneOperator) { if (strpos($condition, $oneOperator) === 0) { diff --git a/libraries/config.default.php b/libraries/config.default.php index 222e5c6fda..9609e09b9b 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -642,7 +642,7 @@ if (defined('VERSION_CHECK_DEFAULT')) { * * @global string $cfg['ProxyUrl'] */ -$cfg['ProxyUrl'] = ""; +$cfg['ProxyUrl'] = ''; /** * The username for authenticating with the proxy. By default, no @@ -652,14 +652,14 @@ $cfg['ProxyUrl'] = ""; * * @global string $cfg['ProxyUser'] */ -$cfg['ProxyUser'] = ""; +$cfg['ProxyUser'] = ''; /** * The password for authenticating with the proxy. * * @global string $cfg['ProxyPass'] */ -$cfg['ProxyPass'] = ""; +$cfg['ProxyPass'] = ''; /** * maximum number of db's displayed in database list diff --git a/libraries/entry_points/database/operations.php b/libraries/entry_points/database/operations.php index 68eb5d395b..65dfabbf40 100644 --- a/libraries/entry_points/database/operations.php +++ b/libraries/entry_points/database/operations.php @@ -103,8 +103,8 @@ if (strlen($db) > 0 // remove all foreign key constraints, otherwise we can get errors /** @var ExportSql $export_sql_plugin */ $export_sql_plugin = Plugins::getPlugin( - "export", - "sql", + 'export', + 'sql', 'libraries/classes/Plugins/Export/', [ 'single_table' => isset($single_table), diff --git a/libraries/entry_points/database/sql/autocomplete.php b/libraries/entry_points/database/sql/autocomplete.php index a04010baf2..4d7fd8aa20 100644 --- a/libraries/entry_points/database/sql/autocomplete.php +++ b/libraries/entry_points/database/sql/autocomplete.php @@ -37,4 +37,4 @@ if ($GLOBALS['cfg']['EnableAutocompleteForTablesAndColumns']) { $sql_autocomplete = true; } -$response->addJSON("tables", json_encode($sql_autocomplete)); +$response->addJSON('tables', json_encode($sql_autocomplete)); diff --git a/libraries/entry_points/database/sql/format.php b/libraries/entry_points/database/sql/format.php index e3264cf5f0..0881da50ed 100644 --- a/libraries/entry_points/database/sql/format.php +++ b/libraries/entry_points/database/sql/format.php @@ -17,4 +17,4 @@ $query = ! empty($_POST['sql']) ? $_POST['sql'] : ''; $query = PhpMyAdmin\SqlParser\Utils\Formatter::format($query); $response = Response::getInstance(); -$response->addJSON("sql", $query); +$response->addJSON('sql', $query); diff --git a/libraries/entry_points/export.php b/libraries/entry_points/export.php index b41f143fa1..4ccbd1ddc1 100644 --- a/libraries/entry_points/export.php +++ b/libraries/entry_points/export.php @@ -53,9 +53,9 @@ if (isset($_GET['check_time_out'])) { if (isset($_SESSION['pma_export_error'])) { $err = $_SESSION['pma_export_error']; unset($_SESSION['pma_export_error']); - echo "timeout"; + echo 'timeout'; } else { - echo "success"; + echo 'success'; } exit; } @@ -203,7 +203,7 @@ $what = Core::securePath($_POST['what']); // export class instance, not array of properties, as before /** @var ExportPlugin $export_plugin */ $export_plugin = Plugins::getPlugin( - "export", + 'export', $what, 'libraries/classes/Plugins/Export/', [ @@ -491,7 +491,7 @@ try { $table_data = $tables; } if (isset($lock_tables)) { - $export->lockTables($db, $tables, "READ"); + $export->lockTables($db, $tables, 'READ'); try { $export->exportDatabase( $db, @@ -546,7 +546,7 @@ try { } if (isset($lock_tables)) { try { - $export->lockTables($db, [$table], "READ"); + $export->lockTables($db, [$table], 'READ'); $export->exportTable( $db, $table, diff --git a/libraries/entry_points/import.php b/libraries/entry_points/import.php index 6e547fd89e..636083a66c 100644 --- a/libraries/entry_points/import.php +++ b/libraries/entry_points/import.php @@ -550,7 +550,7 @@ if (! $error) { * @var ImportPlugin $import_plugin */ $import_plugin = Plugins::getPlugin( - "import", + 'import', $format, 'libraries/classes/Plugins/Import/', $import_type diff --git a/libraries/entry_points/normalization.php b/libraries/entry_points/normalization.php index 7e09830863..e5eb39723a 100644 --- a/libraries/entry_points/normalization.php +++ b/libraries/entry_points/normalization.php @@ -49,7 +49,7 @@ if (isset($_POST['splitColumn'])) { if (isset($_POST['addNewPrimary'])) { $num_fields = 1; $columnMeta = [ - 'Field' => $table . "_id", + 'Field' => $table . '_id', 'Extra' => 'auto_increment', ]; $html = $normalization->getHtmlForCreateNewColumn( diff --git a/libraries/entry_points/server/privileges.php b/libraries/entry_points/server/privileges.php index dcf94f2660..6d21b7bed3 100644 --- a/libraries/entry_points/server/privileges.php +++ b/libraries/entry_points/server/privileges.php @@ -215,7 +215,7 @@ if (isset($_POST['change_copy']) && $username == $_POST['old_username'] Message::error( __( "Username and hostname didn't change. " - . "If you only want to change the password, " + . 'If you only want to change the password, ' . "'Change password' tab should be used." ) )->getDisplay() @@ -453,7 +453,7 @@ if (isset($_GET['export']) $response->addJSON('title', $title); exit; } else { - $response->addHTML("

$title

$export"); + $response->addHTML('

' . $title . '

' . $export); } } diff --git a/libraries/entry_points/sql.php b/libraries/entry_points/sql.php index 1f0fee0427..d80566db9b 100644 --- a/libraries/entry_points/sql.php +++ b/libraries/entry_points/sql.php @@ -115,14 +115,14 @@ if (isset($_POST['get_relational_values']) // Just like above, find possible values for enum fields during grid edit. if (isset($_POST['get_enum_values']) && $_POST['get_enum_values'] == true) { - $sql->getEnumOrSetValues($db, $table, "enum"); + $sql->getEnumOrSetValues($db, $table, 'enum'); // script has exited at this point } // Find possible values for set fields during grid edit. if (isset($_POST['get_set_values']) && $_POST['get_set_values'] == true) { - $sql->getEnumOrSetValues($db, $table, "set"); + $sql->getEnumOrSetValues($db, $table, 'set'); // script has exited at this point } diff --git a/libraries/entry_points/table/replace.php b/libraries/entry_points/table/replace.php index 1fdbdb4c0f..1a786de1b0 100644 --- a/libraries/entry_points/table/replace.php +++ b/libraries/entry_points/table/replace.php @@ -489,8 +489,8 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) { $extra_data = []; } $transformation_types = [ - "input_transformation", - "transformation", + 'input_transformation', + 'transformation', ]; foreach ($mime_map as $transformation) { $column_name = $transformation['column_name']; diff --git a/libraries/entry_points/table/tracking.php b/libraries/entry_points/table/tracking.php index ed9336270a..9428a7567a 100644 --- a/libraries/entry_points/table/tracking.php +++ b/libraries/entry_points/table/tracking.php @@ -34,7 +34,7 @@ require ROOT_PATH . 'libraries/tbl_common.inc.php'; $tracking = $containerBuilder->get('tracking'); if (Tracker::isActive() - && Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]) + && Tracker::isTracked($GLOBALS['db'], $GLOBALS['table']) && ! (isset($_POST['toggle_activation']) && $_POST['toggle_activation'] == 'deactivate_now') && ! (isset($_POST['report_export']) @@ -43,7 +43,7 @@ if (Tracker::isActive() $msg = Message::notice( sprintf( __('Tracking of %s is activated.'), - htmlspecialchars($GLOBALS["db"] . '.' . $GLOBALS["table"]) + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']) ) ); $response->addHTML($msg->getDisplay()); diff --git a/libraries/entry_points/view/create.php b/libraries/entry_points/view/create.php index 1c3a0c51bd..486dd42759 100644 --- a/libraries/entry_points/view/create.php +++ b/libraries/entry_points/view/create.php @@ -128,7 +128,7 @@ if (isset($_POST['createview']) || isset($_POST['alterview'])) { $response->addJSON( 'message', Message::error( - "" . htmlspecialchars($sql_query) . "

" + '' . htmlspecialchars($sql_query) . '

' . $dbi->getError() ) ); @@ -217,7 +217,7 @@ if (isset($_GET['db'], $_GET['table'])) { ->showCreate(); // CREATE ALGORITHM= DE... - $parts = explode(" ", substr($createView, 17)); + $parts = explode(' ', substr($createView, 17)); $item['ALGORITHM'] = $parts[0]; $view['operation'] = 'alter'; diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php index 66f4ac43a1..724559de2a 100644 --- a/libraries/replication.inc.php +++ b/libraries/replication.inc.php @@ -130,13 +130,13 @@ $slave_variables_oks = [ $replication_info = []; foreach ($replication_types as $type) { - if (count(${"server_{$type}_replication"}) > 0) { + if (count(${'server_' . $type . '_replication'}) > 0) { $replication_info[$type]['status'] = true; } else { $replication_info[$type]['status'] = false; } if ($replication_info[$type]['status']) { - if ($type == "master") { + if ($type == 'master') { $replication->fillInfo( $type, 'Do_DB', @@ -150,7 +150,7 @@ foreach ($replication_types as $type) { $server_master_replication[0], 'Binlog_Ignore_DB' ); - } elseif ($type == "slave") { + } elseif ($type == 'slave') { $replication->fillInfo( $type, 'Do_DB', diff --git a/libraries/tbl_columns_definition_form.inc.php b/libraries/tbl_columns_definition_form.inc.php index bd65716f32..9c3da644f6 100644 --- a/libraries/tbl_columns_definition_form.inc.php +++ b/libraries/tbl_columns_definition_form.inc.php @@ -271,14 +271,14 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) { $mime_map[$columnMeta['Field']] = array_merge( $mime_map[$columnMeta['Field']], [ - 'mimetype' => Util::getValueByKey($_POST, "field_mimetype.${$columnNumber}"), + 'mimetype' => Util::getValueByKey($_POST, "field_mimetype.${columnNumber}"), 'transformation' => Util::getValueByKey( $_POST, - "field_transformation.${$columnNumber}" + "field_transformation.${columnNumber}" ), 'transformation_options' => Util::getValueByKey( $_POST, - "field_transformation_options.${$columnNumber}" + "field_transformation_options.${columnNumber}" ), ] ); diff --git a/phpcs.xml.dist b/phpcs.xml.dist index fc387d7abd..ccc4b7522a 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -37,6 +37,8 @@ + + diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php index 14f39bb44b..68653ca031 100644 --- a/test/bootstrap-dist.php +++ b/test/bootstrap-dist.php @@ -32,7 +32,7 @@ date_default_timezone_set('UTC'); // Adding phpMyAdmin sources to include path set_include_path( - get_include_path() . PATH_SEPARATOR . dirname((string) realpath("../index.php")) + get_include_path() . PATH_SEPARATOR . dirname((string) realpath('../index.php')) ); // Setting constants for testing diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index 53ca50be0f..616537853a 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -111,23 +111,23 @@ class AdvisorTest extends PmaTestCase return [ [ 10, - "10 per second", + '10 per second', ], [ 0.02, - "1.2 per minute", + '1.2 per minute', ], [ 0.003, - "10.8 per hour", + '10.8 per hour', ], [ 0.00003, - "2.59 per day", + '2.59 per day', ], [ 0.0000000003, - "<0.01 per day", + '<0.01 per day', ], ]; } @@ -140,10 +140,10 @@ class AdvisorTest extends PmaTestCase public function testAdvisorTimespanFormat() { $result = Advisor::timespanFormat(1200); - $this->assertEquals("0 days, 0 hours, 20 minutes and 0 seconds", $result); + $this->assertEquals('0 days, 0 hours, 20 minutes and 0 seconds', $result); $result = Advisor::timespanFormat(100); - $this->assertEquals("0 days, 0 hours, 1 minutes and 40 seconds", $result); + $this->assertEquals('0 days, 0 hours, 1 minutes and 40 seconds', $result); } /** diff --git a/test/classes/CentralColumnsTest.php b/test/classes/CentralColumnsTest.php index 6df3456dec..93497fa30f 100644 --- a/test/classes/CentralColumnsTest.php +++ b/test/classes/CentralColumnsTest.php @@ -31,8 +31,8 @@ class CentralColumnsTest extends TestCase private $columnData = [ [ - 'col_name' => "id", - "col_type" => 'integer', + 'col_name' => 'id', + 'col_type' => 'integer', 'col_length' => 0, 'col_isNull' => 0, 'col_extra' => 'UNSIGNED,auto_increment', @@ -40,7 +40,7 @@ class CentralColumnsTest extends TestCase 'col_collation' => '', ], [ - 'col_name' => "col1", + 'col_name' => 'col1', 'col_type' => 'varchar', 'col_length' => 100, 'col_isNull' => 1, @@ -49,7 +49,7 @@ class CentralColumnsTest extends TestCase 'col_collation' => '', ], [ - 'col_name' => "col2", + 'col_name' => 'col2', 'col_type' => 'DATETIME', 'col_length' => 0, 'col_isNull' => 1, @@ -61,8 +61,8 @@ class CentralColumnsTest extends TestCase private $modifiedColumnData = [ [ - 'col_name' => "id", - "col_type" => 'integer', + 'col_name' => 'id', + 'col_type' => 'integer', 'col_length' => 0, 'col_isNull' => 0, 'col_extra' => 'auto_increment', @@ -71,7 +71,7 @@ class CentralColumnsTest extends TestCase 'col_attribute' => 'UNSIGNED', ], [ - 'col_name' => "col1", + 'col_name' => 'col1', 'col_type' => 'varchar', 'col_length' => 100, 'col_isNull' => 1, @@ -81,7 +81,7 @@ class CentralColumnsTest extends TestCase 'col_attribute' => 'BINARY', ], [ - 'col_name' => "col2", + 'col_name' => 'col2', 'col_type' => 'DATETIME', 'col_length' => 0, 'col_isNull' => 1, @@ -103,7 +103,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['cfg']['Server']['user'] = 'pma_user'; $GLOBALS['cfg']['Server']['DisableIS'] = true; $GLOBALS['cfg']['MaxRows'] = 10; - $GLOBALS['cfg']['ServerDefault'] = "PMA_server"; + $GLOBALS['cfg']['ServerDefault'] = 'PMA_server'; $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $GLOBALS['cfg']['CharEditing'] = ''; $GLOBALS['cfg']['LimitChars'] = 50; @@ -137,31 +137,31 @@ class CentralColumnsTest extends TestCase ->will( $this->returnValue( [ - "id" => [ - "Type" => "integer", - "Null" => "NO", + 'id' => [ + 'Type' => 'integer', + 'Null' => 'NO', ], - "col1" => [ - "Type" => 'varchar(100)', - "Null" => "YES", + 'col1' => [ + 'Type' => 'varchar(100)', + 'Null' => 'YES', ], - "col2" => [ - "Type" => 'DATETIME', - "Null" => "NO", + 'col2' => [ + 'Type' => 'DATETIME', + 'Null' => 'NO', ], ] ) ); $dbi->expects($this->any()) ->method('getColumnNames') - ->will($this->returnValue(["id", "col1", "col2"])); + ->will($this->returnValue(['id', 'col1', 'col2'])); $dbi->expects($this->any()) ->method('tryQuery') ->will($this->returnValue(true)); $dbi->expects($this->any()) ->method('getTables') ->will( - $this->returnValue(["PMA_table", "PMA_table1", "PMA_table2"]) + $this->returnValue(['PMA_table', 'PMA_table1', 'PMA_table2']) ); $dbi->expects($this->any())->method('escapeString') ->will($this->returnArgument(0)); @@ -243,7 +243,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') ->with( - "SELECT count(db_name) FROM `pma_central_columns` " + 'SELECT count(db_name) FROM `pma_central_columns` ' . "WHERE db_name = 'phpmyadmin';", null, null, @@ -290,7 +290,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->at(4)) ->method('fetchResult') ->with( - "SELECT col_name FROM `pma_central_columns` " + 'SELECT col_name FROM `pma_central_columns` ' . "WHERE db_name = 'PMA_db' AND col_name IN ('col1');", null, null, @@ -303,7 +303,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->at(7)) ->method('tryQuery') ->with( - "DELETE FROM `pma_central_columns` " + 'DELETE FROM `pma_central_columns` ' . "WHERE db_name = 'PMA_db' AND col_name IN ('col1');", DatabaseInterface::CONNECT_CONTROL ) @@ -314,7 +314,7 @@ class CentralColumnsTest extends TestCase $this->assertTrue( $this->centralColumns->deleteColumnsFromList( $_POST['db'], - ["col1"], + ['col1'], false ) ); @@ -357,7 +357,7 @@ class CentralColumnsTest extends TestCase ); $this->assertTrue( $this->centralColumns->makeConsistentWithList( - "phpmyadmin", + 'phpmyadmin', ['PMA_table'] ) ); @@ -376,7 +376,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') ->with( - "SELECT col_name FROM `pma_central_columns` " + 'SELECT col_name FROM `pma_central_columns` ' . "WHERE db_name = 'PMA_db' AND col_name IN ('id','col1','col2');", null, null, @@ -387,8 +387,8 @@ class CentralColumnsTest extends TestCase ); $this->assertEquals( [ - "id", - "col1", + 'id', + 'col1', ], $this->centralColumns->getFromTable( $db, @@ -410,7 +410,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') ->with( - "SELECT * FROM `pma_central_columns` " + 'SELECT * FROM `pma_central_columns` ' . "WHERE db_name = 'PMA_db' AND col_name IN ('id','col1','col2');", null, null, @@ -438,30 +438,30 @@ class CentralColumnsTest extends TestCase { $this->assertTrue( $this->centralColumns->updateOneColumn( - "phpmyadmin", - "", - "", - "", - "", - "", + 'phpmyadmin', + '', + '', + '', + '', + '', 0, - "", - "", - "" + '', + '', + '' ) ); $this->assertTrue( $this->centralColumns->updateOneColumn( - "phpmyadmin", - "col1", - "", - "", - "", - "", + 'phpmyadmin', + 'col1', + '', + '', + '', + '', 0, - "", - "", - "" + '', + '', + '' ) ); } @@ -475,36 +475,36 @@ class CentralColumnsTest extends TestCase { $params['db'] = 'phpmyadmin'; $params['orig_col_name'] = [ - "col1", - "col2", + 'col1', + 'col2', ]; $params['field_name'] = [ - "col1", - "col2", + 'col1', + 'col2', ]; $params['field_default_type'] = [ - "", - "", + '', + '', ]; $params['col_extra'] = [ - "", - "", + '', + '', ]; $params['field_length'] = [ - "", - "", + '', + '', ]; $params['field_attribute'] = [ - "", - "", + '', + '', ]; $params['field_type'] = [ - "", - "", + '', + '', ]; $params['field_collation'] = [ - "", - "", + '', + '', ]; $this->assertTrue( $this->centralColumns->updateMultipleColumn($params) @@ -521,7 +521,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->any()) ->method('fetchResult') ->with( - "SELECT * FROM `pma_central_columns` " + 'SELECT * FROM `pma_central_columns` ' . "WHERE db_name = 'phpmyadmin' AND col_name IN ('col1','col2');", null, null, @@ -532,8 +532,8 @@ class CentralColumnsTest extends TestCase ); $result = $this->centralColumns->getHtmlForEditingPage( [ - "col1", - "col2", + 'col1', + 'col2', ], 'phpmyadmin' ); @@ -592,7 +592,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') ->with( - "SELECT * FROM `pma_central_columns` " + 'SELECT * FROM `pma_central_columns` ' . "WHERE db_name = 'phpmyadmin';", null, null, @@ -620,7 +620,7 @@ class CentralColumnsTest extends TestCase $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') ->with( - "SELECT * FROM `pma_central_columns` " + 'SELECT * FROM `pma_central_columns` ' . "WHERE db_name = 'phpmyadmin' AND col_name " . "NOT IN ('id','col1','col2');", null, @@ -649,8 +649,8 @@ class CentralColumnsTest extends TestCase $db = 'phpmyadmin'; $total_rows = 50; $pos = 26; - $pmaThemeImage = "pmaThemeImage"; - $text_dir = "text_dir"; + $pmaThemeImage = 'pmaThemeImage'; + $text_dir = 'text_dir'; $max_rows = (int) $GLOBALS['cfg']['MaxRows']; // test for not empty table $result = $this->centralColumns->getHtmlForMain( @@ -778,14 +778,14 @@ class CentralColumnsTest extends TestCase */ public function testGetTableFooter() { - $pmaThemeImage = "pmaThemeImage"; - $text_dir = "text_dir"; + $pmaThemeImage = 'pmaThemeImage'; + $text_dir = 'text_dir'; $result = $this->centralColumns->getTableFooter($pmaThemeImage, $text_dir); $this->assertStringContainsString( 'assertStringContainsString("With selected:", $result); + $this->assertStringContainsString('With selected:', $result); $this->assertStringContainsString( '