diff --git a/libraries/gis/pma_gis_geometrycollection.php b/libraries/gis/pma_gis_geometrycollection.php index 91c5a588c9ec..0a770971a304 100644 --- a/libraries/gis/pma_gis_geometrycollection.php +++ b/libraries/gis/pma_gis_geometrycollection.php @@ -59,7 +59,7 @@ public function scaleRow($spatial) // Trim to remove leading 'GEOMETRYCOLLECTION(' and trailing ')' $goem_col = substr($spatial, 19, (strlen($spatial) - 20)); - + // Split the geometry collection object to get its constituents. $sub_parts = $this->_explodeGeomCol($goem_col); diff --git a/libraries/navigation/NavigationTree.class.php b/libraries/navigation/NavigationTree.class.php index 515a406a6b28..29924ab17335 100644 --- a/libraries/navigation/NavigationTree.class.php +++ b/libraries/navigation/NavigationTree.class.php @@ -928,7 +928,7 @@ private function _renderNode($node, $recursive = -1, $class = '') $title = $node->getComment(); if ($title) { $title = ' title="' - . htmlentities($title, ENT_QUOTES, 'UTF-8') + . htmlentities($title, ENT_QUOTES, 'UTF-8') . '"'; } } else { diff --git a/libraries/navigation/Nodes/Node.class.php b/libraries/navigation/Nodes/Node.class.php index 0a8703ba41d4..a3253ef2e278 100644 --- a/libraries/navigation/Nodes/Node.class.php +++ b/libraries/navigation/Nodes/Node.class.php @@ -362,7 +362,7 @@ public function getData($type, $pos, $searchClause = '') // @todo obey the DisableIS directive $query = "SELECT `SCHEMA_NAME` "; $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; - $query .= $this->_getWhereClause($searchClause); + $query .= $this->_getWhereClause($searchClause); $query .= "ORDER BY `SCHEMA_NAME` ASC "; $query .= "LIMIT $pos, {$GLOBALS['cfg']['MaxNavigationItems']}"; return PMA_DBI_fetchResult($query); @@ -394,7 +394,7 @@ public function getPresence($type = '', $searchClause = '') if (! $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['DisableIS']) { $query = "SELECT COUNT(*) "; $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; - $query .= $this->_getWhereClause($searchClause); + $query .= $this->_getWhereClause($searchClause); $retval = (int)PMA_DBI_fetchValue($query); } else { $query = "SHOW DATABASES "; @@ -412,11 +412,11 @@ public function getPresence($type = '', $searchClause = '') /** * Returns the WHERE clause depending on the $searchClause parameter - * and the hide_db directive + * and the hide_db directive * * @param string $searchClause A string used to filter the results of the query * - * @return string + * @return string */ private function _getWhereClause($searchClause = '') { diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php index d105e6cf3599..da499513ba6f 100644 --- a/libraries/replication.inc.php +++ b/libraries/replication.inc.php @@ -75,7 +75,8 @@ 'Seconds_Behind_Master', ); /** - * define important variables, which need to be watched for correct running of replication in slave mode + * define important variables, which need to be watched for + * correct running of replication in slave mode * * @usedby PMA_replication_print_status_table() */ @@ -110,29 +111,48 @@ } if (${"server_{$type}_status"}) { if ($type == "master") { - ${"server_{$type}_Do_DB"} = explode(",", $server_master_replication[0]["Binlog_Do_DB"]); + ${"server_{$type}_Do_DB"} = explode( + ",", $server_master_replication[0]["Binlog_Do_DB"] + ); $replication_info[$type]['Do_DB'] = ${"server_{$type}_Do_DB"}; - ${"server_{$type}_Ignore_DB"} = explode(",", $server_master_replication[0]["Binlog_Ignore_DB"]); + ${"server_{$type}_Ignore_DB"} = explode( + ",", $server_master_replication[0]["Binlog_Ignore_DB"] + ); $replication_info[$type]['Ignore_DB'] = ${"server_{$type}_Ignore_DB"}; } elseif ($type == "slave") { - ${"server_{$type}_Do_DB"} = explode(",", $server_slave_replication[0]["Replicate_Do_DB"]); + ${"server_{$type}_Do_DB"} = explode( + ",", $server_slave_replication[0]["Replicate_Do_DB"] + ); $replication_info[$type]['Do_DB'] = ${"server_{$type}_Do_DB"}; - ${"server_{$type}_Ignore_DB"} = explode(",", $server_slave_replication[0]["Replicate_Ignore_DB"]); + ${"server_{$type}_Ignore_DB"} = explode( + ",", $server_slave_replication[0]["Replicate_Ignore_DB"] + ); $replication_info[$type]['Ignore_DB'] = ${"server_{$type}_Ignore_DB"}; - ${"server_{$type}_Do_Table"} = explode(",", $server_slave_replication[0]["Replicate_Do_Table"]); + ${"server_{$type}_Do_Table"} = explode( + ",", $server_slave_replication[0]["Replicate_Do_Table"] + ); $replication_info[$type]['Do_Table'] = ${"server_{$type}_Do_Table"}; - ${"server_{$type}_Ignore_Table"} = explode(",", $server_slave_replication[0]["Replicate_Ignore_Table"]); - $replication_info[$type]['Ignore_Table'] = ${"server_{$type}_Ignore_Table"}; - - ${"server_{$type}_Wild_Do_Table"} = explode(",", $server_slave_replication[0]["Replicate_Wild_Do_Table"]); - $replication_info[$type]['Wild_Do_Table'] = ${"server_{$type}_Wild_Do_Table"}; - - ${"server_{$type}_Wild_Ignore_Table"} = explode(",", $server_slave_replication[0]["Replicate_Wild_Ignore_Table"]); - $replication_info[$type]['Wild_Ignore_Table'] = ${"server_{$type}_Wild_Ignore_Table"}; + ${"server_{$type}_Ignore_Table"} = explode( + ",", $server_slave_replication[0]["Replicate_Ignore_Table"] + ); + $replication_info[$type]['Ignore_Table'] + = ${"server_{$type}_Ignore_Table"}; + + ${"server_{$type}_Wild_Do_Table"} = explode( + ",", $server_slave_replication[0]["Replicate_Wild_Do_Table"] + ); + $replication_info[$type]['Wild_Do_Table'] + = ${"server_{$type}_Wild_Do_Table"}; + + ${"server_{$type}_Wild_Ignore_Table"} = explode( + ",", $server_slave_replication[0]["Replicate_Wild_Ignore_Table"] + ); + $replication_info[$type]['Wild_Ignore_Table'] + = ${"server_{$type}_Wild_Ignore_Table"}; } } } @@ -145,7 +165,7 @@ * * @return $string the extracted part */ -function PMA_extract_db_or_table($string, $what = 'db') +function PMA_extractDbOrTable($string, $what = 'db') { $list = explode(".", $string); if ('db' == $what) { @@ -159,13 +179,15 @@ function PMA_extract_db_or_table($string, $what = 'db') * Configures replication slave * * @param string $action possible values: START or STOP - * @param string $control default: null, possible values: SQL_THREAD or IO_THREAD or null. - * If it is set to null, it controls both SQL_THREAD and IO_THREAD + * @param string $control default: null, + * possible values: SQL_THREAD or IO_THREAD or null. + * If it is set to null, it controls both + * SQL_THREAD and IO_THREAD * @param mixed $link mysql link * * @return mixed output of PMA_DBI_tryQuery */ -function PMA_replication_slave_control($action, $control = null, $link = null) +function PMA_Replication_Slave_control($action, $control = null, $link = null) { $action = strtoupper($action); $control = strtoupper($control); @@ -195,11 +217,11 @@ function PMA_replication_slave_control($action, $control = null, $link = null) * * @return output of CHANGE MASTER mysql command */ -function PMA_replication_slave_change_master($user, $password, $host, $port, +function PMA_Replication_Slave_changeMaster($user, $password, $host, $port, $pos, $stop = true, $start = true, $link = null ) { if ($stop) { - PMA_replication_slave_control("STOP", null, $link); + PMA_Replication_Slave_control("STOP", null, $link); } $out = PMA_DBI_tryQuery( @@ -213,7 +235,7 @@ function PMA_replication_slave_change_master($user, $password, $host, $port, ); if ($start) { - PMA_replication_slave_control("START", null, $link); + PMA_Replication_Slave_control("START", null, $link); } return $out; @@ -230,8 +252,9 @@ function PMA_replication_slave_change_master($user, $password, $host, $port, * * @return mixed $link mysql link on success */ -function PMA_replication_connect_to_master($user, $password, $host = null, $port = null, $socket = null) -{ +function PMA_Replication_connectToMaster( + $user, $password, $host = null, $port = null, $socket = null +) { $server = array(); $server["host"] = $host; $server["port"] = $port; @@ -247,9 +270,9 @@ function PMA_replication_connect_to_master($user, $password, $host = null, $port * @param mixed $link mysql link * * @return array an array containing File and Position in MySQL replication - * on master server, useful for PMA_replication_slave_change_master + * on master server, useful for PMA_Replication_Slave_changeMaster */ -function PMA_replication_slave_bin_log_master($link = null) +function PMA_Replication_Slave_binLogMaster($link = null) { $data = PMA_DBI_fetchResult('SHOW MASTER STATUS', null, null, $link); $output = array(); @@ -269,7 +292,7 @@ function PMA_replication_slave_bin_log_master($link = null) * @return array array of replicated databases */ -function PMA_replication_master_replicated_dbs($link = null) +function PMA_Replication_Master_getReplicatedDbs($link = null) { // let's find out, which databases are replicated $data = PMA_DBI_fetchResult('SHOW MASTER STATUS', null, null, $link); diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index 9121a592079f..cd6ef34f332b 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -961,8 +961,8 @@ function PMA_getServerSlaveStatus($server_slave_status, $truename) $do = true; } foreach ($server_slave_Wild_Do_Table as $db_table) { - $table_part = PMA_extract_db_or_table($db_table, 'table'); - if (($GLOBALS['db'] == PMA_extract_db_or_table($db_table, 'db')) + $table_part = PMA_extractDbOrTable($db_table, 'table'); + if (($GLOBALS['db'] == PMA_extractDbOrTable($db_table, 'db')) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename)) ) { $do = true; @@ -975,8 +975,8 @@ function PMA_getServerSlaveStatus($server_slave_status, $truename) $ignored = true; } foreach ($server_slave_Wild_Ignore_Table as $db_table) { - $table_part = PMA_extract_db_or_table($db_table, 'table'); - if (($db == PMA_extract_db_or_table($db_table)) + $table_part = PMA_extractDbOrTable($db_table, 'table'); + if (($db == PMA_extractDbOrTable($db_table)) && (preg_match("@^" . substr($table_part, 0, strlen($table_part) - 1) . "@", $truename)) ) { $ignored = true; @@ -2508,14 +2508,14 @@ function PMA_moveColumns($db, $table) /** * Get columns with unique index - * + * * @param string $db database name * @param string $table tablename - * + * * @return array $columns_with_unique_index An array of columns with unique index, * with $column name as the array key */ -function PMA_getColumnsWithUniqueIndex($db ,$table) +function PMA_getColumnsWithUniqueIndex($db ,$table) { $columns_with_unique_index = array(); foreach (PMA_Index::getFromTable($table, $db) as $index) { @@ -2531,22 +2531,22 @@ function PMA_getColumnsWithUniqueIndex($db ,$table) /** * Check column names for MySQL reserved words - * + * * @param string $db database name * @param string $table tablename - * + * * @return array $messages array of PMA_Messages */ -function PMA_getReservedWordColumnNameMessages($db ,$table) +function PMA_getReservedWordColumnNameMessages($db ,$table) { $messages = array(); if ($GLOBALS['cfg']['ReservedWordDisableWarning'] === false) { $pma_table = new PMA_Table($table, $db); - $columns = $pma_table->getReservedColumnNames(); + $columns = $pma_table->getReservedColumnNames(); if (!empty($columns)) { foreach ($columns as $column) { $msg = PMA_message::notice( - __('The column name \'%s\' is a MySQL reserved keyword.') + __('The column name \'%s\' is a MySQL reserved keyword.') ); $msg->addParam($column); $messages[] = $msg; diff --git a/server_engines.php b/server_engines.php index 892d52309630..fca316e42f94 100644 --- a/server_engines.php +++ b/server_engines.php @@ -35,19 +35,19 @@ */ function PMA_getServerEnginesHtml() { - /** - * Did the user request information about a certain storage engine? - */ - $html = ''; - if (empty($_REQUEST['engine']) - || ! PMA_StorageEngine::isValid($_REQUEST['engine']) - ) { - $html .= PMA_getAllServerEnginesHtml(); - } else { - $html .= PMA_getSpecifiedServerEnginesHtml(); - } - - return $html; + /** + * Did the user request information about a certain storage engine? + */ + $html = ''; + if (empty($_REQUEST['engine']) + || ! PMA_StorageEngine::isValid($_REQUEST['engine']) + ) { + $html .= PMA_getAllServerEnginesHtml(); + } else { + $html .= PMA_getSpecifiedServerEnginesHtml(); + } + + return $html; } /** diff --git a/server_replication.php b/server_replication.php index 70e6b4fb1801..ab18c22255a5 100644 --- a/server_replication.php +++ b/server_replication.php @@ -79,7 +79,7 @@ $_SESSION['replication']['sr_action_info'] = __('Unknown error'); // Attempt to connect to the new master server - $link_to_master = PMA_replication_connect_to_master( + $link_to_master = PMA_Replication_connectToMaster( $sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'] ); @@ -91,7 +91,7 @@ ); } else { // Read the current master position - $position = PMA_replication_slave_bin_log_master($link_to_master); + $position = PMA_Replication_Slave_binLogMaster($link_to_master); if (empty($position)) { $_SESSION['replication']['sr_action_status'] = 'error'; @@ -99,7 +99,7 @@ } else { $_SESSION['replication']['m_correct'] = true; - if (! PMA_replication_slave_change_master($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'], $position, true, false)) { + if (! PMA_Replication_Slave_changeMaster($sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'], $position, true, false)) { $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = __('Unable to change master'); } else { @@ -113,11 +113,11 @@ } } elseif (isset($GLOBALS['sr_slave_server_control'])) { if ($GLOBALS['sr_slave_action'] == 'reset') { - PMA_replication_slave_control("STOP"); + PMA_Replication_Slave_control("STOP"); PMA_DBI_tryQuery("RESET SLAVE;"); - PMA_replication_slave_control("START"); + PMA_Replication_Slave_control("START"); } else { - PMA_replication_slave_control( + PMA_Replication_Slave_control( $GLOBALS['sr_slave_action'], $GLOBALS['sr_slave_control_parm'] ); @@ -129,9 +129,9 @@ if (isset($GLOBALS['sr_skip_errors_count'])) { $count = $GLOBALS['sr_skip_errors_count'] * 1; } - PMA_replication_slave_control("STOP"); + PMA_Replication_Slave_control("STOP"); PMA_DBI_tryQuery("SET GLOBAL SQL_SLAVE_SKIP_COUNTER = ".$count.";"); - PMA_replication_slave_control("START"); + PMA_Replication_Slave_control("START"); } diff --git a/server_status_monitor.php b/server_status_monitor.php index 0515ffd2986b..e5d1bded4548 100644 --- a/server_status_monitor.php +++ b/server_status_monitor.php @@ -765,26 +765,26 @@ function PMA_getPopContentHtml() */ function PMA_getClientSideDataAndLinksHtml($ServerStatusData) { - /** - * Define some data needed on the client side + /** + * Define some data needed on the client side */ - $input = ''; - $form = '
'; - /** - * Define some links used on client side - */ - $links = '