on which to apply the effect
* @param string $message the message to show as a link
- *
+ *
* @return string html div element
- *
+ *
*/
function PMA_getDivForSliderEffect($id, $message)
{
@@ -2710,7 +2711,7 @@ function PMA_getDivForSliderEffect($id, $message)
* method maybe by using an additional param, the id of the div to
* append to
*/
-
+
return '
Date: Fri, 25 May 2012 22:43:23 +0530
Subject: [PATCH 02/29] Fix function names: PMA_AddJSVar -> PMA_addJSVar
---
libraries/core.lib.php | 2 +-
main.php | 2 +-
server_status.php | 16 ++++++++--------
server_variables.php | 6 +++---
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index 14ee4fe1a4..b024bf4de4 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -796,7 +796,7 @@ function PMA_AddJSCode($str)
*
* @return void
*/
-function PMA_AddJSVar($key, $value, $escape = true)
+function PMA_addJSVar($key, $value, $escape = true)
{
PMA_AddJsCode(PMA_getJsValue($key, $value, $escape));
}
diff --git a/main.php b/main.php
index 9dc61bdf67..202eb86627 100644
--- a/main.php
+++ b/main.php
@@ -19,7 +19,7 @@ if ($GLOBALS['PMA_Config']->isGitRevision()) {
if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) {
PMA_printGitRevision();
}
- PMA_AddJSVar('is_git_revision', true);
+ PMA_addJSVar('is_git_revision', true);
}
// Handles some variables that may have been sent by the calling script
diff --git a/server_status.php b/server_status.php
index f068bbad87..ed1d4f136a 100644
--- a/server_status.php
+++ b/server_status.php
@@ -729,36 +729,36 @@ $server_db_isLocal = strtolower($cfg['Server']['host']) == 'localhost'
|| $cfg['Server']['host'] == '127.0.0.1'
|| $cfg['Server']['host'] == '::1';
-PMA_AddJSVar(
+PMA_addJSVar(
'pma_token',
$_SESSION[' PMA_token ']
);
-PMA_AddJSVar(
+PMA_addJSVar(
'url_query',
str_replace('&', '&', PMA_generate_common_url($db))
);
-PMA_AddJSVar(
+PMA_addJSVar(
'server_time_diff',
'new Date().getTime() - ' . (microtime(true) * 1000),
false
);
-PMA_AddJSVar(
+PMA_addJSVar(
'server_os',
PHP_OS
);
-PMA_AddJSVar(
+PMA_addJSVar(
'is_superuser',
PMA_isSuperuser()
);
-PMA_AddJSVar(
+PMA_addJSVar(
'server_db_isLocal',
$server_db_isLocal
);
-PMA_AddJSVar(
+PMA_addJSVar(
'profiling_docu',
PMA_showMySQLDocu('general-thread-states', 'general-thread-states')
);
-PMA_AddJSVar(
+PMA_addJSVar(
'explain_docu',
PMA_showMySQLDocu('explain-output', 'explain-output')
);
diff --git a/server_variables.php b/server_variables.php
index bde86d6ea9..ab023a97e6 100644
--- a/server_variables.php
+++ b/server_variables.php
@@ -9,9 +9,9 @@ require_once 'libraries/common.inc.php';
$GLOBALS['js_include'][] = 'server_variables.js';
-PMA_AddJSVar('pma_token', $_SESSION[' PMA_token ']);
-PMA_AddJSVar('url_query', str_replace('&', '&', PMA_generate_common_url($db)));
-PMA_AddJSVar('is_superuser', PMA_isSuperuser() ? true : false);
+PMA_addJSVar('pma_token', $_SESSION[' PMA_token ']);
+PMA_addJSVar('url_query', str_replace('&', '&', PMA_generate_common_url($db)));
+PMA_addJSVar('is_superuser', PMA_isSuperuser() ? true : false);
/**
From 8649b8263ca623534015b170e83d6c6c5eca0ecd Mon Sep 17 00:00:00 2001
From: Madhura Jayaratne
Date: Fri, 25 May 2012 22:45:21 +0530
Subject: [PATCH 03/29] Fix function names: PMA_AddJSCode -> PMA_addJSCode
---
libraries/common.inc.php | 2 +-
libraries/core.lib.php | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libraries/common.inc.php b/libraries/common.inc.php
index f3b0b183bc..c3a0f6a2f8 100644
--- a/libraries/common.inc.php
+++ b/libraries/common.inc.php
@@ -571,7 +571,7 @@ $GLOBALS['js_include'][] = 'update-location.js';
/**
* holds an array of javascript code snippets to be included in the HTML header
- * Can be used with PMA_AddJSCode() to pass on js variables to the browser.
+ * Can be used with PMA_addJSCode() to pass on js variables to the browser.
* @global array $js_script
*/
$GLOBALS['js_script'] = array();
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index b024bf4de4..44cfc309e4 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -781,7 +781,7 @@ function PMA_includeJS($url, $ie_conditional = false)
*
* @return void
*/
-function PMA_AddJSCode($str)
+function PMA_addJSCode($str)
{
$GLOBALS['js_script'][] = $str;
}
@@ -798,7 +798,7 @@ function PMA_AddJSCode($str)
*/
function PMA_addJSVar($key, $value, $escape = true)
{
- PMA_AddJsCode(PMA_getJsValue($key, $value, $escape));
+ PMA_addJSCode(PMA_getJsValue($key, $value, $escape));
}
?>
From cc79df9e8dfd7a51ee400360a2d05f1e7227a114 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:37:29 +0200
Subject: [PATCH 04/29] Wrap some comments
---
libraries/server_synchronize.lib.php | 29 ++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 1d17fbad41..a99dcf7944 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -1029,8 +1029,10 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link,
* altered for the targert table
* @param array $matching_tables_fields name of the fields for the matching table
* @param array $criteria criteria
- * @param array &$matching_tables_keys field names which is key in the source table
- * @param array &$target_tables_keys field names which is key in the target table
+ * @param array &$matching_tables_keys field names which is key in the source
+ * table
+ * @param array &$target_tables_keys field names which is key in the target
+ * table
* @param int $matching_table_index number of the matching table
* @param bool $display whether to display query
*
@@ -1163,8 +1165,10 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
* @param string $trg_db name of target database
* @param mixed $trg_link connection established with target server
* @param array $matching_tables names of matching tables
- * @param array $uncommon_columns array containing the names of the column which are to be dropped from the target table
- * @param int $table_counter index of the matching table as in $matchiing_tables array
+ * @param array $uncommon_columns array containing the names of the column which
+ * are to be dropped from the target table
+ * @param int $table_counter index of the matching table as in
+ * $matchiing_tables array
* @param bool $display whether to display query
*
* @return nothing
@@ -1214,9 +1218,11 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
}
/**
- * PMA_indexesDiffInTables() compares the source table indexes with target table indexes and keep the indexes to be added in target table in $add_indexes_array
- * indexes to be altered in $alter_indexes_array and indexes to be removed from target table in $remove_indexes_array.
- * Only keyname and uniqueness characteristic of the indexes are altered.
+ * PMA_indexesDiffInTables() compares the source table indexes with target
+ * table indexes and keep the indexes to be added in target table in
+ * $add_indexes_array indexes to be altered in $alter_indexes_array and indexes
+ * to be removed from target table in $remove_indexes_array. Only keyname and
+ * uniqueness characteristic of the indexes are altered.
*
* @param string $src_db name of source database
* @param string $trg_db name of target database
@@ -1290,9 +1296,12 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link,
* @param array $matching_tables matching tables name
* @param array $source_indexes indexes of the source table
* @param array $target_indexes indexes of the target table
- * @param array $add_indexes_array column names on which indexes are to be created in target table
- * @param array $alter_indexes_array column names for which indexes are to be altered
- * @param array $remove_indexes_array key name of the indexes which are to be removed from the target table
+ * @param array $add_indexes_array column names on which indexes are to be
+ * created in target table
+ * @param array $alter_indexes_array column names for which indexes are to be
+ * altered
+ * @param array $remove_indexes_array key name of the indexes which are to be
+ * removed from the target table
* @param int $table_counter number of the matching table
* @param bool $display whether to display query
*
From 624d0b2fc01e7c492595deb9420fbea2cff9b151 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:43:11 +0200
Subject: [PATCH 05/29] Wrap some long lines
---
libraries/server_synchronize.lib.php | 109 ++++++++++++++++++---------
1 file changed, 74 insertions(+), 35 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index a99dcf7944..446117c8e3 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -158,10 +158,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
// Query the target server to see which rows already exist
$trg_select_query = "SELECT * FROM " . PMA_backquote($trg_db) . "."
- . PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
+ . PMA_backquote($matching_table[$matching_table_index])
+ . " WHERE ";
if (sizeof($is_key) == 1) {
- $trg_select_query .= PMA_backquote($is_key[0]). "='" . $source_result_set[$j] . "'";
+ $trg_select_query .= PMA_backquote($is_key[0])
+ . "='" . $source_result_set[$j] . "'";
} elseif (sizeof($is_key) > 1) {
for ($k=0; $k < sizeof($is_key); $k++) {
$trg_select_query .= PMA_backquote($is_key[$k])
@@ -176,8 +178,10 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
if ($target_result_set) {
// Fetch the row from the source server to do a comparison
- $src_select_query = "SELECT * FROM " . PMA_backquote($src_db) . "."
- . PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
+ $src_select_query = "SELECT * FROM "
+ . PMA_backquote($src_db) . "."
+ . PMA_backquote($matching_table[$matching_table_index])
+ . " WHERE ";
if (sizeof($is_key) == 1) {
$src_select_query .= PMA_backquote($is_key[0])
@@ -195,9 +199,10 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
$src_result_set = PMA_DBI_fetch_result($src_select_query, null, null, $src_link);
/**
- * Comparing each corresponding field of the source and target matching rows.
- * Placing the primary key, value of primary key, field to be updated, and the
- * new value of field to be updated in each row of the update array.
+ * Comparing each corresponding field of the source and target
+ * matching rows. Placing the primary key, value of primary
+ * key, field to be updated, and the new value of field to
+ * be updated in each row of the update array.
*/
for ($m = 0; ($m < $fields_num[$matching_table_index]) && ($starting_index == 0) ; $m++) {
if (isset($src_result_set[0][$fld[$m]])) {
@@ -277,7 +282,8 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
}
} else {
/**
- * Placing the primary key, and the value of primary key of the row that is to be inserted in the target table
+ * Placing the primary key, and the value of primary key of the
+ * row that is to be inserted in the target table
*/
if (sizeof($is_key) == 1) {
if (isset($source_result_set[$j])) {
@@ -294,8 +300,10 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
}
} else {
/**
- * Placing the primary key, and the value of primary key of the row that is to be inserted in the target table
- * This condition is met when there is an additional column in the source table
+ * Placing the primary key, and the value of primary key of the
+ * row that is to be inserted in the target table. This
+ * condition is met when there is an additional column in the
+ * source table
*/
if (sizeof($is_key) == 1) {
if (isset($source_result_set[$j])) {
@@ -405,7 +413,8 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
*/
function PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_link, $index, &$row_count)
{
- $query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "." . PMA_backquote($source_tables_uncommon[$index]);
+ $query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "."
+ . PMA_backquote($source_tables_uncommon[$index]);
$rows = PMA_DBI_fetch_result($query, null, null, $src_link);
$row_count[$index] = $rows[0];
}
@@ -488,20 +497,32 @@ function PMA_updateTargetTables(
* @param mixed $trg_link connection established with target server
* @param array $table_fields field names of a table
* @param array &$array_insert
- * @param int $matching_table_index index of matching table in matching_table_array
- * @param array $matching_tables_keys field names that are keys in the matching table
+ * @param int $matching_table_index index of matching table in
+ * matching_table_array
+ * @param array $matching_tables_keys field names that are keys in the matching
+ * table
* @param array $source_columns source column information
- * @param array &$add_column_array column names that are to be added in target table
- * @param array $criteria criteria like type, null, collation, default etc
- * @param array $target_tables_keys field names that are keys in the target table
- * @param array $uncommon_tables table names that are present in source db but not in targt db
+ * @param array &$add_column_array column names that are to be added in
+ * target table
+ * @param array $criteria criteria like type, null, collation,
+ * default etc
+ * @param array $target_tables_keys field names that are keys in the target
+ * table
+ * @param array $uncommon_tables table names that are present in source db
+ * but not in targt db
* @param array &$uncommon_tables_fields field names of the uncommon tables
- * @param array $uncommon_cols column names that are present in target table and not in source table
+ * @param array $uncommon_cols column names that are present in target
+ * table and not in source table
* @param array &$alter_str_array column names that are to be altered
- * @param array &$source_indexes column names on which indexes are made in source table
- * @param array &$target_indexes column names on which indexes are made in target table
- * @param array &$add_indexes_array column names on which index is to be added in target table
- * @param array &$alter_indexes_array column names whose indexes are to be altered. Only index name and uniqueness of an index can be changed
+ * @param array &$source_indexes column names on which indexes are made
+ * in source table
+ * @param array &$target_indexes column names on which indexes are made
+ * in target table
+ * @param array &$add_indexes_array column names on which index is to be
+ * added in target table
+ * @param array &$alter_indexes_array column names whose indexes are to be
+ * altered. Only index name and uniqueness
+ * of an index can be changed
* @param array &$delete_array rows that are to be deleted
* @param array &$update_array rows that are to be updated in target
* @param bool $display whether to display query
@@ -713,10 +734,17 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link,
$uncommon_tables, $table_index, $uncommon_tables_fields, $display
) {
- $display = false; // todo: maybe display some of the queries if they are not too numerous
- $unbuffered_result = PMA_DBI_try_query('SELECT * FROM ' . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), $src_link, PMA_DBI_QUERY_UNBUFFERED);
+ // @todo: maybe display some of the queries if they are not too numerous
+ $display = false;
+ $unbuffered_result = PMA_DBI_try_query(
+ 'SELECT * FROM ' . PMA_backquote($src_db) . '.'
+ . PMA_backquote($uncommon_tables[$table_index]),
+ $src_link,
+ PMA_DBI_QUERY_UNBUFFERED
+ );
if (false !== $unbuffered_result) {
- $insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
+ $insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.'
+ . PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
while ($one_row = PMA_DBI_fetch_row($unbuffered_result)) {
$insert_query .= '(';
$key_of_last_value = count($one_row) - 1;
@@ -750,9 +778,8 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link,
*
* @return nothing
*/
-function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index,
- $target_tables_keys, $delete_array, $display
-) {
+function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables,
+$table_index, $target_tables_keys, $delete_array, $display) {
for ($i = 0; $i < sizeof($delete_array[$table_index]); $i++) {
if (isset($target_tables_keys[$table_index])) {
$delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
@@ -776,7 +803,13 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
- $drop_pk_query = "DELETE FROM " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . " WHERE " . PMA_backquote($pk_query_result[$b]['COLUMN_NAME']) . " = " . $target_tables_keys[$table_index][$y] . ";";
+ $drop_pk_query = "DELETE FROM "
+ . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA'])
+ . "."
+ . PMA_backquote($pk_query_result[$b]['TABLE_NAME'])
+ . " WHERE "
+ . PMA_backquote($pk_query_result[$b]['COLUMN_NAME'])
+ . " = " . $target_tables_keys[$table_index][$y] . ";";
PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
}
}
@@ -1139,7 +1172,8 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
}
}
$check = false;
- $query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]);
+ $query = "ALTER TABLE " . PMA_backquote($trg_db) . '.'
+ . PMA_backquote($matching_tables[$matching_table_index]);
for ($p = 0; $p < sizeof($matching_tables_keys[$matching_table_index]); $p++) {
if ((isset($alter_str_array[$matching_table_index][$matching_tables_keys[$matching_table_index][$p]]['Key']))) {
$check = true;
@@ -1177,7 +1211,8 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
$uncommon_columns, $table_counter, $display
) {
if (isset($uncommon_columns[$table_counter])) {
- $drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
+ $drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "."
+ . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($uncommon_columns[$table_counter]); $a++) {
//Checks if column to be removed is a foreign key in any table
$pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
@@ -1411,19 +1446,23 @@ function PMA_syncDisplayHeaderCompare($src_db, $trg_db)
echo '';
echo '';
- echo '' . __('Source database') . ': ' . htmlspecialchars($src_db) . ' (';
+ echo ' | ' . __('Source database') . ': '
+ . htmlspecialchars($src_db) . ' (';
if ('cur' == $_SESSION['src_type']) {
echo __('Current server');
} else {
- echo __('Remote server') . ' ' . htmlspecialchars($_SESSION['src_server']['host']);
+ echo __('Remote server') . ' '
+ . htmlspecialchars($_SESSION['src_server']['host']);
}
echo ') | ';
echo '' . __('Difference') . ' | ';
- echo '' . __('Target database') . ': '. htmlspecialchars($trg_db) . ' (';
+ echo ' | ' . __('Target database') . ': '
+ . htmlspecialchars($trg_db) . ' (';
if ('cur' == $_SESSION['trg_type']) {
echo __('Current server');
} else {
- echo __('Remote server') . ' ' . htmlspecialchars($_SESSION['trg_server']['host']);
+ echo __('Remote server') . ' '
+ . htmlspecialchars($_SESSION['trg_server']['host']);
}
echo ') | ';
echo '
';
From 00e21a04d9d3becd9bbd72194b2dc3a12b5822dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:45:23 +0200
Subject: [PATCH 06/29] Wrap some more lines
---
libraries/server_synchronize.lib.php | 50 ++++++++++++++++++----------
1 file changed, 33 insertions(+), 17 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 446117c8e3..389ed150f0 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -26,7 +26,8 @@ if (! defined('PHPMYADMIN')) {
* @return nothing
*/
function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables,
-&$uncommon_source_tables) {
+ &$uncommon_source_tables
+) {
for ($k=0; $k< sizeof($src_tables); $k++) {
$present_in_target = false;
for ($l=0; $l < sizeof($trg_tables); $l++) {
@@ -54,7 +55,8 @@ function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables,
* @return nothing
*/
function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables,
-&$uncommon_target_tables) {
+ &$uncommon_target_tables
+) {
for ($c=0; $c $each_column) {
if (isset($target_columns[$matching_table_index][$column_name]['Field'])) {
- //If column exists in target table then matches criteria like type, null, collation, key, default, comment of the column
+ //If column exists in target table then matches criteria like type,
+ // null, collation, key, default, comment of the column
for ($i = 0; $i < sizeof($criteria); $i++) {
if ($source_columns[$matching_table_index][$column_name][$criteria[$i]] != $target_columns[$matching_table_index][$column_name][$criteria[$i]]) {
if (($criteria[$i] == 'Default') && ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == '' )) {
From 7736cad4efa27ec764365b17e214e3cb9f0b2e1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:47:01 +0200
Subject: [PATCH 07/29] Use count instead of sizeof
---
libraries/server_synchronize.lib.php | 180 +++++++++++++--------------
1 file changed, 90 insertions(+), 90 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 389ed150f0..0507177ead 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -28,9 +28,9 @@ if (! defined('PHPMYADMIN')) {
function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables,
&$uncommon_source_tables
) {
- for ($k=0; $k< sizeof($src_tables); $k++) {
+ for ($k=0; $k< count($src_tables); $k++) {
$present_in_target = false;
- for ($l=0; $l < sizeof($trg_tables); $l++) {
+ for ($l=0; $l < count($trg_tables); $l++) {
if ($src_tables[$k] === $trg_tables[$l]) {
$present_in_target = true;
$matching_tables[] = $src_tables[$k];
@@ -57,9 +57,9 @@ function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables,
function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables,
&$uncommon_target_tables
) {
- for ($c=0; $c 1) {
- for ($k=0; $k < sizeof($is_key); $k++) {
+ } elseif (count($is_key) > 1) {
+ for ($k=0; $k < count($is_key); $k++) {
$trg_select_query .= PMA_backquote($is_key[$k])
. "='" . $source_result_set[$j][$is_key[$k]] . "'";
- if ($k < (sizeof($is_key)-1)) {
+ if ($k < (count($is_key)-1)) {
$trg_select_query .= " AND ";
}
}
@@ -185,14 +185,14 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
. PMA_backquote($matching_table[$matching_table_index])
. " WHERE ";
- if (sizeof($is_key) == 1) {
+ if (count($is_key) == 1) {
$src_select_query .= PMA_backquote($is_key[0])
. "='" . $source_result_set[$j] . "'";
- } elseif (sizeof($is_key) > 1) {
- for ($k=0; $k< sizeof($is_key); $k++) {
+ } elseif (count($is_key) > 1) {
+ for ($k=0; $k< count($is_key); $k++) {
$src_select_query .= PMA_backquote($is_key[$k])
. "='" . $source_result_set[$j][$is_key[$k]] . "'";
- if ($k < (sizeof($is_key) - 1)) {
+ if ($k < (count($is_key) - 1)) {
$src_select_query .= " AND ";
}
}
@@ -210,12 +210,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
if (isset($src_result_set[0][$fld[$m]])) {
if (isset($target_result_set[0][$fld[$m]])) {
if (($src_result_set[0][$fld[$m]] != $target_result_set[0][$fld[$m]]) && (! (in_array($fld[$m], $is_key)))) {
- if (sizeof($is_key) == 1) {
+ if (count($is_key) == 1) {
if ($source_result_set[$j]) {
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
- for ($n=0; $n < sizeof($is_key); $n++) {
+ } elseif (count($is_key) > 1) {
+ for ($n=0; $n < count($is_key); $n++) {
if (isset($src_result_set[0][$is_key[$n]])) {
$update_array[$matching_table_index][$update_row][$is_key[$n]] = $src_result_set[0][$is_key[$n]];
}
@@ -233,12 +233,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
$update_row++;
}
} else {
- if (sizeof($is_key) == 1) {
+ if (count($is_key) == 1) {
if ($source_result_set[$j]) {
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
- for ($n = 0; $n < sizeof($is_key); $n++) {
+ } elseif (count($is_key) > 1) {
+ for ($n = 0; $n < count($is_key); $n++) {
if (isset($src_result_set[0][$is_key[$n]])) {
$update_array[$matching_table_index][$update_row][$is_key[$n]] = $src_result_set[0][$is_key[$n]];
}
@@ -287,12 +287,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
* Placing the primary key, and the value of primary key of the
* row that is to be inserted in the target table
*/
- if (sizeof($is_key) == 1) {
+ if (count($is_key) == 1) {
if (isset($source_result_set[$j])) {
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
- for ($l = 0; $l < sizeof($is_key); $l++) {
+ } elseif (count($is_key) > 1) {
+ for ($l = 0; $l < count($is_key); $l++) {
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
}
@@ -307,12 +307,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
* condition is met when there is an additional column in the
* source table
*/
- if (sizeof($is_key) == 1) {
+ if (count($is_key) == 1) {
if (isset($source_result_set[$j])) {
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
- for ($l = 0; $l < sizeof($is_key); $l++) {
+ } elseif (count($is_key) > 1) {
+ for ($l = 0; $l < count($is_key); $l++) {
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
}
@@ -349,7 +349,7 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
$source_key_values = PMA_getColumnValues($src_db, $matching_table[$matching_table_index], $src_keys[$matching_table_index], $src_link);
}
$all_keys_match = 1;
- for ($a = 0; $a < sizeof($trg_keys[$matching_table_index]); $a++) {
+ for ($a = 0; $a < count($trg_keys[$matching_table_index]); $a++) {
if (isset($trg_keys[$matching_table_index][$a])) {
if (! (in_array($trg_keys[$matching_table_index][$a], $src_keys[$matching_table_index]))) {
$all_keys_match = 0;
@@ -362,24 +362,24 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
}
}
if (isset($trg_keys[$matching_table_index])) {
- if ((sizeof($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
+ if ((count($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
$row = 0;
if (isset($target_key_values)) {
- for ($i = 0; $i < sizeof($target_key_values); $i++) {
+ for ($i = 0; $i < count($target_key_values); $i++) {
if (! (in_array($target_key_values[$i], $source_key_values))) {
$delete_array[$matching_table_index][$row] = $target_key_values[$i];
$row++;
}
}
}
- } elseif ((sizeof($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {
+ } elseif ((count($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {
$row = 0;
if (isset($target_key_values)) {
- for ($i = 0; $i < sizeof($target_key_values); $i++) {
+ for ($i = 0; $i < count($target_key_values); $i++) {
$is_present = false;
- for ($j = 0; $j < sizeof($source_key_values) && ($is_present == false) ; $j++) {
+ for ($j = 0; $j < count($source_key_values) && ($is_present == false) ; $j++) {
$check = true;
- for ($k = 0; $k < sizeof($trg_keys[$matching_table_index]); $k++) {
+ for ($k = 0; $k < count($trg_keys[$matching_table_index]); $k++) {
if ($target_key_values[$i][$trg_keys[$matching_table_index][$k]] != $source_key_values[$j][$trg_keys[$matching_table_index][$k]]) {
$check = false;
}
@@ -389,7 +389,7 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table,
}
}
if (! ($is_present)) {
- for ($l = 0; $l < sizeof($trg_keys[$matching_table_index]); $l++) {
+ for ($l = 0; $l < count($trg_keys[$matching_table_index]); $l++) {
$delete_array[$matching_table_index][$row][$trg_keys[$matching_table_index][$l]] = $target_key_values[$i][$trg_keys[$matching_table_index][$l]];
}
$row++;
@@ -444,12 +444,12 @@ function PMA_updateTargetTables(
$trg_link, $matching_table_index, $matching_table_keys, $display
) {
if (isset($update_array[$matching_table_index])) {
- if (sizeof($update_array[$matching_table_index])) {
+ if (count($update_array[$matching_table_index])) {
- for ($update_row = 0; $update_row < sizeof($update_array[$matching_table_index]); $update_row++) {
+ for ($update_row = 0; $update_row < count($update_array[$matching_table_index]); $update_row++) {
if (isset($update_array[$matching_table_index][$update_row])) {
- $update_fields_num = sizeof($update_array[$matching_table_index][$update_row])-sizeof($matching_table_keys[$matching_table_index]);
+ $update_fields_num = count($update_array[$matching_table_index][$update_row])-count($matching_table_keys[$matching_table_index]);
if ($update_fields_num > 0) {
$query = "UPDATE " . PMA_backquote($trg_db) . "." .PMA_backquote($table[$matching_table_index]) . " SET ";
@@ -463,11 +463,11 @@ function PMA_updateTargetTables(
}
$query .= " WHERE ";
if (isset($matching_table_keys[$matching_table_index])) {
- for ($key = 0; $key < sizeof($matching_table_keys[$matching_table_index]); $key++) {
+ for ($key = 0; $key < count($matching_table_keys[$matching_table_index]); $key++) {
if (isset($matching_table_keys[$matching_table_index][$key])) {
$query .= PMA_backquote($matching_table_keys[$matching_table_index][$key]) . "='" . $update_array[$matching_table_index][$update_row][$matching_table_keys[$matching_table_index][$key]] . "'";
}
- if ($key < (sizeof($matching_table_keys[$matching_table_index]) - 1)) {
+ if ($key < (count($matching_table_keys[$matching_table_index]) - 1)) {
$query .= " AND ";
}
}
@@ -539,16 +539,16 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
&$alter_indexes_array, &$delete_array, &$update_array, $display
) {
if (isset($array_insert[$matching_table_index])) {
- if (sizeof($array_insert[$matching_table_index])) {
- for ($insert_row = 0; $insert_row< sizeof($array_insert[$matching_table_index]); $insert_row++) {
+ if (count($array_insert[$matching_table_index])) {
+ for ($insert_row = 0; $insert_row< count($array_insert[$matching_table_index]); $insert_row++) {
if (isset($array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][0]])) {
$select_query = "SELECT * FROM " . PMA_backquote($src_db) . "." . PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
- for ($i = 0; $i < sizeof($matching_tables_keys[$matching_table_index]); $i++) {
+ for ($i = 0; $i < count($matching_tables_keys[$matching_table_index]); $i++) {
$select_query .= $matching_tables_keys[$matching_table_index][$i] . "='";
$select_query .= $array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][$i]] . "'" ;
- if ($i < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
+ if ($i < (count($matching_tables_keys[$matching_table_index]) - 1)) {
$select_query.= " AND ";
}
}
@@ -556,7 +556,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
$result = PMA_DBI_fetch_result($select_query, null, null, $src_link);
$insert_query = "INSERT INTO " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_table[$matching_table_index]) ." (";
- for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++) {
+ for ($field_index = 0; $field_index < count($table_fields[$matching_table_index]); $field_index++) {
$insert_query .= PMA_backquote($table_fields[$matching_table_index][$field_index]);
$is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db ."'
@@ -564,8 +564,8 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
$table_fields[$matching_table_index][$field_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $trg_link);
- if (sizeof($is_fk_result) > 0) {
- for ($j = 0; $j < sizeof($is_fk_result); $j++) {
+ if (count($is_fk_result) > 0) {
+ for ($j = 0; $j < count($is_fk_result); $j++) {
$table_index = array_keys($matching_table, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
if (isset($alter_str_array[$table_index[0]])) {
@@ -627,21 +627,21 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
}
}
}
- if ($field_index < sizeof($table_fields[$matching_table_index])-1) {
+ if ($field_index < count($table_fields[$matching_table_index])-1) {
$insert_query .= ", ";
}
}
$insert_query .= ") VALUES(";
- if (sizeof($table_fields[$matching_table_index]) == 1) {
+ if (count($table_fields[$matching_table_index]) == 1) {
$insert_query .= "'" . PMA_sqlAddSlashes($result[0]) . "'";
} else {
- for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++) {
+ for ($field_index = 0; $field_index < count($table_fields[$matching_table_index]); $field_index++) {
if (isset($result[0][$table_fields[$matching_table_index][$field_index]])) {
$insert_query .= "'" . PMA_sqlAddSlashes($result[0][$table_fields[$matching_table_index][$field_index]]) . "'";
} else {
$insert_query .= "'NULL'";
}
- if ($field_index < (sizeof($table_fields[$matching_table_index])) - 1) {
+ if ($field_index < (count($table_fields[$matching_table_index])) - 1) {
$insert_query .= " ," ;
}
}
@@ -699,8 +699,8 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
AND TABLE_NAME = '" . $uncommon_tables[$table_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
- if (sizeof($is_fk_result) > 0) {
- for ($j = 0; $j < sizeof($is_fk_result); $j++) {
+ if (count($is_fk_result) > 0) {
+ for ($j = 0; $j < count($is_fk_result); $j++) {
if (in_array($is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
@@ -783,18 +783,18 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link,
function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables,
$table_index, $target_tables_keys, $delete_array, $display
) {
- for ($i = 0; $i < sizeof($delete_array[$table_index]); $i++) {
+ for ($i = 0; $i < count($delete_array[$table_index]); $i++) {
if (isset($target_tables_keys[$table_index])) {
$delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
- for ($y = 0; $y < sizeof($target_tables_keys[$table_index]); $y++) {
+ for ($y = 0; $y < count($target_tables_keys[$table_index]); $y++) {
$delete_query .= PMA_backquote($target_tables_keys[$table_index][$y]) . " = '";
- if (sizeof($target_tables_keys[$table_index]) == 1) {
+ if (count($target_tables_keys[$table_index]) == 1) {
$delete_query .= $delete_array[$table_index][$i] . "'";
- } elseif (sizeof($target_tables_keys[$table_index]) > 1) {
+ } elseif (count($target_tables_keys[$table_index]) > 1) {
$delete_query .= $delete_array[$table_index][$i][$target_tables_keys[$table_index][$y]] . "'";
}
- if ($y < (sizeof($target_tables_keys[$table_index]) - 1)) {
+ if ($y < (count($target_tables_keys[$table_index]) - 1)) {
$delete_query .= ' AND ';
}
$pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
@@ -802,7 +802,7 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables,
. $target_tables_keys[$table_index][$y] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
- $result_size = sizeof($pk_query_result);
+ $result_size = count($pk_query_result);
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
@@ -890,7 +890,7 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link,
if (isset($target_columns[$matching_table_index][$column_name]['Field'])) {
//If column exists in target table then matches criteria like type,
// null, collation, key, default, comment of the column
- for ($i = 0; $i < sizeof($criteria); $i++) {
+ for ($i = 0; $i < count($criteria); $i++) {
if ($source_columns[$matching_table_index][$column_name][$criteria[$i]] != $target_columns[$matching_table_index][$column_name][$criteria[$i]]) {
if (($criteria[$i] == 'Default') && ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == '' )) {
$alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';
@@ -956,7 +956,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
$criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,
&$uncommon_tables_fields, $table_counter, $uncommon_cols, $display
) {
- for ($i = 0; $i < sizeof($matching_tables_fields[$table_counter]); $i++) {
+ for ($i = 0; $i < count($matching_tables_fields[$table_counter]); $i++) {
if (isset($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]])) {
$query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$table_counter]). " ADD COLUMN " .
PMA_backquote($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]]) . " " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Type'];
@@ -976,7 +976,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
$query .= " COMMENT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'];
}
if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Key'] == 'PRI' ) {
- $trg_key_size = sizeof($target_tables_keys[$table_counter]);
+ $trg_key_size = count($target_tables_keys[$table_counter]);
if ($trg_key_size) {
$check = true;
for ($a = 0; ($a < $trg_key_size) && ($check); $a++) {
@@ -989,9 +989,9 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
}
}
$query .= " , ADD PRIMARY KEY (";
- for ($t = 0; $t < sizeof($matching_tables_keys[$table_counter]); $t++) {
+ for ($t = 0; $t < count($matching_tables_keys[$table_counter]); $t++) {
$query .= PMA_backquote($matching_tables_keys[$table_counter][$t]);
- if ($t < (sizeof($matching_tables_keys[$table_counter]) - 1)) {
+ if ($t < (count($matching_tables_keys[$table_counter]) - 1)) {
$query .= " , " ;
}
}
@@ -1053,8 +1053,8 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link,
AND TABLE_NAME = '" . $referenced_table . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
- if (sizeof($is_fk_result) > 0) {
- for ($j = 0; $j < sizeof($is_fk_result); $j++) {
+ if (count($is_fk_result) > 0) {
+ for ($j = 0; $j < count($is_fk_result); $j++) {
if (in_array($is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
PMA_checkForeignKeys(
@@ -1096,7 +1096,7 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
$found = false;
//Checks if the criteria to be altered is primary key
- for ($v = 0; $v < sizeof($matching_tables_fields[$matching_table_index]); $v++) {
+ for ($v = 0; $v < count($matching_tables_fields[$matching_table_index]); $v++) {
if (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$v]]['Key'])) {
if ($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$v]]['Key'] == 'PRI' ) {
$check = false;
@@ -1107,13 +1107,13 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
$pri_query = null;
if (! $check) {
$pri_query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]);
- if (sizeof($target_tables_keys[$matching_table_index]) > 0) {
+ if (count($target_tables_keys[$matching_table_index]) > 0) {
$pri_query .= " DROP PRIMARY KEY ," ;
}
$pri_query .= " ADD PRIMARY KEY (";
- for ($z = 0; $z < sizeof($matching_tables_keys[$matching_table_index]); $z++) {
+ for ($z = 0; $z < count($matching_tables_keys[$matching_table_index]); $z++) {
$pri_query .= PMA_backquote($matching_tables_keys[$matching_table_index][$z]);
- if ($z < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
+ if ($z < (count($matching_tables_keys[$matching_table_index]) - 1)) {
$pri_query .= " , " ;
}
}
@@ -1126,12 +1126,12 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
}
PMA_DBI_try_query($pri_query, $trg_link, 0);
}
- for ($t = 0; $t < sizeof($matching_tables_fields[$matching_table_index]); $t++) {
- if ((isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]])) && (sizeof($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]) > 0)) {
+ for ($t = 0; $t < count($matching_tables_fields[$matching_table_index]); $t++) {
+ if ((isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]])) && (count($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]) > 0)) {
$sql_query = 'ALTER TABLE ' . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]) . ' MODIFY ' .
PMA_backquote($matching_tables_fields[$matching_table_index][$t]) . ' ' . $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'];
$found = false;
- for ($i = 0; $i < sizeof($criteria); $i++) {
+ for ($i = 0; $i < count($criteria); $i++) {
if (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]]) && $criteria[$i] != 'Key') {
$found = true;
if (($criteria[$i] == 'Type') && (! isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i+1]]))) {
@@ -1190,12 +1190,12 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables,
$check = false;
$query = "ALTER TABLE " . PMA_backquote($trg_db) . '.'
. PMA_backquote($matching_tables[$matching_table_index]);
- for ($p = 0; $p < sizeof($matching_tables_keys[$matching_table_index]); $p++) {
+ for ($p = 0; $p < count($matching_tables_keys[$matching_table_index]); $p++) {
if ((isset($alter_str_array[$matching_table_index][$matching_tables_keys[$matching_table_index][$p]]['Key']))) {
$check = true;
$query .= ' MODIFY ' . PMA_backquote($matching_tables_keys[$matching_table_index][$p]) . ' '
. $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$p]]['Type'] . ' Not Null ';
- if ($p < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
+ if ($p < (count($matching_tables_keys[$matching_table_index]) - 1)) {
$query .= ', ';
}
}
@@ -1229,14 +1229,14 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
if (isset($uncommon_columns[$table_counter])) {
$drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "."
. PMA_backquote($matching_tables[$table_counter]);
- for ($a = 0; $a < sizeof($uncommon_columns[$table_counter]); $a++) {
+ for ($a = 0; $a < count($uncommon_columns[$table_counter]); $a++) {
//Checks if column to be removed is a foreign key in any table
$pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
AND REFERENCED_TABLE_NAME = '" . $matching_tables[$table_counter]."' AND REFERENCED_COLUMN_NAME = '"
. $uncommon_columns[$table_counter][$a] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
- $result_size = sizeof($pk_query_result);
+ $result_size = count($pk_query_result);
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
@@ -1251,11 +1251,11 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
$result = PMA_DBI_fetch_result($query, null, null, $trg_link);
- if (sizeof($result) > 0) {
+ if (count($result) > 0) {
$drop_query .= " DROP FOREIGN KEY " . PMA_backquote($result[0]['CONSTRAINT_NAME']) . ",";
}
$drop_query .= " DROP COLUMN " . PMA_backquote($uncommon_columns[$table_counter][$a]);
- if ($a < (sizeof($uncommon_columns[$table_counter]) - 1)) {
+ if ($a < (count($uncommon_columns[$table_counter]) - 1)) {
$drop_query .= " , " ;
}
}
@@ -1298,14 +1298,14 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link,
//Gets indexes information for source and target table
$source_indexes[$table_counter] = PMA_DBI_get_table_indexes($src_db, $matching_tables[$table_counter], $src_link);
$target_indexes[$table_counter] = PMA_DBI_get_table_indexes($trg_db, $matching_tables[$table_counter], $trg_link);
- for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
+ for ($a = 0; $a < count($source_indexes[$table_counter]); $a++) {
$found = false;
$z = 0;
//Compares key name and non_unique characteristic of source indexes with target indexes
/*
* @todo compare the length of each sub part
*/
- while (($z <= sizeof($target_indexes[$table_counter])) && ($found == false)) {
+ while (($z <= count($target_indexes[$table_counter])) && ($found == false)) {
if (isset($source_indexes[$table_counter][$a]) && isset($target_indexes[$table_counter][$z]) && $source_indexes[$table_counter][$a]['Key_name'] == $target_indexes[$table_counter][$z]['Key_name']) {
$found = true;
if (($source_indexes[$table_counter][$a]['Column_name'] != $target_indexes[$table_counter][$z]['Column_name']) || ($source_indexes[$table_counter][$a]['Non_unique'] != $target_indexes[$table_counter][$z]['Non_unique'])) {
@@ -1324,10 +1324,10 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link,
}
//Finds indexes that exist on target table but not on source table
- for ($b = 0; $b < sizeof($target_indexes[$table_counter]); $b++) {
+ for ($b = 0; $b < count($target_indexes[$table_counter]); $b++) {
$found = false;
$c = 0;
- while (($c <= sizeof($source_indexes[$table_counter])) && ($found == false)) {
+ while (($c <= count($source_indexes[$table_counter])) && ($found == false)) {
if ($target_indexes[$table_counter][$b]['Column_name'] == $source_indexes[$table_counter][$c]['Column_name']) {
$found = true;
}
@@ -1365,9 +1365,9 @@ function PMA_applyIndexesDiff($trg_db, $trg_link, $matching_tables, $source_inde
//Adds indexes on target table
if (isset($add_indexes_array[$table_counter])) {
$sql = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]) . " ADD" ;
- for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
+ for ($a = 0; $a < count($source_indexes[$table_counter]); $a++) {
if (isset($add_indexes_array[$table_counter][$a])) {
- for ($b = 0; $b < sizeof($source_indexes[$table_counter]); $b++) {
+ for ($b = 0; $b < count($source_indexes[$table_counter]); $b++) {
if ($source_indexes[$table_counter][$b]['Column_name'] == $add_indexes_array[$table_counter][$a]) {
if ($source_indexes[$table_counter][$b]['Non_unique'] == '0') {
$sql .= " UNIQUE ";
@@ -1386,11 +1386,11 @@ function PMA_applyIndexesDiff($trg_db, $trg_link, $matching_tables, $source_inde
if (isset($alter_indexes_array[$table_counter])) {
$query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
- for ($a = 0; $a < sizeof($alter_indexes_array[$table_counter]); $a++) {
+ for ($a = 0; $a < count($alter_indexes_array[$table_counter]); $a++) {
if (isset($alter_indexes_array[$table_counter][$a])) {
$query .= ' DROP INDEX ' . PMA_backquote($alter_indexes_array[$table_counter][$a]) . " , ADD ";
$got_first_index_column = false;
- for ($z = 0; $z < sizeof($source_indexes[$table_counter]); $z++) {
+ for ($z = 0; $z < count($source_indexes[$table_counter]); $z++) {
if ($source_indexes[$table_counter][$z]['Key_name'] == $alter_indexes_array[$table_counter][$a]) {
if (! $got_first_index_column) {
if ($source_indexes[$table_counter][$z]['Non_unique'] == '0') {
@@ -1416,11 +1416,11 @@ function PMA_applyIndexesDiff($trg_db, $trg_link, $matching_tables, $source_inde
//Removes indexes from target table
if (isset($remove_indexes_array[$table_counter])) {
$drop_index_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
- for ($a = 0; $a < sizeof($target_indexes[$table_counter]); $a++) {
+ for ($a = 0; $a < count($target_indexes[$table_counter]); $a++) {
if (isset($remove_indexes_array[$table_counter][$a])) {
$drop_index_query .= " DROP INDEX " . PMA_backquote($remove_indexes_array[$table_counter][$a]);
}
- if ($a < (sizeof($remove_indexes_array[$table_counter]) - 1)) {
+ if ($a < (count($remove_indexes_array[$table_counter]) - 1)) {
$drop_index_query .= " , " ;
}
}
@@ -1543,9 +1543,9 @@ function PMA_syncDisplayDataCompare($rows)
function PMA_getColumnValues($database, $table, $column, $link = null)
{
$query = 'SELECT ';
- for ($i=0; $i< sizeof($column); $i++) {
+ for ($i=0; $i< count($column); $i++) {
$query.= PMA_backquote($column[$i]);
- if ($i < (sizeof($column)-1)) {
+ if ($i < (count($column)-1)) {
$query.= ', ';
}
}
From d28ac79fc375a133149c009d19c97116b94423c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:47:29 +0200
Subject: [PATCH 08/29] Coding style improvement
---
libraries/server_synchronize.lib.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 0507177ead..21d05fabb0 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -1543,7 +1543,7 @@ function PMA_syncDisplayDataCompare($rows)
function PMA_getColumnValues($database, $table, $column, $link = null)
{
$query = 'SELECT ';
- for ($i=0; $i< count($column); $i++) {
+ for ($i = 0; $i < count($column); $i++) {
$query.= PMA_backquote($column[$i]);
if ($i < (count($column)-1)) {
$query.= ', ';
From 234e432323dbc677e2fd6243db3cf226be5d056e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:48:16 +0200
Subject: [PATCH 09/29] Reformat comments
---
libraries/server_synchronize.lib.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 21d05fabb0..b3098ca781 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -1004,15 +1004,16 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link,
}
PMA_DBI_try_query($query, $trg_link, 0);
- //Checks if column to be added is a foreign key or not
+ // Checks if column to be added is a foreign key or not
$is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
. $matching_tables[$table_counter] . "' AND COLUMN_NAME ='" . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] .
"' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
- //If column is a foreign key then it is checked that referenced table exist in target db. If referenced table does not exist in target db then
- //it is created first.
+ // If column is a foreign key then it is checked that referenced table
+ // exist in target db. If referenced table does not exist in target
+ // db then it is created first.
if (isset($is_fk_result)) {
if (in_array($is_fk_result[0]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
$table_index = array_keys($uncommon_tables, $is_fk_result[0]['REFERENCED_TABLE_NAME']);
From 5139585b6cf959eba075d25cc4ca9970790a8dfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 16:51:56 +0200
Subject: [PATCH 10/29] Wrap some function calls
---
libraries/server_synchronize.lib.php | 93 +++++++++++++++++++++-------
1 file changed, 72 insertions(+), 21 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index b3098ca781..c1349ef74c 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -176,7 +176,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
}
}
- $target_result_set = PMA_DBI_fetch_result($trg_select_query, null, null, $trg_link);
+ $target_result_set = PMA_DBI_fetch_result(
+ $trg_select_query,
+ null,
+ null,
+ $trg_link
+ );
if ($target_result_set) {
// Fetch the row from the source server to do a comparison
@@ -198,7 +203,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link,
}
}
- $src_result_set = PMA_DBI_fetch_result($src_select_query, null, null, $src_link);
+ $src_result_set = PMA_DBI_fetch_result(
+ $src_select_query,
+ null,
+ null,
+ $src_link
+ );
/**
* Comparing each corresponding field of the source and target
@@ -570,29 +580,46 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
if (isset($alter_str_array[$table_index[0]])) {
PMA_alterTargetTableStructure(
- $trg_db, $trg_link, $matching_tables, $source_columns, $alter_str_array, $matching_tables_fields,
- $criteria, $matching_tables_keys, $target_tables_keys, $table_index[0], $display
+ $trg_db, $trg_link, $matching_tables,
+ $source_columns, $alter_str_array,
+ $matching_tables_fields,
+ $criteria, $matching_tables_keys,
+ $target_tables_keys, $table_index[0],
+ $display
);
unset($alter_str_array[$table_index[0]]);
}
if (isset($uncommon_columns[$table_index[0]])) {
- PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_index[0], $display);
+ PMA_removeColumnsFromTargetTable(
+ $trg_db, $trg_link, $matching_tables,
+ $uncommon_columns, $table_index[0], $display
+ );
unset($uncommon_columns[$table_index[0]]);
}
if (isset($add_column_array[$table_index[0]])) {
PMA_findDeleteRowsFromTargetTables(
- $delete_array, $matching_tables, $table_index[0], $target_tables_keys,
- $matching_tables_keys, $trg_db, $trg_link, $src_db, $src_link
+ $delete_array, $matching_tables,
+ $table_index[0], $target_tables_keys,
+ $matching_tables_keys, $trg_db,
+ $trg_link, $src_db, $src_link
);
if (isset($delete_array[$table_index[0]])) {
- PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index[0], $target_tables_keys, $delete_array, $display);
+ PMA_deleteFromTargetTable(
+ $trg_db, $trg_link, $matching_tables,
+ $table_index[0], $target_tables_keys,
+ $delete_array, $display
+ );
unset($delete_array[$table_index[0]]);
}
PMA_addColumnsInTargetTable(
- $src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_columns, $add_column_array,
- $matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,
- $uncommon_tables_fields, $table_index[0], $uncommon_cols, $display
+ $src_db, $trg_db, $src_link, $trg_link,
+ $matching_tables, $source_columns,
+ $add_column_array, $matching_tables_fields,
+ $criteria, $matching_tables_keys,
+ $target_tables_keys, $uncommon_tables,
+ $uncommon_tables_fields, $table_index[0],
+ $uncommon_cols, $display
);
unset($add_column_array[$table_index[0]]);
}
@@ -601,8 +628,11 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|| isset($alter_indexes_array[$table_index[0]])
) {
PMA_applyIndexesDiff(
- $trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array,
- $alter_indexes_array, $remove_indexes_array, $table_index[0], $display
+ $trg_db, $trg_link, $matching_tables,
+ $source_indexes, $target_indexes,
+ $add_indexes_array, $alter_indexes_array,
+ $remove_indexes_array, $table_index[0],
+ $display
);
unset($add_indexes_array[$table_index[0]]);
@@ -611,17 +641,26 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
}
if (isset($update_array[$table_index[0]])) {
PMA_updateTargetTables(
- $matching_tables, $update_array, $src_db, $trg_db, $trg_link,
- $table_index[0], $matching_table_keys, $display
+ $matching_tables, $update_array,
+ $src_db, $trg_db, $trg_link,
+ $table_index[0], $matching_table_keys,
+ $display
);
unset($update_array[$table_index[0]]);
}
if (isset($array_insert[$table_index[0]])) {
PMA_insertIntoTargetTable(
- $matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, $array_insert, $table_index[0],
- $matching_tables_keys, $source_columns, $add_column_array, $criteria, $target_tables_keys, $uncommon_tables,
- $uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes, $target_indexes, $add_indexes_array,
- $alter_indexes_array, $delete_array, $update_array, $display
+ $matching_table, $src_db, $trg_db,
+ $src_link, $trg_link, $table_fields,
+ $array_insert, $table_index[0],
+ $matching_tables_keys, $source_columns,
+ $add_column_array, $criteria,
+ $target_tables_keys, $uncommon_tables,
+ $uncommon_tables_fields, $uncommon_cols,
+ $alter_str_array, $source_indexes,
+ $target_indexes, $add_indexes_array,
+ $alter_indexes_array, $delete_array,
+ $update_array, $display
);
unset($array_insert[$table_index[0]]);
}
@@ -677,7 +716,13 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
&$uncommon_tables, $table_index, &$uncommon_tables_fields, $display
) {
if (isset($uncommon_tables[$table_index])) {
- $fields_result = PMA_DBI_get_columns($src_db, $uncommon_tables[$table_index], null, true, $src_link);
+ $fields_result = PMA_DBI_get_columns(
+ $src_db,
+ $uncommon_tables[$table_index],
+ null,
+ true,
+ $src_link
+ );
$fields = array();
foreach ($fields_result as $each_field) {
$field_name = $each_field['Field'];
@@ -685,7 +730,13 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link,
}
$uncommon_tables_fields[$table_index] = $fields;
- $Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
+ $Create_Query = PMA_DBI_fetch_value(
+ "SHOW CREATE TABLE " . PMA_backquote($src_db) . '.'
+ . PMA_backquote($uncommon_tables[$table_index]),
+ 0,
+ 1,
+ $src_link
+ );
// Replace the src table name with a `dbname`.`tablename`
$Create_Table_Query = preg_replace(
From 37c289adcaf07e549957b402713a6bcc7c470803 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 17:01:37 +0200
Subject: [PATCH 11/29] Allow to specify file name to getImgPath
---
libraries/Theme.class.php | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php
index d0eccf7828..818e1d1420 100644
--- a/libraries/Theme.class.php
+++ b/libraries/Theme.class.php
@@ -303,12 +303,18 @@ class PMA_Theme
/**
* Returns the path to images for the theme
*
+ * @param string $file file name for image
+ *
* @access public
* @return string image path for this theme
*/
- public function getImgPath()
+ public function getImgPath($file = null)
{
- return $this->img_path;
+ if (is_null($file) {
+ return $this->img_path;
+ } else {
+ return $this->img_path . $file;
+ }
}
/**
From 39df7de25b6e1e266e86727abcc7ce4630ffb56a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 17:05:42 +0200
Subject: [PATCH 12/29] Whitespace cleanup
---
libraries/config.default.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libraries/config.default.php b/libraries/config.default.php
index ba0e9e1e35..5ec68f017d 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -518,9 +518,9 @@ $cfg['Servers'][$i]['tracking_add_drop_table'] = true;
$cfg['Servers'][$i]['tracking_add_drop_database'] = true;
/**
- * Enables caching of TABLE STATUS outputs for specific databases on this server
- * (in some cases TABLE STATUS can be very slow, so you may want to cache it).
- * APC is used (if the PHP extension is available, if not, this setting is ignored
+ * Enables caching of TABLE STATUS outputs for specific databases on this server
+ * (in some cases TABLE STATUS can be very slow, so you may want to cache it).
+ * APC is used (if the PHP extension is available, if not, this setting is ignored
* silently). You have to provide StatusCacheLifetime.
* Takes effect only if DisableIS is true.
*
From 4cf1d610cd494558ac5147671a90c25d4371d897 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 17:06:46 +0200
Subject: [PATCH 13/29] Fallback to fallback theme for images not found in
existing
---
libraries/Theme.class.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php
index 818e1d1420..6435550324 100644
--- a/libraries/Theme.class.php
+++ b/libraries/Theme.class.php
@@ -313,7 +313,11 @@ class PMA_Theme
if (is_null($file) {
return $this->img_path;
} else {
- return $this->img_path . $file;
+ if (is_readable($this->img_path . $file)) {
+ return $this->img_path . $file;
+ } else {
+ return $GLOBALS['cfg']['ThemePath'] . '/' . PMA_Theme_Manager::FALLBACK_THEME . '/img/' . $file;
+ }
}
}
From e4f3bfd40482e4389ba34ad7052ac13149aac35d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 17:07:45 +0200
Subject: [PATCH 14/29] Use new syntax for loading pmd images
---
themes/pmahomme/css/pmd.css.php | 46 ++++++++++++++++-----------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/themes/pmahomme/css/pmd.css.php b/themes/pmahomme/css/pmd.css.php
index df192ffe5e..30c4736359 100644
--- a/themes/pmahomme/css/pmd.css.php
+++ b/themes/pmahomme/css/pmd.css.php
@@ -44,7 +44,7 @@ canvas.pmd * {
}
.tab_zag {
- background-image: url(getImgPath(); ?>pmd/Header.png);
+ background-image: url(getImgPath('pmd/Header.png'); ?>);
background-repeat: repeat-x;
text-align: center;
cursor: move;
@@ -53,7 +53,7 @@ canvas.pmd * {
}
.tab_zag_2 {
- background-image: url(getImgPath(); ?>pmd/Header_Linked.png);
+ background-image: url(getImgPath('pmd/Header_Linked.png'); ?>);
background-repeat: repeat-x;
text-align: center;
cursor: move;
@@ -108,7 +108,7 @@ canvas.pmd * {
margin-left: 2px;
text-align: left;
background-color: #fff;
- background-image: url(getImgPath(); ?>pmd/left_panel_butt.png);
+ background-image: url(getImgPath('pmd/left_panel_butt.png'); ?>);
border: #ccc solid 1px;
}
@@ -142,7 +142,7 @@ canvas.pmd * {
cursor: default;
width: 1px;
color: #000;
- background-image: url(getImgPath(); ?>pmd/Header.png);
+ background-image: url(getImgPath('pmd/Header.png'); ?>);
background-repeat: repeat-x;
}
@@ -150,7 +150,7 @@ canvas.pmd * {
vertical-align: top;
background-color: #0064ea;
color: #fff;
- background-image: url(getImgPath(); ?>pmd/small_tab.png);
+ background-image: url(getImgPath('pmd/small_tab.png'); ?>);
cursor: default;
text-align: center;
font-weight: bold;
@@ -174,7 +174,7 @@ canvas.pmd * {
}
.small_tab_pref {
- background-image: url(getImgPath(); ?>pmd/Header.png);
+ background-image: url(getImgPath('pmd/Header.png'); ?>);
background-repeat: repeat-x;
text-align: center;
width: 1px;
@@ -226,35 +226,35 @@ canvas.pmd * {
}
.frams1 {
- background: url(getImgPath(); ?>pmd/1.png) no-repeat right bottom;
+ background: url(getImgPath('pmd/1.png'); ?>) no-repeat right bottom;
}
.frams2 {
- background: url(getImgPath(); ?>pmd/2.png) no-repeat left bottom;
+ background: url(getImgPath('pmd/2.png'); ?>) no-repeat left bottom;
}
.frams3 {
- background: url(getImgPath(); ?>pmd/3.png) no-repeat left top;
+ background: url(getImgPath('pmd/3.png'); ?>) no-repeat left top;
}
.frams4 {
- background: url(getImgPath(); ?>pmd/4.png) no-repeat right top;
+ background: url(getImgPath('pmd/4.png'); ?>) no-repeat right top;
}
.frams5 {
- background: url(getImgPath(); ?>pmd/5.png) repeat-x center bottom;
+ background: url(getImgPath('pmd/5.png'); ?>) repeat-x center bottom;
}
.frams6 {
- background: url(getImgPath(); ?>pmd/6.png) repeat-y left;
+ background: url(getImgPath('pmd/6.png'); ?>) repeat-y left;
}
.frams7 {
- background: url(getImgPath(); ?>pmd/7.png) repeat-x top;
+ background: url(getImgPath('pmd/7.png'); ?>) repeat-x top;
}
.frams8 {
- background: url(getImgPath(); ?>pmd/8.png) repeat-y right;
+ background: url(getImgPath('pmd/8.png'); ?>) repeat-y right;
}
#osn_tab {
@@ -270,7 +270,7 @@ canvas.pmd * {
font-weight: bold;
margin: 0;
padding: 0;
- background-image: url(getImgPath(); ?>pmd/top_panel.png);
+ background-image: url(getImgPath('pmd/top_panel.png'); ?>);
background-position: top;
background-repeat: repeat-x;
border-right: #999 solid 1px;
@@ -349,7 +349,7 @@ a.M_butt:hover {
}
#layer_menu_sizer {
- background-image: url(getImgPath(); ?>pmd/resize.png);
+ background-image: url(getImgPath('pmd/resize.png'); ?>);
cursor: nw-resize;
width: 16px;
height: 16px;
@@ -375,7 +375,7 @@ a.trigger {
top: 60px; right: 0;
color: #fff;
padding: 10px 40px 10px 15px;
- background: #333 url(getImgPath(); ?>pmd/plus.png) 85% 55% no-repeat;
+ background: #333 url(getImgPath('pmd/plus.png'); ?>) 85% 55% no-repeat;
border: 1px solid #444;
display: block;
}
@@ -386,18 +386,18 @@ a.trigger:hover {
top: 60px; right: 0;
color: #080808;
padding: 10px 40px 10px 15px;
- background: #fff696 url(getImgPath(); ?>pmd/plus.png) 85% 55% no-repeat;
+ background: #fff696 url(getImgPath('pmd/plus.png'); ?>) 85% 55% no-repeat;
border: 1px solid #999;
display: block;
}
a.active.trigger {
- background: #222 url(getImgPath(); ?>pmd/minus.png) 85% 55% no-repeat;
+ background: #222 url(getImgPath('pmd/minus.png'); ?>) 85% 55% no-repeat;
z-index: 999;
}
a.active.trigger:hover {
- background: #fff696 url(getImgPath(); ?>pmd/minus.png) 85% 55% no-repeat;
+ background: #fff696 url(getImgPath('pmd/minus.png'); ?>) 85% 55% no-repeat;
z-index: 999;
}
@@ -414,7 +414,7 @@ h2.tiger {
}
h2.tiger a {
- background-image: url(getImgPath(); ?>pmd/Header.png);
+ background-image: url(getImgPath('pmd/Header.png'); ?>);
text-align: center;
text-decoration: none;
color : #333;
@@ -423,11 +423,11 @@ h2.tiger a {
h2.tiger a:hover {
color: #000;
- background-image: url(getImgPath(); ?>pmd/Header_Linked.png);
+ background-image: url(getImgPath('pmd/Header_Linked.png'); ?>);
}
h2.active {
- background-image: url(getImgPath(); ?>pmd/Header.png);
+ background-image: url(getImgPath('pmd/Header.png'); ?>);
background-repeat: repeat-x;
padding: 1px;
background-position: left bottom;
From 6b6020c5e88b9d9a00a69e8e34d3bbc0ed160fcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 17:10:25 +0200
Subject: [PATCH 15/29] Fix typo
---
libraries/Theme.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php
index 6435550324..fc7490b673 100644
--- a/libraries/Theme.class.php
+++ b/libraries/Theme.class.php
@@ -310,7 +310,7 @@ class PMA_Theme
*/
public function getImgPath($file = null)
{
- if (is_null($file) {
+ if (is_null($file)) {
return $this->img_path;
} else {
if (is_readable($this->img_path . $file)) {
From 84871f3056cb05f3138436affd3e6c95ed2cff05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?=
Date: Tue, 29 May 2012 17:13:45 +0200
Subject: [PATCH 16/29] Load remaining PMD images using new loader
---
pmd_general.php | 54 ++++++++++++++++++++++++-------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/pmd_general.php b/pmd_general.php
index f9a8c45948..bdc52f376d 100644
--- a/pmd_general.php
+++ b/pmd_general.php
@@ -79,64 +79,64 @@ echo $script_tabs . $script_contr . $script_display_field;
+ alt="v" src="getImgPath('pmd/downarrow2_m.png'); ?>" />


; ?>)

; ?>)

; ?>)

; ?>)


; ?>)
; ?>)



; ?>)
; ?>)
-
+
-
+
-
+

';
- echo '
getImgPath('pmd/query_builder.png') . '" alt="key" width="20" height="20" title="';
echo __('Build Query');
echo '"/>';
}
?>
-
@@ -149,11 +149,11 @@ if (isset($_REQUEST['query'])) {
+ src="getImgPath('pmd/downarrow1.png'); ?>" id='key_HS_all' />
+ src="getImgPath('pmd/downarrow2.png'); ?>" id='key_HS' />