diff options
author | Chanaka Indrajith <pe.chanaka.ck@gmail.com> | 2012-09-16 13:11:47 +0400 |
---|---|---|
committer | Chanaka Indrajith <pe.chanaka.ck@gmail.com> | 2012-09-16 13:11:47 +0400 |
commit | 6971295e9616aa6809ffd58dceb6e6735090f57d (patch) | |
tree | ff5bcbc0be756673415a877706482622ce704c11 | |
parent | e6894be57f5735ab525a2f758ad842aacb8ef7bc (diff) |
Renamed PMA_CommonFunctions::getInstance()-> with PMA_Util::
114 files changed, 291 insertions, 291 deletions
diff --git a/browse_foreigners.php b/browse_foreigners.php index 376a3ca025..f62c3f1f5b 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -11,7 +11,7 @@ require_once 'libraries/transformations.lib.php'; $field = $_REQUEST['field']; -PMA_CommonFunctions::getInstance()->checkParameters(array('db', 'table', 'field')); +PMA_Util::checkParameters(array('db', 'table', 'field')); $response = PMA_Response::getInstance(); $response->getFooter()->setMinimal(); @@ -65,7 +65,7 @@ if (is_array($foreignData['disp_row'])) { $nbTotalPage = @ceil($foreignData['the_total'] / $session_max_rows); if ($foreignData['the_total'] > $GLOBALS['cfg']['MaxRows']) { - $gotopage = PMA_CommonFunctions::getInstance()->pageselector( + $gotopage = PMA_Util::pageselector( $session_max_rows, $pageNow, $nbTotalPage, diff --git a/db_create.php b/db_create.php index fa7bf727e3..199a4db077 100644 --- a/db_create.php +++ b/db_create.php @@ -29,7 +29,7 @@ foreach ($post_params as $one_post_param) { } } -PMA_CommonFunctions::getInstance()->checkParameters(array('new_db')); +PMA_Util::checkParameters(array('new_db')); /** * Defines the url to return to in case of error in a sql statement @@ -39,7 +39,7 @@ $err_url = 'main.php?' . PMA_generate_common_url(); /** * Builds and executes the db creation sql query */ -$sql_query = 'CREATE DATABASE ' . PMA_CommonFunctions::getInstance()->backquote($new_db); +$sql_query = 'CREATE DATABASE ' . PMA_Util::backquote($new_db); if (! empty($db_collation)) { list($db_charset) = explode('_', $db_collation); if (in_array($db_charset, $mysql_charsets) @@ -137,7 +137,7 @@ if (! $result) { $response->addJSON('new_db_string', $new_db_string); $response->addJSON( 'sql_query', - PMA_CommonFunctions::getInstance()->getMessage( + PMA_Util::getMessage( null, $sql_query, 'success' ) ); diff --git a/db_datadict.php b/db_datadict.php index 3ce6d6022d..b03619d492 100644 --- a/db_datadict.php +++ b/db_datadict.php @@ -27,7 +27,7 @@ require_once 'libraries/Index.class.php'; /** * Check parameters */ -PMA_CommonFunctions::getInstance()->checkParameters(array('db')); +PMA_Util::checkParameters(array('db')); /** * Defines the url to return to in case of error in a sql statement @@ -125,8 +125,8 @@ foreach ($tables as $table) { // http://bugs.mysql.com/20910. $show_create_table_query = 'SHOW CREATE TABLE ' - . PMA_CommonFunctions::getInstance()->backquote($db) . '.' - . PMA_CommonFunctions::getInstance()->backquote($table); + . PMA_Util::backquote($db) . '.' + . PMA_Util::backquote($table); $show_create_table = PMA_DBI_fetch_value( $show_create_table_query, 0, 1 ); @@ -186,7 +186,7 @@ foreach ($tables as $table) { $row['Null'] = 'NO'; } $extracted_columnspec - = PMA_CommonFunctions::getInstance()->extractColumnSpec($row['Type']); + = PMA_Util::extractColumnSpec($row['Type']); // reformat mysql query output // set or enum types: slashes single quotes inside options @@ -285,6 +285,6 @@ foreach ($tables as $table) { /** * Displays the footer */ -echo PMA_CommonFunctions::getInstance()->getButton(); +echo PMA_Util::getButton(); ?> diff --git a/db_printview.php b/db_printview.php index ce7a7d0375..e0c2f14234 100644 --- a/db_printview.php +++ b/db_printview.php @@ -35,7 +35,7 @@ $cfgRelation = PMA_getRelationsParam(); // speedup view on locked tables // Special speedup for newer MySQL Versions (in 4.0 format changed) if ($cfg['SkipLockedTables'] == true) { - $result = PMA_DBI_query('SHOW OPEN TABLES FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . ';'); + $result = PMA_DBI_query('SHOW OPEN TABLES FROM ' . PMA_Util::backquote($db) . ';'); // Blending out tables in use if ($result != false && PMA_DBI_num_rows($result) > 0) { while ($tmp = PMA_DBI_fetch_row($result)) { @@ -47,11 +47,11 @@ if ($cfg['SkipLockedTables'] == true) { PMA_DBI_free_result($result); if (isset($sot_cache)) { - $result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . ';', null, PMA_DBI_QUERY_STORE); + $result = PMA_DBI_query('SHOW TABLES FROM ' . PMA_Util::backquote($db) . ';', null, PMA_DBI_QUERY_STORE); if ($result != false && PMA_DBI_num_rows($result) > 0) { while ($tmp = PMA_DBI_fetch_row($result)) { if (! isset($sot_cache[$tmp[0]])) { - $sts_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . ' LIKE \'' . sqlAddSlashes($tmp[0], true) . '\';'); + $sts_result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_Util::backquote($db) . ' LIKE \'' . sqlAddSlashes($tmp[0], true) . '\';'); $sts_tmp = PMA_DBI_fetch_assoc($sts_result); $tables[] = $sts_tmp; } else { // table in use @@ -67,7 +67,7 @@ if ($cfg['SkipLockedTables'] == true) { } if (! isset($sot_ready)) { - $result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . ';'); + $result = PMA_DBI_query('SHOW TABLE STATUS FROM ' . PMA_Util::backquote($db) . ';'); if (PMA_DBI_num_rows($result) > 0) { while ($sts_tmp = PMA_DBI_fetch_assoc($result)) { $tables[] = $sts_tmp; diff --git a/db_search.php b/db_search.php index dcb18eb701..01a9992195 100644 --- a/db_search.php +++ b/db_search.php @@ -26,7 +26,7 @@ require 'libraries/db_common.inc.php'; // If config variable $GLOBALS['cfg']['Usedbsearch'] is on false : exit. if (! $GLOBALS['cfg']['UseDbSearch']) { - PMA_CommonFunctions::getInstance()->mysqlDie( + PMA_Util::mysqlDie( __('Access denied'), '', false, $err_url ); } // end if @@ -107,8 +107,8 @@ $response->disable(); var token = '<?php echo PMA_escapeJsString($_SESSION[' PMA_token ']); ?>'; var text_dir = '<?php echo PMA_escapeJsString($GLOBALS['text_dir']); ?>'; var pma_absolute_uri = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['PmaAbsoluteUri']); ?>'; - var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_CommonFunctions::getInstance()->getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>'; - var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_CommonFunctions::getInstance()->getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>'; + var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_Util::getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>'; + var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_Util::getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>'; // for content and navigation frames diff --git a/libraries/Advisor.class.php b/libraries/Advisor.class.php index adbaa79244..e0aad7e20f 100644 --- a/libraries/Advisor.class.php +++ b/libraries/Advisor.class.php @@ -437,7 +437,7 @@ function ADVISOR_bytime($num, $precision) $num = round($num, $precision); if ($num == 0) { - $num = '<' . PMA_CommonFunctions::getInstance()->pow(10, -$precision); + $num = '<' . PMA_Util::pow(10, -$precision); } return "$num $per"; @@ -445,12 +445,12 @@ function ADVISOR_bytime($num, $precision) function ADVISOR_timespanFormat($val) { - return PMA_CommonFunctions::getInstance()->timespanFormat($val); + return PMA_Util::timespanFormat($val); } function ADVISOR_formatByteDown($value, $limes = 6, $comma = 0) { - return PMA_CommonFunctions::getInstance()->formatByteDown($value, $limes, $comma); + return PMA_Util::formatByteDown($value, $limes, $comma); } ?> diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 6a30c7b726..9d856f4308 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2797,7 +2797,7 @@ class PMA_DisplayResults ) { $parsed_sql = PMA_SQP_parse($row[$i]); - $row[$i] = PMA_CommonFunctions::getInstance()->formatSql( + $row[$i] = PMA_Util::formatSql( $parsed_sql, $row[$i] ); include_once $this->sytax_highlighting_column_info[strtolower($this->__get('_db'))][strtolower($this->__get('_table'))][strtolower($meta->name)][0]; diff --git a/libraries/File.class.php b/libraries/File.class.php index 15680836d7..02b91746a1 100644 --- a/libraries/File.class.php +++ b/libraries/File.class.php @@ -426,7 +426,7 @@ class PMA_File } $this->setName( - PMA_CommonFunctions::getInstance()->userDir($GLOBALS['cfg']['UploadDir']) . PMA_securePath($name) + PMA_Util::userDir($GLOBALS['cfg']['UploadDir']) . PMA_securePath($name) ); if (! $this->isReadable()) { $this->_error_message = __('File could not be read'); diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php index 2f7dc4c205..d999d16092 100644 --- a/libraries/Footer.class.php +++ b/libraries/Footer.class.php @@ -196,7 +196,7 @@ class PMA_Footer $retval .= '<a href="index.php' . PMA_generate_common_url($url_params) . '"' . ' title="' . __('Open new phpMyAdmin window') . '" target="_blank">'; if ($GLOBALS['cfg']['NavigationBarIconic']) { - $retval .= PMA_CommonFunctions::getInstance()->getImage( + $retval .= PMA_Util::getImage( 'window-new.png', __('Open new phpMyAdmin window') ); diff --git a/libraries/Header.class.php b/libraries/Header.class.php index 6283ed3ca8..8e20f1b910 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -169,7 +169,7 @@ class PMA_Header ); $this->_scripts->addFile('functions.js'); $this->_scripts->addCode( - PMA_CommonFunctions::getInstance()->getReloadNavigationScript(true) + PMA_Util::getReloadNavigationScript(true) ); } @@ -452,7 +452,7 @@ class PMA_Header $temp_title = $GLOBALS['cfg']['TitleDefault']; } $this->_title = htmlspecialchars( - PMA_CommonFunctions::getInstance()->expandUserString($temp_title) + PMA_Util::expandUserString($temp_title) ); } else { $this->_title = 'phpMyAdmin'; diff --git a/libraries/PDF.class.php b/libraries/PDF.class.php index 138835fe51..4815ed9836 100644 --- a/libraries/PDF.class.php +++ b/libraries/PDF.class.php @@ -48,7 +48,7 @@ class PMA_PDF extends TCPDF $this->SetY(-15); $this->SetFont(PMA_PDF_FONT, '', 14); $this->Cell(0, 6, __('Page number:') . ' ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 'T', 0, 'C'); - $this->Cell(0, 6, PMA_CommonFunctions::getInstance()->localisedDate(), 0, 1, 'R'); + $this->Cell(0, 6, PMA_Util::localisedDate(), 0, 1, 'R'); $this->SetY(20); // set footerset diff --git a/libraries/RecentTable.class.php b/libraries/RecentTable.class.php index e9052964c6..860a9fde6b 100644 --- a/libraries/RecentTable.class.php +++ b/libraries/RecentTable.class.php @@ -47,8 +47,8 @@ class PMA_RecentTable if (strlen($GLOBALS['cfg']['Server']['pmadb']) && strlen($GLOBALS['cfg']['Server']['recent']) ) { - $this->pma_table = PMA_CommonFunctions::getInstance()->backquote($GLOBALS['cfg']['Server']['pmadb']) . "." - . PMA_CommonFunctions::getInstance()->backquote($GLOBALS['cfg']['Server']['recent']); + $this->pma_table = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) . "." + . PMA_Util::backquote($GLOBALS['cfg']['Server']['recent']); } $server_id = $GLOBALS['server']; if (! isset($_SESSION['tmp_user_values']['recent_tables'][$server_id])) { @@ -102,7 +102,7 @@ class PMA_RecentTable $sql_query = " REPLACE INTO " . $this->pma_table . " (`username`, `tables`)" . " VALUES ('" . $username . "', '" - . PMA_CommonFunctions::getInstance()->sqlAddSlashes( + . PMA_Util::sqlAddSlashes( json_encode($this->tables) ) . "')"; diff --git a/libraries/StorageEngine.class.php b/libraries/StorageEngine.class.php index 33ff3f4ab6..00143b17bf 100644 --- a/libraries/StorageEngine.class.php +++ b/libraries/StorageEngine.class.php @@ -186,7 +186,7 @@ class PMA_StorageEngine . ' <td>' . "\n"; if (! empty($details['desc'])) { $ret .= ' ' - . PMA_CommonFunctions::getInstance()->showHint($details['desc']) + . PMA_Util::showHint($details['desc']) . "\n"; } $ret .= ' </td>' . "\n" @@ -199,7 +199,7 @@ class PMA_StorageEngine unset($parsed_size); break; case PMA_ENGINE_DETAILS_TYPE_NUMERIC: - $ret .= PMA_CommonFunctions::getInstance()->formatNumber($details['value']) . ' '; + $ret .= PMA_Util::formatNumber($details['value']) . ' '; break; default: $ret .= htmlspecialchars($details['value']) . ' '; @@ -232,7 +232,7 @@ class PMA_StorageEngine */ function resolveTypeSize($value) { - return PMA_CommonFunctions::getInstance()->formatByteDown($value); + return PMA_Util::formatByteDown($value); } /** diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 59d7db116c..08b6b6e30f 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -548,8 +548,8 @@ class PMA_Table // fast enough if (! $is_view || (PMA_DRIZZLE && PMA_is_system_schema($db))) { $row_count = PMA_DBI_fetch_value( - 'SELECT COUNT(*) FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . '.' - . PMA_CommonFunctions::getInstance()->backquote($table) + 'SELECT COUNT(*) FROM ' . PMA_Util::backquote($db) . '.' + . PMA_Util::backquote($table) ); } else { // For complex views, even trying to get a partial record @@ -612,7 +612,7 @@ class PMA_Table $attribute, $collation, $null, $default_type, $default_value, $extra, $comment, &$field_primary, $index, $move_to ) { - return PMA_CommonFunctions::getInstance()->backquote($oldcol) . ' ' + return PMA_Util::backquote($oldcol) . ' ' . PMA_Table::generateFieldSpec( $newcol, $type, $index, $length, $attribute, $collation, $null, $default_type, $default_value, $extra, diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index 048ec5e147..3ab1f4bf89 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -1114,7 +1114,7 @@ EOT; $html_output = '<ul id="topmenu2">'; foreach ($this->_getSubTabs() as $tab) { - $html_output .= PMA_CommonFunctions::getInstance()->getHtmlTab($tab, $url_params); + $html_output .= PMA_Util::getHtmlTab($tab, $url_params); } $html_output .= '</ul>'; $html_output .= '<div class="clearfloat"></div>'; diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 0e3ddac386..425173c14b 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -1027,7 +1027,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { * (note: when $cfg['ServerDefault'] = 0, constant is not defined) */ if (isset($_REQUEST['profiling']) - && PMA_CommonFunctions::getInstance()->profilingSupported() + && PMA_Util::profilingSupported() ) { $_SESSION['profiling'] = true; } elseif (isset($_REQUEST['profiling_form'])) { diff --git a/libraries/config/FormDisplay.tpl.php b/libraries/config/FormDisplay.tpl.php index 043de5f58c..5b88708012 100644 --- a/libraries/config/FormDisplay.tpl.php +++ b/libraries/config/FormDisplay.tpl.php @@ -168,7 +168,7 @@ function PMA_displayInput($path, $name, $type, $value, $description = '', } else { // In this case we just use getImage() because it's available foreach ($icon_init as $k => $v) { - $icons[$k] = PMA_CommonFunctions::getInstance()->getImage( + $icons[$k] = PMA_Util::getImage( $v[0], $v[1] ); } diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 694c14962c..0808026a1f 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -305,7 +305,7 @@ function PMA_warnMissingExtension($extension, $fatal = false, $extra = '') function PMA_getTableCount($db) { $tables = PMA_DBI_try_query( - 'SHOW TABLES FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . ';', + 'SHOW TABLES FROM ' . PMA_Util::backquote($db) . ';', null, PMA_DBI_QUERY_STORE ); if ($tables) { diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index ff7b792fe2..97539a0836 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -59,7 +59,7 @@ if (! PMA_DBI_checkDbExtension($GLOBALS['cfg']['Server']['extension'])) { PMA_warnMissingExtension( $GLOBALS['cfg']['Server']['extension'], false, - PMA_CommonFunctions::getInstance()->showDocu('faqmysql') + PMA_Util::showDocu('faqmysql') ); if ($GLOBALS['cfg']['Server']['extension'] === 'mysql') { @@ -73,7 +73,7 @@ if (! PMA_DBI_checkDbExtension($GLOBALS['cfg']['Server']['extension'])) { PMA_warnMissingExtension( $GLOBALS['cfg']['Server']['extension'], true, - PMA_CommonFunctions::getInstance()->showDocu('faqmysql') + PMA_Util::showDocu('faqmysql') ); } @@ -101,7 +101,7 @@ function PMA_DBI_query($query, $link = null, $options = 0, $cache_affected_rows = true ) { $res = PMA_DBI_try_query($query, $link, $options, $cache_affected_rows) - or PMA_CommonFunctions::getInstance()->mysqlDie(PMA_DBI_getError($link), $query); + or PMA_Util::mysqlDie(PMA_DBI_getError($link), $query); return $res; } @@ -314,7 +314,7 @@ function PMA_DBI_convert_message($message) function PMA_DBI_get_tables($database, $link = null) { return PMA_DBI_fetch_result( - 'SHOW TABLES FROM ' . PMA_CommonFunctions::getInstance()->backquote($database) . ';', + 'SHOW TABLES FROM ' . PMA_Util::backquote($database) . ';', null, 0, $link, diff --git a/libraries/db_common.inc.php b/libraries/db_common.inc.php index e7b8a4295e..90b39a031e 100644 --- a/libraries/db_common.inc.php +++ b/libraries/db_common.inc.php @@ -14,7 +14,7 @@ if (! defined('PHPMYADMIN')) { */ require_once './libraries/bookmark.lib.php'; -PMA_CommonFunctions::getInstance()->checkParameters(array('db')); +PMA_Util::checkParameters(array('db')); $is_show_stats = $cfg['ShowStats']; @@ -61,7 +61,7 @@ if (! isset($is_db) || ! $is_db) { if (isset($submitcollation) && !empty($db_collation)) { list($db_charset) = explode('_', $db_collation); $sql_query = 'ALTER DATABASE ' - . PMA_CommonFunctions::getInstance()->backquote($db) + . PMA_Util::backquote($db) . ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation); $result = PMA_DBI_query($sql_query); $message = PMA_Message::success(); diff --git a/libraries/db_table_exists.lib.php b/libraries/db_table_exists.lib.php index 16c10e5028..5ecab6bebb 100644 --- a/libraries/db_table_exists.lib.php +++ b/libraries/db_table_exists.lib.php @@ -50,7 +50,7 @@ if (empty($is_table) if (! $is_table) { $_result = PMA_DBI_try_query( - 'SHOW TABLES LIKE \'' . PMA_CommonFunctions::getInstance()->sqlAddSlashes($table, true) . '\';', + 'SHOW TABLES LIKE \'' . PMA_Util::sqlAddSlashes($table, true) . '\';', null, PMA_DBI_QUERY_STORE ); $is_table = @PMA_DBI_num_rows($_result); @@ -72,7 +72,7 @@ if (empty($is_table) * only happen if IS_TRANSFORMATION_WRAPPER? */ $_result = PMA_DBI_try_query( - 'SELECT COUNT(*) FROM ' . PMA_CommonFunctions::getInstance()->backquote($table) . ';', + 'SELECT COUNT(*) FROM ' . PMA_Util::backquote($table) . ';', null, PMA_DBI_QUERY_STORE ); diff --git a/libraries/display_create_database.lib.php b/libraries/display_create_database.lib.php index d5b5fcc590..4754dbb1ea 100644 --- a/libraries/display_create_database.lib.php +++ b/libraries/display_create_database.lib.php @@ -18,7 +18,7 @@ if ($is_create_db_priv) { // The user is allowed to create a db ?> <form method="post" action="db_create.php" id="create_database_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax" ' : ''); ?>><strong> - <?php echo '<label for="text_create_db">' . __('Create database') . '</label> ' . PMA_CommonFunctions::getInstance()->showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br /> + <?php echo '<label for="text_create_db">' . __('Create database') . '</label> ' . PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br /> <?php echo PMA_generate_common_hidden_inputs('', '', 5); ?> <input type="hidden" name="reload" value="1" /> <input type="text" name="new_db" value="<?php echo $db_to_create; ?>" maxlength="64" class="textfield" id="text_create_db"/> @@ -36,10 +36,10 @@ if ($is_create_db_priv) { } else { ?> <!-- db creation no privileges message --> - <strong><?php echo __('Create database') . ': ' . PMA_CommonFunctions::getInstance()->showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br /> + <strong><?php echo __('Create database') . ': ' . PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br /> <?php echo '<span class="noPrivileges">' - . PMA_CommonFunctions::getInstance()->getImage('s_error2.png', '', array('hspace' => 2, 'border' => 0, 'align' => 'middle')) + . PMA_Util::getImage('s_error2.png', '', array('hspace' => 2, 'border' => 0, 'align' => 'middle')) . '' . __('No Privileges') .'</span>'; } // end create db form or message ?> diff --git a/libraries/display_create_table.lib.php b/libraries/display_create_table.lib.php index d4789ed671..bc88721843 100644 --- a/libraries/display_create_table.lib.php +++ b/libraries/display_create_table.lib.php @@ -41,7 +41,7 @@ $is_create_table_priv = true; <legend> <?php if ($GLOBALS['cfg']['PropertiesIconic']) { - echo PMA_CommonFunctions::getInstance()->getImage('b_newtbl.png'); + echo PMA_Util::getImage('b_newtbl.png'); } echo __('Create table'); ?> diff --git a/libraries/display_select_lang.lib.php b/libraries/display_select_lang.lib.php index 73978476a3..0232e051cd 100644 --- a/libraries/display_select_lang.lib.php +++ b/libraries/display_select_lang.lib.php @@ -52,7 +52,7 @@ function PMA_select_language($use_fieldset = false, $show_doc = true) $language_title = __('Language') . (__('Language') != 'Language' ? ' - <em>Language</em>' : ''); if ($show_doc) { - $language_title .= PMA_CommonFunctions::getInstance()->showDocu('faq7_2'); + $language_title .= PMA_Util::showDocu('faq7_2'); } if ($use_fieldset) { echo '<fieldset><legend lang="en" dir="ltr">' . $language_title . '</legend>'; diff --git a/libraries/import.lib.php b/libraries/import.lib.php index d7a465c712..280ca4a4a5 100644 --- a/libraries/import.lib.php +++ b/libraries/import.lib.php @@ -269,7 +269,7 @@ function PMA_lookForUse($buffer, $db, $reload) // $db must not contain the escape characters generated by backquote() // ( used in PMA_buildSQL() as: backquote($db_name), and then called // in PMA_importRunQuery() which in turn calls PMA_lookForUse() ) - $db = PMA_CommonFunctions::getInstance()->unQuote($db); + $db = PMA_Util::unQuote($db); $reload = true; } @@ -462,7 +462,7 @@ function PMA_getColumnNumberFromName($name) // base26 to base10 conversion : multiply each number // with corresponding value of the position, in this case // $i=0 : 1; $i=1 : 26; $i=2 : 676; ... - $column_number += $number * PMA_CommonFunctions::getInstance()->pow(26, $i); + $column_number += $number * PMA_Util::pow(26, $i); } return $column_number; } else { diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index d353cd370b..b1d8c2b858 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -108,8 +108,8 @@ function PMA_analyzeWhereClauses( foreach ($where_clause_array as $key_id => $where_clause) { $local_query = 'SELECT * FROM ' - . PMA_CommonFunctions::getInstance()->backquote($db) . '.' - . PMA_CommonFunctions::getInstance()->backquote($table) + . PMA_Util::backquote($db) . '.' + . PMA_Util::backquote($table) . ' WHERE ' . $where_clause . ';'; $result[$key_id] = PMA_DBI_query($local_query, null, PMA_DBI_QUERY_STORE); $rows[$key_id] = PMA_DBI_fetch_assoc($result[$key_id]); @@ -145,7 +145,7 @@ function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id, if (! $rows[$key_id]) { unset($rows[$key_id], $where_clause_array[$key_id]); PMA_Response::getInstance()->addHtml( - PMA_CommonFunctions::getInstance()->getMessage( + PMA_Util::getMessage( __('MySQL returned an empty result set (i.e. zero rows).'), $local_query ) @@ -158,7 +158,7 @@ function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id, $meta = PMA_DBI_get_fields_meta($result[$key_id]); list($unique_condition, $tmp_clause_is_unique) - = PMA_CommonFunctions::getInstance()->getUniqueCondition( + = PMA_Util::getUniqueCondition( $result[$key_id], count($meta), $meta, $rows[$key_id], true ); @@ -181,8 +181,8 @@ function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id, function PMA_loadFirstRowInEditMode($table, $db) { $result = PMA_DBI_query( - 'SELECT * FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) - . '.' . PMA_CommonFunctions::getInstance()->backquote($table) . ' LIMIT 1;', + 'SELECT * FROM ' . PMA_Util::backquote($db) + . '.' . PMA_Util::backquote($table) . ' LIMIT 1;', null, PMA_DBI_QUERY_STORE ); @@ -1113,7 +1113,7 @@ function PMA_getBinaryAndBlobColumn( ) { $html_output .= __('Binary - do not edit'); if (isset($data)) { - $data_size = PMA_CommonFunctions::getInstance()->formatByteDown( + $data_size = PMA_Util::formatByteDown( strlen(stripslashes($data)), 3, 1 ); $html_output .= ' ('. $data_size [0] . ' ' . $data_size[1] . ')'; @@ -1200,7 +1200,7 @@ function PMA_getHTMLinput($column, $column_name_appendix, $special_chars, function PMA_getSelectOptionForUpload($vkey, $column) { $files = PMA_getFileSelectOptions( - PMA_CommonFunctions::getInstance()->userDir($GLOBALS['cfg']['UploadDir']) + PMA_Util::userDir($GLOBALS['cfg']['UploadDir']) ); if ($files === false) { @@ -1246,7 +1246,7 @@ function PMA_getMaxUploadSize($column, $biggest_max_file_size) $this_field_max_size = $max_field_sizes[$column['pma_type']]; } $html_output - = PMA_CommonFunctions::getInstance()->getFormattedMaximumUploadSize( + = PMA_Util::getFormattedMaximumUploadSize( $this_field_max_size ) . "\n"; // do not generate here the MAX_FILE_SIZE, because we should @@ -1563,7 +1563,7 @@ function PMA_getAfterInsertDropDown($where_clause, $after_insert, $found_unique_ function PMA_getSumbitAndResetButtonForActionsPanel($tabindex, $tabindex_for_value) { return '<td>' - . PMA_CommonFunctions::getInstance()->showHint( + . PMA_Util::showHint( __('Use TAB key to move from value to value, or CTRL+arrows to move anywhere') ) . '</td>' @@ -1898,8 +1898,8 @@ function PMA_buildSqlQuery($is_insertignore, $query_fields, $value_sets) $insert_command = 'INSERT '; } $query[] = $insert_command . 'INTO ' - . PMA_CommonFunctions::getInstance()->backquote($GLOBALS['db']) . '.' - . PMA_CommonFunctions::getInstance()->backquote($GLOBALS['table']) + . PMA_Util::backquote($GLOBALS['db']) . '.' + . PMA_Util::backquote($GLOBALS['table']) . ' (' . implode(', ', $query_fields) . ') VALUES (' . implode('), (', $value_sets) . ')'; unset($insert_command, $query_fields); diff --git a/libraries/ip_allow_deny.lib.php b/libraries/ip_allow_deny.lib.php index e45b16ef19..b62912c845 100644 --- a/libraries/ip_allow_deny.lib.php +++ b/libraries/ip_allow_deny.lib.php @@ -91,7 +91,7 @@ function PMA_ipMaskTest($testRange, $ipToTest) for ($i = 0; $i < 31; $i++) { if ($i < $regs[5] - 1) { - $maskl = $maskl + PMA_CommonFunctions::getInstance()->pow(2, (30 - $i)); + $maskl = $maskl + PMA_Util::pow(2, (30 - $i)); } // end if } // end for diff --git a/libraries/js_escape.lib.php b/libraries/js_escape.lib.php index 84630abad7..e81d355d8e 100644 --- a/libraries/js_escape.lib.php +++ b/libraries/js_escape.lib.php @@ -33,7 +33,7 @@ function PMA_jsFormat($a_string = '', $add_backquotes = true) $a_string = str_replace('#', '\\#', $a_string); } - return (($add_backquotes) ? PMA_CommonFunctions::getInstance()->backquote($a_string) : $a_string); + return (($add_backquotes) ? PMA_Util::backquote($a_string) : $a_string); } // end of the 'PMA_jsFormat()' function /** diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index aeaea07289..8890a9e884 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -70,7 +70,7 @@ function PMA_getHtmlForRenameDatabase($db) . '<legend>'; if ($GLOBALS['cfg']['PropertiesIconic']) { - $html_output .= PMA_CommonFunctions::getInstance()->getImage('b_edit.png'); + $html_output .= PMA_Util::getImage('b_edit.png'); } $html_output .= __('Rename database to') . ':' . '</legend>'; @@ -239,7 +239,7 @@ function PMA_getHtmlForChangeDatabaseCharset($db, $table) $html_output .= '<fieldset>' . "\n" . ' <legend>'; if ($GLOBALS['cfg']['PropertiesIconic']) { - $html_output .= PMA_CommonFunctions::getInstance()->getImage('s_asci.png'); + $html_output .= PMA_Util::getImage('s_asci.png'); } $html_output .= '<label for="select_db_collation">' . __('Collation') . ':</label>' . "\n" @@ -274,7 +274,7 @@ function PMA_getHtmlForExportRelationalSchemaView($url_query) $html_output = '<div class="operations_full_width">' . '<fieldset><a href="schema_edit.php?' . $url_query . '">'; if ($GLOBALS['cfg']['PropertiesIconic']) { - $html_output .= PMA_CommonFunctions::getInstance()->getImage( + $html_output .= PMA_Util::getImage( 'b_edit.png' ); } @@ -343,7 +343,7 @@ function PMA_getSqlQueryAndCreateDbBeforeCopy() } $local_query = 'CREATE DATABASE ' - . PMA_CommonFunctions::getInstance()->backquote($_REQUEST['newname']); + . PMA_Util::backquote($_REQUEST['newname']); if (isset($_REQUEST['db_collation'])) { $local_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($_REQUEST['db_collation']); @@ -517,7 +517,7 @@ function PMA_runEventDefinitionsForDb($db) { $event_names = PMA_DBI_fetch_result( 'SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' - . PMA_CommonFunctions::getInstance()->sqlAddSlashes($db, true) . '\';' + . PMA_Util::sqlAddSlashes($db, true) . '\';' ); if ($event_names) { foreach ($event_names as $event_name) { @@ -792,7 +792,7 @@ function PMA_getTableOptionFieldset($comment, $tbl_collation, //Storage engine $html_output .= '<tr><td>' . __('Storage Engine') - . PMA_CommonFunctions::getInstance()->showMySQLDocu( + . PMA_Util::showMySQLDocu( 'Storage_engines', 'Storage_engines' ) . '</td>' @@ -891,7 +891,7 @@ function PMA_getTableOptionFieldset($comment, $tbl_collation, $html_output .= '<tr><td>' . '<label for="new_row_format">ROW_FORMAT</label></td>' . '<td>'; - $html_output .= PMA_CommonFunctions::getInstance()->getDropdown( + $html_output .= PMA_Util::getDropdown( 'new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format' ); @@ -1015,7 +1015,7 @@ function PMA_getHtmlForCopytable() 'data' => __('Structure and data'), 'dataonly' => __('Data only')); - $html_output .= PMA_CommonFunctions::getInstance()->getRadioFields( + $html_output .= PMA_Util::getRadioFields( 'what', $choices, 'data', true ); @@ -1220,7 +1220,7 @@ function PMA_getMaintainActionlink($action, $params, $url_params, $link, . PMA_generate_common_url(array_merge($url_params, $params)) .'">' . $action . '</a>' - . PMA_CommonFunctions::getInstance()->showMySQLDocu($chapter, $link) + . PMA_Util::showMySQLDocu($chapter, $link) . '</li>'; } @@ -1282,7 +1282,7 @@ function PMA_getDeleteDataOrTablelink($url_params, $syntax, $link, $id) : '' ) . '>' . $link . '</a>' - . PMA_CommonFunctions::getInstance()->showMySQLDocu( + . PMA_Util::showMySQLDocu( 'SQL-Syntax', $syntax ) . '</li>'; diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index 4d947d8126..2430537741 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -420,16 +420,16 @@ function PMA_pluginGetOneOption( $doc = $propertyGroup->getDoc(); if ($doc != null) { if (count($doc) == 3) { - $ret .= PMA_CommonFunctions::getInstance()->showMySQLDocu( + $ret .= PMA_Util::showMySQLDocu( $doc[0], $doc[1], false, $doc[2] ); } elseif (count($doc) == 1) { - $ret .= PMA_CommonFunctions::getInstance()->showDocu($doc[0]); + $ret .= PMA_Util::showDocu($doc[0]); } else { - $ret .= PMA_CommonFunctions::getInstance()->showMySQLDocu( + $ret .= PMA_Util::showMySQLDocu( $doc[0], $doc[1] ); diff --git a/libraries/plugins/auth/AuthenticationConfig.class.php b/libraries/plugins/auth/AuthenticationConfig.class.php index 505940aa92..e67290c711 100644 --- a/libraries/plugins/auth/AuthenticationConfig.class.php +++ b/libraries/plugins/auth/AuthenticationConfig.class.php @@ -126,7 +126,7 @@ class AuthenticationConfig extends AuthenticationPlugin ), E_USER_WARNING ); } - PMA_CommonFunctions::getInstance()->mysqlDie( + PMA_Util::mysqlDie( $conn_error, '', true, '', false ); } diff --git a/libraries/plugins/auth/AuthenticationCookie.class.php b/libraries/plugins/auth/AuthenticationCookie.class.php index 41c90a8ab7..4ab2ef5f37 100644 --- a/libraries/plugins/auth/AuthenticationCookie.class.php +++ b/libraries/plugins/auth/AuthenticationCookie.class.php @@ -173,7 +173,7 @@ class AuthenticationCookie extends AuthenticationPlugin <fieldset> <legend>'; echo __('Log in'); - echo PMA_CommonFunctions::getInstance()->showDocu(''); + echo PMA_Util::showDocu(''); echo '</legend>'; if ($GLOBALS['cfg']['AllowArbitraryServer']) { echo ' @@ -536,7 +536,7 @@ class AuthenticationCookie extends AuthenticationPlugin /** * Clear user cache. */ - PMA_CommonFunctions::getInstance()->clearUserCache(); + PMA_Util::clearUserCache(); PMA_Response::getInstance()->disable(); diff --git a/libraries/plugins/auth/AuthenticationSignon.class.php b/libraries/plugins/auth/AuthenticationSignon.class.php index db6a612d97..0f5138db28 100644 --- a/libraries/plugins/auth/AuthenticationSignon.class.php +++ b/libraries/plugins/auth/AuthenticationSignon.class.php @@ -186,7 +186,7 @@ class AuthenticationSignon extends AuthenticationPlugin /** * Clear user cache. */ - PMA_CommonFunctions::getInstance()->clearUserCache(); + PMA_Util::clearUserCache(); } // Returns whether we get authentication settings or not diff --git a/libraries/plugins/export/ExportHtmlword.class.php b/libraries/plugins/export/ExportHtmlword.class.php index bf1c0ed577..6297692e49 100644 --- a/libraries/plugins/export/ExportHtmlword.class.php +++ b/libraries/plugins/export/ExportHtmlword.class.php @@ -598,7 +598,7 @@ class ExportHtmlword extends ExportPlugin $definition = '<tr class="print-category">'; $extracted_columnspec - = PMA_CommonFunctions::getInstance()->extractColumnSpec($column['Type']); + = PMA_Util::extractColumnSpec($column['Type']); $type = htmlspecialchars($extracted_columnspec['print_type']); if (empty($type)) { diff --git a/libraries/plugins/export/ExportLatex.class.php b/libraries/plugins/export/ExportLatex.class.php index 7ea49e49c5..6077838114 100644 --- a/libraries/plugins/export/ExportLatex.class.php +++ b/libraries/plugins/export/ExportLatex.class.php @@ -220,7 +220,7 @@ class ExportLatex extends ExportPlugin } $head .= $crlf . '% ' . __('Generation Time') . ': ' - . PMA_CommonFunctions::getInstance()->localisedDate() . $crlf + . PMA_Util::localisedDate() . $crlf . '% ' . __('Server version') . ': ' . PMA_MYSQL_STR_VERSION . $crlf . '% ' . __('PHP Version') . ': ' . phpversion() . $crlf; return PMA_exportOutputHandler($head); @@ -560,7 +560,7 @@ class ExportLatex extends ExportPlugin $fields = PMA_DBI_get_columns($db, $table); foreach ($fields as $row) { $extracted_columnspec - = PMA_CommonFunctions::getInstance()->extractColumnSpec( + = PMA_Util::extractColumnSpec( $row['Type'] ); $type = $extracted_columnspec['print_type']; diff --git a/libraries/plugins/export/ExportMediawiki.class.php b/libraries/plugins/export/ExportMediawiki.class.php index 12f4c39308..0803c7d28f 100644 --- a/libraries/plugins/export/ExportMediawiki.class.php +++ b/libraries/plugins/export/ExportMediawiki.class.php @@ -208,7 +208,7 @@ class ExportMediawiki extends ExportPlugin // Print structure comment $output = $this->_exportComment( "Table structure for " - . PMA_CommonFunctions::getInstance()->backquote($table) + . PMA_Util::backquote($table) ); // Begin the table construction @@ -282,7 +282,7 @@ class ExportMediawiki extends ExportPlugin ) { // Print data comment $output = $this->_exportComment( - "Table data for ". PMA_CommonFunctions::getInstance()->backquote($table) + "Table data for ". PMA_Util::backquote($table) ); // Begin the table construction diff --git a/libraries/plugins/export/ExportOdt.class.php b/libraries/plugins/export/ExportOdt.class.php index e01f57f499..5b0a9e5eee 100644 --- a/libraries/plugins/export/ExportOdt.class.php +++ b/libraries/plugins/export/ExportOdt.class.php @@ -699,7 +699,7 @@ class ExportOdt extends ExportPlugin . '</table:table-cell>'; $extracted_columnspec - = PMA_CommonFunctions::getInstance()->extractColumnSpec($column['Type']); + = PMA_Util::extractColumnSpec($column['Type']); $type = htmlspecialchars($extracted_columnspec['print_type']); if (empty($type)) { $type = ' '; diff --git a/libraries/plugins/export/ExportPhparray.class.php b/libraries/plugins/export/ExportPhparray.class.php index 66bf43fd6b..e11432cf3c 100644 --- a/libraries/plugins/export/ExportPhparray.class.php +++ b/libraries/plugins/export/ExportPhparray.class.php @@ -119,7 +119,7 @@ class ExportPhparray extends ExportPlugin { PMA_exportOutputHandler( '//' . $GLOBALS['crlf'] - . '// Database ' . PMA_CommonFunctions::getInstance()->backquote($db) + . '// Database ' . PMA_Util::backquote($db) . $GLOBALS['crlf'] . '//' . $GLOBALS['crlf'] ); return true; @@ -196,8 +196,8 @@ class ExportPhparray extends ExportPlugin // Output table name as comment if it's the first record of the table if ($record_cnt == 1) { $buffer .= $crlf . '// ' - . PMA_CommonFunctions::getInstance()->backquote($db) . '.' - . PMA_CommonFunctions::getInstance()->backquote($table) . $crlf; + . PMA_Util::backquote($db) . '.' + . PMA_Util::backquote($table) . $crlf; $buffer .= '$' . $tablefixed . ' = array(' . $crlf; $buffer .= ' array('; } else { diff --git a/libraries/plugins/export/ExportSql.class.php b/libraries/plugins/export/ExportSql.class.php index 0958bdd2c1..83238f5e83 100644 --- a/libraries/plugins/export/ExportSql.class.php +++ b/libraries/plugins/export/ExportSql.class.php @@ -606,7 +606,7 @@ class ExportSql extends ExportPlugin $head .= $this->_exportComment( __('Generation Time') . ': ' - . PMA_CommonFunctions::getInstance()->localisedDate() + . PMA_Util::localisedDate() ) . $this->_exportComment( __('Server version') . ': ' . PMA_MYSQL_STR_VERSION @@ -759,7 +759,7 @@ class ExportSql extends ExportPlugin . $this->_exportComment( __('Database') . ': ' . (isset($GLOBALS['sql_backquotes']) - ? PMA_CommonFunctions::getInstance()->backquoteCompat($db, $compat) + ? PMA_Util::backquoteCompat($db, $compat) : '\'' . $db . '\'') ) . $this->_exportComment(); diff --git a/libraries/plugins/export/ExportTexytext.class.php b/libraries/plugins/export/ExportTexytext.class.php index df5414a91f..12be5cc6af 100644 --- a/libraries/plugins/export/ExportTexytext.class.php +++ b/libraries/plugins/export/ExportTexytext.class.php @@ -535,7 +535,7 @@ class ExportTexytext extends ExportPlugin $column, $unique_keys ) { $extracted_columnspec - = PMA_CommonFunctions::getInstance()->extractColumnSpec($column['Type']); + = PMA_Util::extractColumnSpec($column['Type']); $type = $extracted_columnspec['print_type']; if (empty($type)) { $type = ' '; diff --git a/libraries/plugins/import/ImportCsv.class.php b/libraries/plugins/import/ImportCsv.class.php index 216d81ab47..27063f7819 100644 --- a/libraries/plugins/import/ImportCsv.class.php +++ b/libraries/plugins/import/ImportCsv.class.php @@ -124,7 +124,7 @@ class ImportCsv extends ImportPlugin $leaf->setName("columns"); $leaf->setText( __('Column names: ') - . PMA_CommonFunctions::getInstance()->showHint($hint) + . PMA_Util::showHint($hint) ); $generalOptions->addProperty($leaf); } diff --git a/libraries/plugins/import/ImportLdi.class.php b/libraries/plugins/import/ImportLdi.class.php index 8ee18cda93..1359deab13 100644 --- a/libraries/plugins/import/ImportLdi.class.php +++ b/libraries/plugins/import/ImportLdi.class.php @@ -153,7 +153,7 @@ class ImportLdi extends ImportPlugin if (strlen($ldi_new_line) > 0) { if ($ldi_new_line == 'auto') { $ldi_new_line - = (PMA_CommonFunctions::getInstance()->whichCrlf() == "\n") + = (PMA_Util::whichCrlf() == "\n") ? '\n' : '\r\n'; } diff --git a/libraries/plugins/import/ImportXml.class.php b/libraries/plugins/import/ImportXml.class.php index 1fe9f5e8c3..447f96eaba 100644 --- a/libraries/plugins/import/ImportXml.class.php +++ b/libraries/plugins/import/ImportXml.class.php @@ -219,7 +219,7 @@ class ImportXml extends ImportPlugin */ $attrs = $val2->attributes(); $create[] = "USE " - . PMA_CommonFunctions::getInstance()->backquote( + . PMA_Util::backquote( $attrs["name"] ); diff --git a/libraries/plugins/transformations/abstract/DateFormatTransformationsPlugin.class.php b/libraries/plugins/transformations/abstract/DateFormatTransformationsPlugin.class.php index e36c9ba78c..64986c5637 100644 --- a/libraries/plugins/transformations/abstract/DateFormatTransformationsPlugin.class.php +++ b/libraries/plugins/transformations/abstract/DateFormatTransformationsPlugin.class.php @@ -130,7 +130,7 @@ abstract class DateFormatTransformationsPlugin extends TransformationsPlugin $timestamp -= $options[0] * 60 * 60; $source = $buffer; if ($options[2] == 'local') { - $text = PMA_CommonFunctions::getInstance()->localisedDate( + $text = PMA_Util::localisedDate( $timestamp, $options[1] ); diff --git a/libraries/pmd_common.php b/libraries/pmd_common.php index bbeb40a0fa..561e18757a 100644 --- a/libraries/pmd_common.php +++ b/libraries/pmd_common.php @@ -91,7 +91,7 @@ function get_script_contr() PMA_DBI_select_db($GLOBALS['db']); $con["C_NAME"] = array(); $i = 0; - $alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_CommonFunctions::getInstance()->backquote($GLOBALS['db']), null, PMA_DBI_QUERY_STORE); + $alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_Util::backquote($GLOBALS['db']), null, PMA_DBI_QUERY_STORE); while ($val = @PMA_DBI_fetch_row($alltab_rs)) { $row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'internal'); //echo "<br> internal ".$GLOBALS['db']." - ".$val[0]." - "; @@ -192,7 +192,7 @@ function get_script_tabs() . 'var h_tabs = new Array();' . "\n" ; for ($i = 0, $cnt = count($GLOBALS['PMD']['TABLE_NAME']); $i < $cnt; $i++) { $script_tabs .= "j_tabs['" . $GLOBALS['PMD_URL']['TABLE_NAME'][$i] . "'] = '" - . PMA_CommonFunctions::getInstance()->isForeignKeySupported( + . PMA_Util::isForeignKeySupported( $GLOBALS['PMD']['TABLE_TYPE'][$i] ) ? '1' : '0' @@ -219,7 +219,7 @@ function get_tab_pos() `y` AS `Y`, `v` AS `V`, `h` AS `H` - FROM " . PMA_CommonFunctions::getInstance()->backquote($cfgRelation['db']) . "." . PMA_CommonFunctions::getInstance()->backquote($cfgRelation['designer_coords']); + FROM " . PMA_Util::backquote($cfgRelation['db']) . "." . PMA_Util::backquote($cfgRelation['designer_coords']); $tab_pos = PMA_DBI_fetch_result($query, 'name', null, $GLOBALS['controllink'], PMA_DBI_QUERY_STORE); return count($tab_pos) ? $tab_pos : null; } diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 3ba44e2d43..e81906342b 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -382,7 +382,7 @@ function PMA__getRelationsParam() // fear it might be too slow $tab_query = 'SHOW TABLES FROM ' - . PMA_CommonFunctions::getInstance()->backquote( + . PMA_Util::backquote( $GLOBALS['cfg']['Server']['pmadb'] ); $tab_rs = PMA_queryAsControlUser($tab_query, false, PMA_DBI_QUERY_STORE); diff --git a/libraries/replication_gui.lib.php b/libraries/replication_gui.lib.php index d2bd825444..a3e36af9e2 100644 --- a/libraries/replication_gui.lib.php +++ b/libraries/replication_gui.lib.php @@ -343,7 +343,7 @@ function PMA_replication_gui_master_addslaveuser() . (isset($GLOBALS['hostname']) ? $GLOBALS['hostname'] : '') . '" title="' . __('Host') . '" onchange="pred_hostname.value = \'userdefined\';" />' - . PMA_CommonFunctions::getInstance()->showHint( + . PMA_Util::showHint( __('When Host table is used, this field is ignored and values stored in Host table are used instead.') ) . '</div>' diff --git a/libraries/rte/rte_events.lib.php b/libraries/rte/rte_events.lib.php index ede101b5b8..1c3ae1da91 100644 --- a/libraries/rte/rte_events.lib.php +++ b/libraries/rte/rte_events.lib.php @@ -60,7 +60,7 @@ function PMA_EVN_main() * Display a list of available events */ $columns = "`EVENT_NAME`, `EVENT_TYPE`, `STATUS`"; - $where = "EVENT_SCHEMA='" . PMA_CommonFunctions::getInstance()->sqlAddSlashes($db) . "'"; + $where = "EVENT_SCHEMA='" . PMA_Util::sqlAddSlashes($db) . "'"; $query = "SELECT $columns FROM `INFORMATION_SCHEMA`.`EVENTS` " . "WHERE $where ORDER BY `EVENT_NAME` ASC;"; $items = PMA_DBI_fetch_result($query); diff --git a/libraries/rte/rte_export.lib.php b/libraries/rte/rte_export.lib.php index 76df648f55..257fc85d24 100644 --- a/libraries/rte/rte_export.lib.php +++ b/libraries/rte/rte_export.lib.php @@ -20,7 +20,7 @@ function PMA_RTE_handleExport($item_name, $export_data) { global $db; - $item_name = htmlspecialchars(PMA_CommonFunctions::getInstance()->backquote($_GET['item_name'])); + $item_name = htmlspecialchars(PMA_Util::backquote($_GET['item_name'])); if ($export_data !== false) { $export_data = '<textarea cols="40" rows="15" style="width: 100%;">' . htmlspecialchars(trim($export_data)) . '</textarea>'; @@ -37,7 +37,7 @@ function PMA_RTE_handleExport($item_name, $export_data) . "</fieldset>\n"; } } else { - $_db = htmlspecialchars(PMA_CommonFunctions::getInstance()->backquote($db)); + $_db = htmlspecialchars(PMA_Util::backquote($db)); $response = __('Error in Processing Request') . ' : ' . sprintf(PMA_RTE_getWord('not_found'), $item_name, $_db); $response = PMA_message::error($response); diff --git a/libraries/rte/rte_footer.lib.php b/libraries/rte/rte_footer.lib.php index 41f2bbc54f..22442a1a8e 100644 --- a/libraries/rte/rte_footer.lib.php +++ b/libraries/rte/rte_footer.lib.php @@ -109,7 +109,7 @@ function PMA_EVN_getFooterLinks() $retval .= " </legend>\n"; $retval .= " <div class='wrap'>\n"; // show the toggle button - $retval .= PMA_CommonFunctions::getInstance()->toggleButton( + $retval .= PMA_Util::toggleButton( "sql.php?$url_query&goto=db_events.php" . urlencode("?db=$db"), 'sql_query', $options, diff --git a/libraries/rte/rte_list.lib.php b/libraries/rte/rte_list.lib.php index 51cdae5849..476625f360 100644 --- a/libraries/rte/rte_list.lib.php +++ b/libraries/rte/rte_list.lib.php @@ -38,7 +38,7 @@ function PMA_RTE_getList($type, $items) $retval .= "<fieldset>\n"; $retval .= " <legend>\n"; $retval .= " " . PMA_RTE_getWord('title') . "\n"; - $retval .= " " . PMA_CommonFunctions::getInstance()->showMySQLDocu('SQL-Syntax', PMA_RTE_getWord('docu')) . "\n"; + $retval .= " " . PMA_Util::showMySQLDocu('SQL-Syntax', PMA_RTE_getWord('docu')) . "\n"; $retval .= " </legend>\n"; $retval .= " <div class='$class1' id='nothing2display'>\n"; $retval .= " " . PMA_RTE_getWord('nothing') . "\n"; @@ -133,7 +133,7 @@ function PMA_RTN_getRowForList($routine, $rowclass = '') $sql_drop = sprintf( 'DROP %s IF EXISTS %s', $routine['ROUTINE_TYPE'], - PMA_CommonFunctions::getInstance()->backquote($routine['SPECIFIC_NAME']) + PMA_Util::backquote($routine['SPECIFIC_NAME']) ); $type_link = "item_type={$routine['ROUTINE_TYPE']}"; @@ -310,7 +310,7 @@ function PMA_EVN_getRowForList($event, $rowclass = '') $sql_drop = sprintf( 'DROP EVENT IF EXISTS %s', - PMA_CommonFunctions::getInstance()->backquote($event['EVENT_NAME']) + PMA_Util::backquote($event['EVENT_NAME']) ); $retval = " <tr class='noclick $rowclass'>\n"; diff --git a/libraries/rte/rte_main.inc.php b/libraries/rte/rte_main.inc.php index dfbc8486ba..05a6cfc898 100644 --- a/libraries/rte/rte_main.inc.php +++ b/libraries/rte/rte_main.inc.php @@ -63,7 +63,7 @@ if ($GLOBALS['cfg']['AjaxEnable']) { /** * Create labels for the list */ -$titles = PMA_CommonFunctions::getInstance()->buildActionTitles(); +$titles = PMA_Util::buildActionTitles(); /** * Keep a list of errors that occured while diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index 0018ebb392..7a614d3d97 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -51,7 +51,7 @@ function PMA_RTN_main() */ $columns = "`SPECIFIC_NAME`, `ROUTINE_NAME`, `ROUTINE_TYPE`, "; $columns .= "`DTD_IDENTIFIER`, `ROUTINE_DEFINITION`"; - $where = "ROUTINE_SCHEMA='" . PMA_CommonFunctions::getInstance()->sqlAddSlashes($db) . "'"; + $where = "ROUTINE_SCHEMA='" . PMA_Util::sqlAddSlashes($db) . "'"; $items = PMA_DBI_fetch_result( "SELECT $columns FROM `INFORMATION_SCHEMA`.`ROUTINES` WHERE $where;" ); @@ -104,7 +104,7 @@ function PMA_RTN_parseOneParameter($value) if ($parsed_param[$pos]['type'] == 'alpha_identifier' || $parsed_param[$pos]['type'] == 'quote_backtick' ) { - $retval[1] = PMA_CommonFunctions::getInstance()->unQuote( + $retval[1] = PMA_Util::unQuote( $parsed_param[$pos]['data'] ); $pos++; @@ -246,7 +246,7 @@ function PMA_RTN_parseRoutineDefiner($parsed_query) } else if ($fetching == true && $parsed_query[$i]['type'] == 'quote_backtick' ) { - $retval .= PMA_CommonFunctions::getInstance()->unQuote( + $retval .= PMA_Util::unQuote( $parsed_query[$i]['data'] ); } else if ($fetching == true && $parsed_query[$i]['type'] == 'punct_user') { diff --git a/libraries/rte/rte_triggers.lib.php b/libraries/rte/rte_triggers.lib.php index 942bd7f2c9..323e915303 100644 --- a/libraries/rte/rte_triggers.lib.php +++ b/libraries/rte/rte_triggers.lib.php @@ -92,7 +92,7 @@ function PMA_TRI_handleEditor() } } else { $message = PMA_Message::success(__('Trigger %1$s has been modified.')); - $message->addParam(PMA_CommonFunctions::getInstance()->backquote($_REQUEST['item_name'])); + $message->addParam(PMA_Util::backquote($_REQUEST['item_name'])); $sql_query = $drop_item . $item_query; } } @@ -108,7 +108,7 @@ function PMA_TRI_handleEditor() . __('MySQL said: ') . PMA_DBI_getError(null); } else { $message = PMA_Message::success(__('Trigger %1$s has been created.')); - $message->addParam(PMA_CommonFunctions::getInstance()->backquote($_REQUEST['item_name'])); + $message->addParam(PMA_Util::backquote($_REQUEST['item_name'])); $sql_query = $item_query; } } @@ -123,7 +123,7 @@ function PMA_TRI_handleEditor() $message->addString('</ul>'); } - $output = PMA_CommonFunctions::getInstance()->getMessage($message, $sql_query); + $output = PMA_Util::getMessage($message, $sql_query); if ($GLOBALS['is_ajax_request']) { $response = PMA_Response::getInstance(); if ($message->isSuccess()) { @@ -196,8 +196,8 @@ function PMA_TRI_handleEditor() $message = __('Error in processing request') . ' : '; $message .= sprintf( PMA_RTE_getWord('not_found'), - htmlspecialchars(PMA_CommonFunctions::getInstance()->backquote($_REQUEST['item_name'])), - htmlspecialchars(PMA_CommonFunctions::getInstance()->backquote($db)) + htmlspecialchars(PMA_Util::backquote($_REQUEST['item_name'])), + htmlspecialchars(PMA_Util::backquote($db)) ); $message = PMA_message::error($message); if ($GLOBALS['is_ajax_request']) { @@ -299,7 +299,7 @@ function PMA_TRI_getEditorForm($mode, $item) . "type='hidden' value='{$item['item_original_name']}'/>\n"; } $query = "SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` "; - $query .= "WHERE `TABLE_SCHEMA`='" . PMA_CommonFunctions::getInstance()->sqlAddSlashes($db) . "' "; + $query .= "WHERE `TABLE_SCHEMA`='" . PMA_Util::sqlAddSlashes($db) . "' "; $query .= "AND `TABLE_TYPE`='BASE TABLE'"; $tables = PMA_DBI_fetch_result($query); diff --git a/libraries/schema/Visio_Relation_Schema.class.php b/libraries/schema/Visio_Relation_Schema.class.php index 5acf317ba8..4bdc8d414e 100644 --- a/libraries/schema/Visio_Relation_Schema.class.php +++ b/libraries/schema/Visio_Relation_Schema.class.php @@ -282,7 +282,7 @@ class Table_Stats // displayfield $this->displayfield = PMA_getDisplayField($db, $tableName); // index - $result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_CommonFunctions::getInstance()->backquote($tableName) . ';', null, PMA_DBI_QUERY_STORE); + $result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';', null, PMA_DBI_QUERY_STORE); if (PMA_DBI_num_rows($result) > 0) { while ($row = PMA_DBI_fetch_assoc($result)) { if ($row['Key_name'] == 'PRIMARY') { diff --git a/libraries/server_common.inc.php b/libraries/server_common.inc.php index 5d24061598..1e946a401e 100644 --- a/libraries/server_common.inc.php +++ b/libraries/server_common.inc.php @@ -50,7 +50,7 @@ $binary_logs = PMA_DRIZZLE PMA_DBI_QUERY_STORE ); -PMA_CommonFunctions::getInstance()->checkParameters( +PMA_Util::checkParameters( array('is_superuser', 'url_query'), false ); ?> diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index d6d8d8d03e..1ed57828fc 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -446,10 +446,10 @@ function PMA_getHtmlToDisplayPrivilegesTable($random_n, $db = '*', // get columns $res = PMA_DBI_try_query( 'SHOW COLUMNS FROM ' - . PMA_CommonFunctions::getInstance()->backquote( - PMA_CommonFunctions::getInstance()->unescapeMysqlWildcards($db) + . PMA_Util::backquote( + PMA_Util::unescapeMysqlWildcards($db) ) - . '.' . PMA_CommonFunctions::getInstance()->backquote($table) . ';' + . '.' . PMA_Util::backquote($table) . ';' ); $columns = array(); if ($res) { @@ -1193,7 +1193,7 @@ function PMA_getHtmlForDisplayLoginInformationFields($mode = 'new') . htmlspecialchars(isset($GLOBALS['hostname']) ? $GLOBALS['hostname'] : '') . '" title="' . __('Host') . '" onchange="pred_hostname.value = \'userdefined\';" />' . "\n" - . PMA_CommonFunctions::getInstance()->showHint( + . PMA_Util::showHint( __('When Host table is used, this field is ignored and values stored in Host table are used instead.') ) . '</div>' . "\n"; @@ -1289,8 +1289,8 @@ function PMA_getGrants($user, $host) { $grants = PMA_DBI_fetch_result( "SHOW GRANTS FOR '" - . PMA_CommonFunctions::getInstance()->sqlAddSlashes($user) . "'@'" - . PMA_CommonFunctions::getInstance()->sqlAddSlashes($host) . "'" + . PMA_Util::sqlAddSlashes($user) . "'@'" + . PMA_Util::sqlAddSlashes($host) . "'" ); $response = ''; foreach ($grants as $one_grant) { @@ -1706,7 +1706,7 @@ function PMA_getHtmlTableBodyForSpecificDbPrivs($found, $row, $odd_row, if (! isset($current['Db']) || $current['Db'] == '*') { $html_output .= __('global'); } elseif ( - $current['Db'] == PMA_CommonFunctions::getInstance()->escapeMysqlWildcards( + $current['Db'] == PMA_Util::escapeMysqlWildcards( $_REQUEST['checkprivs'] ) ) { @@ -1839,7 +1839,7 @@ function PMA_getExtraDataForAjaxBehavior($password, $link_export, $sql_query, if (strlen($sql_query)) { $extra_data['sql_query'] - = PMA_CommonFunctions::getInstance()->getMessage(null, $sql_query); + = PMA_Util::getMessage(null, $sql_query); } if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { @@ -1963,7 +1963,7 @@ function PMA_getChangeLoginInformationHtmlForm($username, $hostname) . ' <legend>' . __('Create a new user with the same privileges and ...') . '</legend>' . "\n"; - $html_output .= PMA_CommonFunctions::getInstance()->getRadioFields( + $html_output .= PMA_Util::getRadioFields( 'mode', $choices, '4', true ); $html_output .= '</fieldset>' . "\n" @@ -1994,7 +1994,7 @@ function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename) . ' <a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $GLOBALS['url_query'] . '&db=' . $url_dbname . '&reload=1">' . htmlspecialchars($dbname) . ': ' - . PMA_CommonFunctions::getInstance()->getTitleForTarget( + . PMA_Util::getTitleForTarget( $GLOBALS['cfg']['DefaultTabDatabase'] ) . "</a> ]\n"; @@ -2005,7 +2005,7 @@ function PMA_getLinkToDbAndTable($url_dbname, $dbname, $tablename) . '&db=' . $url_dbname . '&table=' . htmlspecialchars(urlencode($tablename)) . '&reload=1">' . htmlspecialchars($tablename) . ': ' - . PMA_CommonFunctions::getInstance()->getTitleForTarget( + . PMA_Util::getTitleForTarget( $GLOBALS['cfg']['DefaultTabTable'] ) . "</a> ]\n"; @@ -2844,7 +2844,7 @@ function PMA_getAddUserHtmlFieldset($conditional_class) . '<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&adduser=1" ' . 'class="' . $conditional_class . '">' . "\n" - . PMA_CommonFunctions::getInstance()->getIcon('b_usradd.png') + . PMA_Util::getIcon('b_usradd.png') . ' ' . __('Add user') . '</a>' . "\n" . '</fieldset>' . "\n"; } @@ -2865,7 +2865,7 @@ function PMA_getHtmlHeaderForDisplayUserProperties( $dbname_is_wildcard, $url_dbname, $dbname, $username, $hostname, $tablename ) { $html_output = '<h2>' . "\n" - . PMA_CommonFunctions::getInstance()->getIcon('b_usredit.png') + . PMA_Util::getIcon('b_usredit.png') . __('Edit Privileges') . ': ' . __('User'); @@ -2919,7 +2919,7 @@ function PMA_getHtmlForDisplayUserOverviewPage($link_edit, $pmaThemeImage, $text_dir, $conditional_class, $link_export ) { $html_output = '<h2>' . "\n" - . PMA_CommonFunctions::getInstance()->getIcon('b_usrlist.png') + . PMA_Util::getIcon('b_usrlist.png') . __('Users overview') . "\n" . '</h2>' . "\n"; diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php index 4d7f780e13..27d89128e6 100644 --- a/libraries/server_synchronize.lib.php +++ b/libraries/server_synchronize.lib.php @@ -426,8 +426,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_CommonFunctions::getInstance()->backquote($src_db) . "." - . PMA_CommonFunctions::getInstance()->backquote($source_tables_uncommon[$index]); + $query = "SELECT COUNT(*) FROM " . PMA_Util::backquote($src_db) . "." + . PMA_Util::backquote($source_tables_uncommon[$index]); $rows = PMA_DBI_fetch_result($query, null, null, $src_link); $row_count[$index] = $rows[0]; } diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index cb0129e7c7..0419c97263 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -288,7 +288,7 @@ function PMA_sqlQueryFormInsert( .'multiple="multiple" ondblclick="insertValueQuery()">' . "\n"; foreach ($fields_list as $field) { echo '<option value="' - .PMA_CommonFunctions::getInstance()->backquote(htmlspecialchars($field['Field'])) . '"'; + .PMA_Util::backquote(htmlspecialchars($field['Field'])) . '"'; if (isset($field['Field']) && strlen($field['Field']) && isset($field['Comment']) @@ -411,7 +411,7 @@ function PMA_sqlQueryFormBookmark() echo '</div>' . "\n"; echo '<div class="formelement">' . "\n"; echo __('Variable'); - echo PMA_CommonFunctions::getInstance()->showDocu('faqbookmark'); + echo PMA_Util::showDocu('faqbookmark'); echo '<input type="text" name="bookmark_variable" class="textfield"' .' size="10" />' . "\n"; echo '</div>' . "\n"; diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index ed5799ecd7..fb1f27acaf 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -125,7 +125,7 @@ function PMA_getTableDropQueryAndMessage($table_is_view, $current_table) { $drop_query = 'DROP ' . (($table_is_view || $current_table['ENGINE'] == null) ? 'VIEW' : 'TABLE') - . ' ' . PMA_CommonFunctions::getInstance()->backquote( + . ' ' . PMA_Util::backquote( $current_table['TABLE_NAME'] ); $drop_message = sprintf( @@ -360,7 +360,7 @@ function PMA_getHtmlForTablePrintViewLink($url_query) { return '<p>' . '<a href="db_printview.php?' . $url_query . '">' - . PMA_CommonFunctions::getInstance()->getIcon( + . PMA_Util::getIcon( 'b_print.png', __('Print view'), true @@ -377,7 +377,7 @@ function PMA_getHtmlForTablePrintViewLink($url_query) function PMA_getHtmlForDataDictionaryLink($url_query) { return '<a href="db_datadict.php?' . $url_query . '">' - . PMA_CommonFunctions::getInstance()->getIcon( + . PMA_Util::getIcon( 'b_tblanalyse.png', __('Data Dictionary'), true @@ -775,7 +775,7 @@ function PMA_TableHeader($db_is_information_schema = false, $replication = false .'</th>' // larger values are more interesting so default sort order is DESC .'<th>' . PMA_sortableTableHeader(__('Rows'), 'records', 'DESC') - . PMA_CommonFunctions::getInstance()->showHint( + . PMA_Util::showHint( PMA_sanitize( __('May be approximate. See [doc@faq3_11]FAQ 3.11[/doc]') ) @@ -907,7 +907,7 @@ function PMA_sortableTableHeader($title, $sort, $initial_sort_order = 'ASC') // We set the position back to 0 every time they sort. $url .= "&pos=0&sort=$sort&sort_order=$future_sort_order"; - return PMA_CommonFunctions::getInstance()->linkOrButton( + return PMA_Util::linkOrButton( $url, $title . $order_img, $order_link_params ); } @@ -1606,7 +1606,7 @@ function PMA_getHtmlForAddColumn($columns_list) */ function PMA_getHtmlForDisplayIndexes() { - $html_output = PMA_CommonFunctions::getInstance()->getDivForSliderEffect( + $html_output = PMA_Util::getDivForSliderEffect( 'indexes', __('Indexes') ); $html_output .= PMA_Index::getView($GLOBALS['table'], $GLOBALS['db']); diff --git a/libraries/tbl_common.inc.php b/libraries/tbl_common.inc.php index 7751afcf7e..a65e507e10 100644 --- a/libraries/tbl_common.inc.php +++ b/libraries/tbl_common.inc.php @@ -15,7 +15,7 @@ if (! defined('PHPMYADMIN')) { require_once './libraries/bookmark.lib.php'; // Check parameters -PMA_CommonFunctions::getInstance()->checkParameters(array('db', 'table')); +PMA_Util::checkParameters(array('db', 'table')); $db_is_information_schema = PMA_is_system_schema($db); diff --git a/libraries/tbl_info.inc.php b/libraries/tbl_info.inc.php index 9b06b3c002..7347a8497b 100644 --- a/libraries/tbl_info.inc.php +++ b/libraries/tbl_info.inc.php @@ -13,7 +13,7 @@ if (! defined('PHPMYADMIN')) { } // Check parameters -PMA_CommonFunctions::getInstance()->checkParameters(array('db', 'table')); +PMA_Util::checkParameters(array('db', 'table')); /** * Defining global variables, in case this script is included by a function. diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index a2d8fe1915..7b0d099349 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -84,7 +84,7 @@ $content_cells = array(); $header_cells[] = __('Name'); $header_cells[] = __('Type') - . PMA_CommonFunctions::getInstance()->showMySQLDocu('SQL-Syntax', 'data-types'); + . PMA_Util::showMySQLDocu('SQL-Syntax', 'data-types'); $header_cells[] = __('Length/Values') . PMA_Util::showHint(__('If column type is "enum" or "set", please enter the values using this format: \'a\',\'b\',\'c\'...<br />If you ever need to put a backslash ("\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').')); $header_cells[] = __('Default') . PMA_Util::showHint(__('For default values, please enter just a single value, without backslash escaping or quotes, using this format: a')); diff --git a/libraries/user_preferences.inc.php b/libraries/user_preferences.inc.php index bad8f4e3d7..69d1db1849 100644 --- a/libraries/user_preferences.inc.php +++ b/libraries/user_preferences.inc.php @@ -23,7 +23,7 @@ $tabs_icons = array( 'Import' => 'b_import.png', 'Export' => 'b_export.png'); echo '<ul id="topmenu2">'; -echo PMA_CommonFunctions::getInstance()->getHtmlTab( +echo PMA_Util::getHtmlTab( array( 'link' => 'prefs_manage.php', 'text' => __('Manage your settings') @@ -37,7 +37,7 @@ foreach (array_keys($forms) as $formset) { 'text' => PMA_lang('Form_' . $formset), 'icon' => $tabs_icons[$formset], 'active' => ($script_name == 'prefs_forms.php' && $formset == $form_param)); - echo PMA_CommonFunctions::getInstance()->getHtmlTab($tab, array('form' => $formset)) . "\n"; + echo PMA_Util::getHtmlTab($tab, array('form' => $formset)) . "\n"; } echo '</ul><div class="clearfloat"></div>'; @@ -568,7 +568,7 @@ function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = nu echo '</a>' . "\n"; } if (null !== $mysql_help_page) { - echo PMA_CommonFunctions::getInstance()->showMySQLDocu('', $mysql_help_page); + echo PMA_Util::showMySQLDocu('', $mysql_help_page); } echo '</li>'; } diff --git a/pmd_general.php b/pmd_general.php index 690107e50a..5604614e65 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -305,7 +305,7 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) { onmouseout="this.className = old_class;" onmousedown="Click_field('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',"; - if (!PMA_CommonFunctions::getInstance()->isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) { + if (!PMA_Util::isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) { echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0); } else { // if foreign keys are supported, it's not necessary that the diff --git a/prefs_manage.php b/prefs_manage.php index 6de37a9033..5e38a4fbca 100644 --- a/prefs_manage.php +++ b/prefs_manage.php @@ -240,7 +240,7 @@ PMA_printJsValue("PMA_messages['strSavedOn']", __('Saved on: @DATE@')); <h2><?php echo __('Import') ?></h2> <form class="group-cnt prefs-form" name="prefs_import" action="prefs_manage.php" method="post" enctype="multipart/form-data"> <?php - echo PMA_CommonFunctions::getInstance()->generateHiddenMaxFileSize($max_upload_size) . "\n"; + echo PMA_Util::generateHiddenMaxFileSize($max_upload_size) . "\n"; echo PMA_generate_common_hidden_inputs() . "\n"; ?> <input type="hidden" name="json" value="" /> @@ -284,7 +284,7 @@ PMA_printJsValue("PMA_messages['strSavedOn']", __('Saved on: @DATE@')); <div class="group-cnt"> <?php echo sprintf(__('You can set more settings by modifying config.inc.php, eg. by using %sSetup script%s.'), '<a href="setup/index.php">', '</a>'); - echo PMA_CommonFunctions::getInstance()->showDocu('setup_script'); + echo PMA_Util::showDocu('setup_script'); ?> </div> </div> diff --git a/server_collations.php b/server_collations.php index 2e3e7dd742..2af16473d8 100644 --- a/server_collations.php +++ b/server_collations.php @@ -20,7 +20,7 @@ require 'libraries/server_common.inc.php'; * Displays the sub-page heading */ echo '<h2>' . "\n" - . ' ' . PMA_CommonFunctions::getInstance()->getImage('s_asci.png') + . ' ' . PMA_Util::getImage('s_asci.png') . '' . __('Character Sets and Collations') . "\n" . '</h2>' . "\n"; diff --git a/server_plugins.php b/server_plugins.php index 0587bdaeb3..fdc0bfd2c0 100644 --- a/server_plugins.php +++ b/server_plugins.php @@ -29,7 +29,7 @@ require 'libraries/server_common.inc.php'; * Displays the sub-page heading */ echo '<h2>' . "\n" - . PMA_CommonFunctions::getInstance()->getImage('b_engine.png') + . PMA_Util::getImage('b_engine.png') . "\n" . __('Plugins') . "\n" . '</h2>' . "\n"; @@ -86,7 +86,7 @@ pma_theme_image = '<?php echo $GLOBALS['pmaThemeImage']; ?>'; <caption class="tblHeaders"> <a class="top" href="#serverinfo"><?php echo __('Begin'); - echo PMA_CommonFunctions::getInstance()->getImage('s_asc.png'); + echo PMA_Util::getImage('s_asc.png'); ?></a> <?php echo htmlspecialchars($plugin_type); ?> </caption> diff --git a/server_synchronize.php b/server_synchronize.php index 41e5b65652..e238736cf2 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -1317,7 +1317,7 @@ if (! isset($_REQUEST['submit_connect']) /** * Displays the sub-page heading */ - echo '<h2>' . PMA_CommonFunctions::getInstance()->getImage('s_sync.png') . __('Synchronize') .'</h2>'; + echo '<h2>' . PMA_Util::getImage('s_sync.png') . __('Synchronize') .'</h2>'; echo '<div id="serverstatus"> <form name="connection_form" id="connection_form" method="post" action="server_synchronize.php" @@ -1355,7 +1355,7 @@ if (! isset($_REQUEST['submit_connect']) $database_header = __('Target database'); } - $database_header .= PMA_CommonFunctions::getInstance()->showHint( + $database_header .= PMA_Util::showHint( PMA_sanitize( sprintf( '%sAllowArbitraryServer%s', diff --git a/tbl_alter.php b/tbl_alter.php index f7febd59ef..45c60fb76b 100644 --- a/tbl_alter.php +++ b/tbl_alter.php @@ -177,7 +177,7 @@ if (isset($_REQUEST['do_save_data'])) { $fields = array(); foreach ($key_fields as $each_field) { if (isset($_REQUEST['field_name'][$each_field]) && strlen($_REQUEST['field_name'][$each_field])) { - $fields[] = PMA_CommonFunctions::getInstance()->backquote($_REQUEST['field_name'][$each_field]); + $fields[] = PMA_Util::backquote($_REQUEST['field_name'][$each_field]); } } // end for $key_query = ', ADD KEY (' . implode(', ', $fields) . ') '; diff --git a/tbl_export.php b/tbl_export.php index 86f913d2b7..49e9f4c26c 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -79,7 +79,7 @@ if (! empty($sql_query)) { // Just crop LIMIT clause $sql_query = $analyzed_sql[0]['section_before_limit'] . $analyzed_sql[0]['section_after_limit']; } - echo PMA_CommonFunctions::getInstance()->getMessage(PMA_Message::success()); + echo PMA_Util::getMessage(PMA_Message::success()); } $export_type = 'table'; diff --git a/tbl_indexes.php b/tbl_indexes.php index 14477a6f5f..58446bcc82 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -206,7 +206,7 @@ if ($GLOBALS['is_ajax_request'] != true) { <label for="input_index_name"> <?php echo __('Index name:'); ?> <?php -echo PMA_CommonFunctions::getInstance()->showHint( +echo PMA_Util::showHint( PMA_Message::notice( __( '("PRIMARY" <b>must</b> be the name of' diff --git a/tbl_printview.php b/tbl_printview.php index 7ea8fcc8e0..f6473d2018 100644 --- a/tbl_printview.php +++ b/tbl_printview.php @@ -102,7 +102,7 @@ foreach ($the_tables as $key => $table) { $show_create_table = PMA_DBI_fetch_value( 'SHOW CREATE TABLE ' . PMA_Util::backquote($db) . '.' - . PMA_CommonFunctions::getInstance()->backquote($table), + . PMA_Util::backquote($table), 0, 1 ); $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); diff --git a/tbl_relation.php b/tbl_relation.php index 6bcf7b58b1..477c30180a 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -492,7 +492,7 @@ if (count($columns) > 0) { <select name="destination_foreign[<?php echo $myfield_md5; ?>]" class="referenced_column_dropdown"> <?php if (isset($existrel_foreign[$myfield])) { - // need to PMA_CommonFunctions::getInstance()->backquote to support a dot character inside + // need to PMA_Util::backquote to support a dot character inside // an element $foreign_field = PMA_Util::backquote($existrel_foreign[$myfield]['foreign_db']) . '.' . PMA_Util::backquote($existrel_foreign[$myfield]['foreign_table']) . '.' diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php index f3afae71c4..44894d28d9 100644 --- a/tbl_zoom_select.php +++ b/tbl_zoom_select.php @@ -149,7 +149,7 @@ if (isset($zoom_submit) $tmpRow[] = $val; } //Get unique conditon on each row (will be needed for row update) - $uniqueCondition = PMA_CommonFunctions::getInstance()->getUniqueCondition( + $uniqueCondition = PMA_Util::getUniqueCondition( $result, count($table_search->getColumnNames()), $fields_meta, $tmpRow, true ); diff --git a/test/libraries/common/PMA_browseUploadFile_test.php b/test/libraries/common/PMA_browseUploadFile_test.php index 4a3cdcc9b7..2734c25f38 100644 --- a/test/libraries/common/PMA_browseUploadFile_test.php +++ b/test/libraries/common/PMA_browseUploadFile_test.php @@ -44,7 +44,7 @@ class PMA_getBrowseUploadFileBlock_test extends PHPUnit_Framework_TestCase function testBrowseUploadFile($size, $unit, $res) { $this->assertEquals( - PMA_CommonFunctions::getInstance()->getBrowseUploadFileBlock($size), + PMA_Util::getBrowseUploadFileBlock($size), '<label for="input_import_file">' . __("Browse your computer:") . '</label>' . '<div id="upload_form_status" style="display: none;"></div>' . '<div id="upload_form_status_info" style="display: none;"></div>' diff --git a/test/libraries/common/PMA_cache_test.php b/test/libraries/common/PMA_cache_test.php index d8cf2f0a2c..6336a8c253 100644 --- a/test/libraries/common/PMA_cache_test.php +++ b/test/libraries/common/PMA_cache_test.php @@ -40,12 +40,12 @@ class PMA_cache_test extends PHPUnit_Framework_TestCase public function testCacheExists() { $GLOBALS['server'] = 'server'; - PMA_CommonFunctions::getInstance()->cacheSet('test_data', 5, true); - PMA_CommonFunctions::getInstance()->cacheSet('test_data_2', 5, true); + PMA_Util::cacheSet('test_data', 5, true); + PMA_Util::cacheSet('test_data_2', 5, true); - $this->assertTrue(PMA_CommonFunctions::getInstance()->cacheExists('test_data', true)); - $this->assertTrue(PMA_CommonFunctions::getInstance()->cacheExists('test_data_2', 'server')); - $this->assertFalse(PMA_CommonFunctions::getInstance()->cacheExists('fake_data_2', true)); + $this->assertTrue(PMA_Util::cacheExists('test_data', true)); + $this->assertTrue(PMA_Util::cacheExists('test_data_2', 'server')); + $this->assertFalse(PMA_Util::cacheExists('fake_data_2', true)); } /** @@ -54,12 +54,12 @@ class PMA_cache_test extends PHPUnit_Framework_TestCase public function testCacheGet() { $GLOBALS['server'] = 'server'; - PMA_CommonFunctions::getInstance()->cacheSet('test_data', 5, true); - PMA_CommonFunctions::getInstance()->cacheSet('test_data_2', 5, true); + PMA_Util::cacheSet('test_data', 5, true); + PMA_Util::cacheSet('test_data_2', 5, true); - $this->assertNotNull(PMA_CommonFunctions::getInstance()->cacheGet('test_data', true)); - $this->assertNotNull(PMA_CommonFunctions::getInstance()->cacheGet('test_data_2', 'server')); - $this->assertNull(PMA_CommonFunctions::getInstance()->cacheGet('fake_data_2', true)); + $this->assertNotNull(PMA_Util::cacheGet('test_data', true)); + $this->assertNotNull(PMA_Util::cacheGet('test_data_2', 'server')); + $this->assertNull(PMA_Util::cacheGet('fake_data_2', true)); } /** @@ -68,11 +68,11 @@ class PMA_cache_test extends PHPUnit_Framework_TestCase public function testCacheSetGet() { $GLOBALS['server'] = 'server'; - PMA_CommonFunctions::getInstance()->cacheSet('test_data', 25, true); + PMA_Util::cacheSet('test_data', 25, true); - PMA_CommonFunctions::getInstance()->cacheSet('test_data', 5, true); + PMA_Util::cacheSet('test_data', 5, true); $this->assertEquals(5, $_SESSION['cache']['server_server']['test_data']); - PMA_CommonFunctions::getInstance()->cacheSet('test_data_3', 3, true); + PMA_Util::cacheSet('test_data_3', 3, true); $this->assertEquals(3, $_SESSION['cache']['server_server']['test_data_3']); } @@ -82,12 +82,12 @@ class PMA_cache_test extends PHPUnit_Framework_TestCase public function testCacheUnSet() { $GLOBALS['server'] = 'server'; - PMA_CommonFunctions::getInstance()->cacheSet('test_data', 25, true); - PMA_CommonFunctions::getInstance()->cacheSet('test_data_2', 25, true); + PMA_Util::cacheSet('test_data', 25, true); + PMA_Util::cacheSet('test_data_2', 25, true); - PMA_CommonFunctions::getInstance()->cacheUnset('test_data', true); + PMA_Util::cacheUnset('test_data', true); $this->assertArrayNotHasKey('test_data', $_SESSION['cache']['server_server']); - PMA_CommonFunctions::getInstance()->cacheUnset('test_data_2', true); + PMA_Util::cacheUnset('test_data_2', true); $this->assertArrayNotHasKey('test_data_2', $_SESSION['cache']['server_server']); } @@ -97,10 +97,10 @@ class PMA_cache_test extends PHPUnit_Framework_TestCase public function testClearUserCache() { $GLOBALS['server'] = 'server'; - PMA_CommonFunctions::getInstance()->cacheSet('is_superuser', 'yes', true); + PMA_Util::cacheSet('is_superuser', 'yes', true); $this->assertEquals('yes', $_SESSION['cache']['server_server']['is_superuser']); - PMA_CommonFunctions::getInstance()->clearUserCache(); + PMA_Util::clearUserCache(); $this->assertArrayNotHasKey('is_superuser', $_SESSION['cache']['server_server']); } } diff --git a/test/libraries/common/PMA_checkParameters_test.php b/test/libraries/common/PMA_checkParameters_test.php index b4b27c43fc..6f5c62ffc4 100644 --- a/test/libraries/common/PMA_checkParameters_test.php +++ b/test/libraries/common/PMA_checkParameters_test.php @@ -35,7 +35,7 @@ class PMA_checkParameters_test extends PHPUnit_Framework_TestCase $this->expectOutputRegex("/Missing parameter: field/"); - PMA_CommonFunctions::getInstance()->checkParameters( + PMA_Util::checkParameters( array('db', 'table', 'field') ); } @@ -50,7 +50,7 @@ class PMA_checkParameters_test extends PHPUnit_Framework_TestCase $GLOBALS['sql_query'] = "SELECT * FROM tblTable;"; $this->expectOutputString(""); - PMA_CommonFunctions::getInstance()->checkParameters( + PMA_Util::checkParameters( array('db', 'table', 'field', 'sql_query') ); } diff --git a/test/libraries/common/PMA_contains_nonprintable_ascii_test.php b/test/libraries/common/PMA_contains_nonprintable_ascii_test.php index 219b74d9f1..ec8f9a2450 100644 --- a/test/libraries/common/PMA_contains_nonprintable_ascii_test.php +++ b/test/libraries/common/PMA_contains_nonprintable_ascii_test.php @@ -32,7 +32,7 @@ class PMA_ContainsNonPrintableAsciiTest extends PHPUnit_Framework_TestCase function testContainsNonPrintableAscii($str, $res) { $this->assertEquals( - $res, PMA_CommonFunctions::getInstance()->containsNonPrintableAscii($str) + $res, PMA_Util::containsNonPrintableAscii($str) ); } diff --git a/test/libraries/common/PMA_convert_bit_default_value_test.php b/test/libraries/common/PMA_convert_bit_default_value_test.php index bfafe8a52f..dc7e58abed 100644 --- a/test/libraries/common/PMA_convert_bit_default_value_test.php +++ b/test/libraries/common/PMA_convert_bit_default_value_test.php @@ -30,7 +30,7 @@ class PMA_ConvertBitDefaultValueTest extends PHPUnit_Framework_TestCase function testConvert_bit_default_value_test($bit, $val) { $this->assertEquals( - $val, PMA_CommonFunctions::getInstance()->convertBitDefaultValue($bit) + $val, PMA_Util::convertBitDefaultValue($bit) ); } diff --git a/test/libraries/common/PMA_escapeMySqlWildcards_test.php b/test/libraries/common/PMA_escapeMySqlWildcards_test.php index 5325421b69..54e8e5ede0 100644 --- a/test/libraries/common/PMA_escapeMySqlWildcards_test.php +++ b/test/libraries/common/PMA_escapeMySqlWildcards_test.php @@ -37,7 +37,7 @@ class PMA_EscapeMySqlWildcardsTest extends PHPUnit_Framework_TestCase public function testEscape($a, $b) { $this->assertEquals( - $a, PMA_CommonFunctions::getInstance()->escapeMysqlWildcards($b) + $a, PMA_Util::escapeMysqlWildcards($b) ); } @@ -49,7 +49,7 @@ class PMA_EscapeMySqlWildcardsTest extends PHPUnit_Framework_TestCase public function testUnEscape($a, $b) { $this->assertEquals( - $b, PMA_CommonFunctions::getInstance()->unescapeMysqlWildcards($a) + $b, PMA_Util::unescapeMysqlWildcards($a) ); } } diff --git a/test/libraries/common/PMA_expandUserString_test.php b/test/libraries/common/PMA_expandUserString_test.php index 4165f4e758..2e04e9f13b 100644 --- a/test/libraries/common/PMA_expandUserString_test.php +++ b/test/libraries/common/PMA_expandUserString_test.php @@ -54,7 +54,7 @@ class PMA_expandUserString_test extends PHPUnit_Framework_TestCase { $out = str_replace('PMA_VERSION', PMA_VERSION, $out); $this->assertEquals( - $out, PMA_CommonFunctions::getInstance()->expandUserString($in) + $out, PMA_Util::expandUserString($in) ); } @@ -73,7 +73,7 @@ class PMA_expandUserString_test extends PHPUnit_Framework_TestCase $out = str_replace('PMA_VERSION', PMA_VERSION, $out); $this->assertEquals( htmlspecialchars($out), - PMA_CommonFunctions::getInstance()->expandUserString( + PMA_Util::expandUserString( $in, 'htmlspecialchars' ) ); diff --git a/test/libraries/common/PMA_extractColumnSpec_test.php b/test/libraries/common/PMA_extractColumnSpec_test.php index 71a0ce7396..597e80b4fb 100644 --- a/test/libraries/common/PMA_extractColumnSpec_test.php +++ b/test/libraries/common/PMA_extractColumnSpec_test.php @@ -33,7 +33,7 @@ class PMA_extractColumnSpec_test extends PHPUnit_Framework_TestCase public function testParsing($in, $out) { $this->assertEquals( - $out, PMA_CommonFunctions::getInstance()->extractColumnSpec($in) + $out, PMA_Util::extractColumnSpec($in) ); } diff --git a/test/libraries/common/PMA_extractValueFromFormattedSize_test.php b/test/libraries/common/PMA_extractValueFromFormattedSize_test.php index 5d5c95c0c5..15e23bec49 100644 --- a/test/libraries/common/PMA_extractValueFromFormattedSize_test.php +++ b/test/libraries/common/PMA_extractValueFromFormattedSize_test.php @@ -19,7 +19,7 @@ class PMA_extractValueFromFormattedSize_test extends PHPUnit_Framework_TestCase { $this->assertEquals( -1, - PMA_CommonFunctions::getInstance()->extractValueFromFormattedSize(100) + PMA_Util::extractValueFromFormattedSize(100) ); } @@ -27,7 +27,7 @@ class PMA_extractValueFromFormattedSize_test extends PHPUnit_Framework_TestCase { $this->assertEquals( 10737418240, - PMA_CommonFunctions::getInstance()->extractValueFromFormattedSize("10GB") + PMA_Util::extractValueFromFormattedSize("10GB") ); } @@ -35,7 +35,7 @@ class PMA_extractValueFromFormattedSize_test extends PHPUnit_Framework_TestCase { $this->assertEquals( 15728640, - PMA_CommonFunctions::getInstance()->extractValueFromFormattedSize("15MB") + PMA_Util::extractValueFromFormattedSize("15MB") ); } @@ -43,7 +43,7 @@ class PMA_extractValueFromFormattedSize_test extends PHPUnit_Framework_TestCase { $this->assertEquals( 262144, - PMA_CommonFunctions::getInstance()->extractValueFromFormattedSize("256K") + PMA_Util::extractValueFromFormattedSize("256K") ); } } diff --git a/test/libraries/common/PMA_foreignKeySupported_test.php b/test/libraries/common/PMA_foreignKeySupported_test.php index ad55829b7b..3eeb6e9ba6 100644 --- a/test/libraries/common/PMA_foreignKeySupported_test.php +++ b/test/libraries/common/PMA_foreignKeySupported_test.php @@ -35,7 +35,7 @@ class PMA_IsForeignKeySupportedTest extends PHPUnit_Framework_TestCase public function testForeignkeySupported($a, $e) { $this->assertEquals( - $e, PMA_CommonFunctions::getInstance()->isForeignKeySupported($a) + $e, PMA_Util::isForeignKeySupported($a) ); } } diff --git a/test/libraries/common/PMA_formatNumberByteDown_test.php b/test/libraries/common/PMA_formatNumberByteDown_test.php index ef6df8d8cd..277e3df83c 100644 --- a/test/libraries/common/PMA_formatNumberByteDown_test.php +++ b/test/libraries/common/PMA_formatNumberByteDown_test.php @@ -72,7 +72,7 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase { $this->assertEquals( $d, - (string) PMA_CommonFunctions::getInstance()->formatNumber( + (string) PMA_Util::formatNumber( $a, $b, $c, false ) ); @@ -102,7 +102,7 @@ class PMA_formatNumberByteDown_test extends PHPUnit_Framework_TestCase */ public function testFormatByteDown($a, $b, $c, $e) { - $result = PMA_CommonFunctions::getInstance()->formatByteDown($a, $b, $c); + $result = PMA_Util::formatByteDown($a, $b, $c); $result[0] = trim($result[0]); $this->assertEquals($e, $result); } diff --git a/test/libraries/common/PMA_formatSql_test.php b/test/libraries/common/PMA_formatSql_test.php index 0e68ed5991..091b192c0a 100644 --- a/test/libraries/common/PMA_formatSql_test.php +++ b/test/libraries/common/PMA_formatSql_test.php @@ -51,7 +51,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $sql = "SELECT * FROM tTable;"; $this->assertEquals( "<pre>\n$sql\n</pre>", - PMA_CommonFunctions::getInstance()->formatSql($sql) + PMA_Util::formatSql($sql) ); } @@ -89,7 +89,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $this->assertEquals( $expected, - PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + PMA_Util::formatSql($sql, $unparsed) ); } @@ -139,7 +139,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a> <span class="syntax_punct">*</span> <br /><span class="syntax_alpha syntax_alpha_reservedWord">FROM</span> <span class="syntax_quote syntax_quote_backtick">`tTable`</span> <span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); } @@ -277,7 +277,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = '<span class="syntax"><span class="inner_sql"><span class="syntax_alpha syntax_alpha_reservedWord">SELECT</span></a> <span class="syntax_punct">*</span> <br /><span class="syntax_alpha syntax_alpha_reservedWord">FROM</span> <span class="syntax_quote syntax_quote_backtick">`tTable_A`</span> <span class="syntax_alpha syntax_alpha_identifier">A</span><br /><span class="syntax_alpha syntax_alpha_reservedWord">INNER</span> <span class="syntax_alpha syntax_alpha_reservedWord">JOIN</span> <span class="syntax_quote syntax_quote_backtick">`tTable_B`</span> <span class="syntax_alpha syntax_alpha_identifier">B</span> <span class="syntax_alpha syntax_alpha_reservedWord">ON</span> <span class="syntax_alpha syntax_alpha_identifier">B</span><span class="syntax_punct syntax_punct_qualifier">.</span><span class="syntax_alpha syntax_alpha_identifier">ID</span> <span class="syntax_punct">=</span></a> <span class="syntax_alpha syntax_alpha_identifier">A</span><span class="syntax_punct syntax_punct_qualifier">.</span><span class="syntax_alpha syntax_alpha_identifier">ID</span><span class="syntax_punct syntax_punct_queryend">;</span><br /><br /></span></span>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); } @@ -314,7 +314,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = '<span class="inner_sql">SELECT</a> 1 ;<br /><br /></span>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); } @@ -364,7 +364,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = '<span class="inner_sql">SELECT</a> * <br />FROM `tTable` ;<br /><br /></span>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); } @@ -501,7 +501,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = '<span class="inner_sql">SELECT</a> * <br />FROM `tTable_A` A<br />INNER JOIN `tTable_B` B ON B.ID =</a> A.ID;<br /><br /></span>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); } @@ -538,12 +538,12 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = "<span class=\"inner_sql\"><pre>\nSELECT 1;\n</pre></span>"; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); $expected = "SELECT 1;"; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql) + $expected, PMA_Util::formatSql($sql) ); } @@ -593,12 +593,12 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = "<span class=\"inner_sql\"><pre>\nSELECT * from `tTable`;\n</pre></span>"; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); $expected = "SELECT * from `tTable`;"; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql) + $expected, PMA_Util::formatSql($sql) ); } @@ -735,12 +735,12 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $expected = "<span class=\"inner_sql\"><pre>\nSELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;\n</pre></span>"; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql, $unparsed) + $expected, PMA_Util::formatSql($sql, $unparsed) ); $expected = 'SELECT * FROM `tTable_A` A INNER JOIN `tTable_B` B ON B.ID = A.ID;'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->formatSql($sql) + $expected, PMA_Util::formatSql($sql) ); } @@ -772,7 +772,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase ), 'len' => 3, ); - $this->assertEmpty(PMA_CommonFunctions::getInstance()->formatSql($sql)); + $this->assertEmpty(PMA_Util::formatSql($sql)); } function testFormatSQLError() @@ -782,7 +782,7 @@ class PMA_formatSql_test extends PHPUnit_Framework_TestCase $sql = array("raw" => "& \" < >"); $this->assertEquals( "& " < >", - PMA_CommonFunctions::getInstance()->formatSql($sql) + PMA_Util::formatSql($sql) ); $SQP_errorString = false; } diff --git a/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php b/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php index 4bbc585f1a..502fa748d5 100644 --- a/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php +++ b/test/libraries/common/PMA_generateHiddenMaxFileSize_test.php @@ -37,7 +37,7 @@ class PMA_generateHiddenMaxFileSize_test extends PHPUnit_Framework_TestCase function test_generateHiddenMaxFileSize($size) { $this->assertEquals( - PMA_CommonFunctions::getInstance()->generateHiddenMaxFileSize($size), + PMA_Util::generateHiddenMaxFileSize($size), '<input type="hidden" name="MAX_FILE_SIZE" value="' . $size . '" />' ); } diff --git a/test/libraries/common/PMA_getCheckbox_test.php b/test/libraries/common/PMA_getCheckbox_test.php index bf5c1e61e9..a79f56ccf0 100644 --- a/test/libraries/common/PMA_getCheckbox_test.php +++ b/test/libraries/common/PMA_getCheckbox_test.php @@ -20,7 +20,7 @@ class PMA_GetCheckboxTest extends PHPUnit_Framework_TestCase $label = "text_label_for_checkbox"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getCheckbox($name, $label, false, false), + PMA_Util::getCheckbox($name, $label, false, false), '<input type="checkbox" name="' . $name . '" id="' . $name . '" /><label for="' . $name . '">' . $label . '</label>' ); } @@ -31,7 +31,7 @@ class PMA_GetCheckboxTest extends PHPUnit_Framework_TestCase $label = "text_label_for_checkbox"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getCheckbox($name, $label, true, false), + PMA_Util::getCheckbox($name, $label, true, false), '<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" /><label for="' . $name . '">' . $label . '</label>' ); } @@ -42,7 +42,7 @@ class PMA_GetCheckboxTest extends PHPUnit_Framework_TestCase $label = "text_label_for_checkbox"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getCheckbox($name, $label, false, true), + PMA_Util::getCheckbox($name, $label, false, true), '<input type="checkbox" name="' . $name . '" id="' . $name . '" class="autosubmit" /><label for="' . $name . '">' . $label . '</label>' ); } @@ -53,7 +53,7 @@ class PMA_GetCheckboxTest extends PHPUnit_Framework_TestCase $label = "text_label_for_checkbox"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getCheckbox($name, $label, true, true), + PMA_Util::getCheckbox($name, $label, true, true), '<input type="checkbox" name="' . $name . '" id="' . $name . '" checked="checked" class="autosubmit" /><label for="' . $name . '">' . $label . '</label>' ); } diff --git a/test/libraries/common/PMA_getDbLink_test.php b/test/libraries/common/PMA_getDbLink_test.php index f56be0428e..d82983c7fe 100644 --- a/test/libraries/common/PMA_getDbLink_test.php +++ b/test/libraries/common/PMA_getDbLink_test.php @@ -30,7 +30,7 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase function testGetDbLinkEmpty() { $GLOBALS['db'] = null; - $this->assertEmpty(PMA_CommonFunctions::getInstance()->getDbLink()); + $this->assertEmpty(PMA_Util::getDbLink()); } function testGetDbLinkNull() @@ -43,7 +43,7 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase . '&server=99&lang=en&token=token" title="Jump to database "' . htmlspecialchars($database) . '".">' . htmlspecialchars($database) . '</a>', - PMA_CommonFunctions::getInstance()->getDbLink() + PMA_Util::getDbLink() ); } @@ -56,7 +56,7 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase . '&server=99&lang=en&token=token" title="Jump to database "' . htmlspecialchars($database) . '".">' . htmlspecialchars($database) . '</a>', - PMA_CommonFunctions::getInstance()->getDbLink($database) + PMA_Util::getDbLink($database) ); } @@ -70,7 +70,7 @@ class PMA_getDbLink_test extends PHPUnit_Framework_TestCase . '&server=99&lang=en&token=token" title="Jump to database "' . htmlspecialchars($database) . '".">' . htmlspecialchars($database) . '</a>', - PMA_CommonFunctions::getInstance()->getDbLink($database) + PMA_Util::getDbLink($database) ); } } diff --git a/test/libraries/common/PMA_getDivForSliderEffect_test.php b/test/libraries/common/PMA_getDivForSliderEffect_test.php index 731bafeeae..2798563fb3 100644 --- a/test/libraries/common/PMA_getDivForSliderEffect_test.php +++ b/test/libraries/common/PMA_getDivForSliderEffect_test.php @@ -23,7 +23,7 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase $message = "test_message"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getDivForSliderEffect($id, $message), + PMA_Util::getDivForSliderEffect($id, $message), '<div id="' . $id . '" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">' ); } @@ -37,7 +37,7 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase $message = "test_message"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getDivForSliderEffect($id, $message), + PMA_Util::getDivForSliderEffect($id, $message), '<div id="' . $id . '" style="display: none; overflow:auto;" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">' ); @@ -52,7 +52,7 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase $message = "test_message"; $this->assertEquals( - PMA_CommonFunctions::getInstance()->getDivForSliderEffect($id, $message), + PMA_Util::getDivForSliderEffect($id, $message), '<div id="' . $id . '">' ); } diff --git a/test/libraries/common/PMA_getDropdown_test.php b/test/libraries/common/PMA_getDropdown_test.php index 74f4600ee7..ca5fbeca0a 100644 --- a/test/libraries/common/PMA_getDropdown_test.php +++ b/test/libraries/common/PMA_getDropdown_test.php @@ -25,7 +25,7 @@ class PMA_GetDropdownTest extends PHPUnit_Framework_TestCase $this->assertEquals( $result, - PMA_CommonFunctions::getInstance()->getDropdown( + PMA_Util::getDropdown( $name, $choices, $active_choice, $id ) ); @@ -50,7 +50,7 @@ class PMA_GetDropdownTest extends PHPUnit_Framework_TestCase $this->assertEquals( $result, - PMA_CommonFunctions::getInstance()->getDropdown( + PMA_Util::getDropdown( $name, $choices, $active_choice, $id ) ); @@ -75,7 +75,7 @@ class PMA_GetDropdownTest extends PHPUnit_Framework_TestCase $this->assertEquals( $result, - PMA_CommonFunctions::getInstance()->getDropdown( + PMA_Util::getDropdown( $name, $choices, $active_choice, $id ) ); diff --git a/test/libraries/common/PMA_getFormattedMaximumUploadSize_test.php b/test/libraries/common/PMA_getFormattedMaximumUploadSize_test.php index 541c6a636f..9decb6f6e7 100644 --- a/test/libraries/common/PMA_getFormattedMaximumUploadSize_test.php +++ b/test/libraries/common/PMA_getFormattedMaximumUploadSize_test.php @@ -40,7 +40,7 @@ class PMA_getFormattedMaximumUploadSize_test extends PHPUnit_Framework_TestCase { $this->assertEquals( "(" . __('Max: '). $res . $unit .")", - PMA_CommonFunctions::getInstance()->getFormattedMaximumUploadSize($size) + PMA_Util::getFormattedMaximumUploadSize($size) ); } diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php index 02921f017f..c05ae50400 100644 --- a/test/libraries/common/PMA_getIcon_test.php +++ b/test/libraries/common/PMA_getIcon_test.php @@ -26,7 +26,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase $this->assertEquals( '<span class="nowrap"></span>', - PMA_CommonFunctions::getInstance()->getIcon('b_comment.png') + PMA_Util::getIcon('b_comment.png') ); } @@ -36,7 +36,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase $this->assertEquals( '<span class="nowrap"><img src="themes/dot.gif" title="" alt="" class="icon ic_b_comment" /></span>', - PMA_CommonFunctions::getInstance()->getIcon('b_comment.png') + PMA_Util::getIcon('b_comment.png') ); } @@ -48,7 +48,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase $this->assertEquals( '<span class="nowrap"><img src="themes/dot.gif" title="' . $alternate_text . '" alt="' . $alternate_text . '" class="icon ic_b_comment" /></span>', - PMA_CommonFunctions::getInstance()->getIcon('b_comment.png', $alternate_text) + PMA_Util::getIcon('b_comment.png', $alternate_text) ); } @@ -60,7 +60,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase $this->assertEquals( '<span class="nowrap"><img src="themes/dot.gif" title="' . $alternate_text . '" alt="' . $alternate_text . '" class="icon ic_b_comment" /> ' . $alternate_text . '</span>', - PMA_CommonFunctions::getInstance()->getIcon('b_comment.png', $alternate_text, true) + PMA_Util::getIcon('b_comment.png', $alternate_text, true) ); } diff --git a/test/libraries/common/PMA_getRadioFields_test.php b/test/libraries/common/PMA_getRadioFields_test.php index 26ce3a51ce..877e141301 100644 --- a/test/libraries/common/PMA_getRadioFields_test.php +++ b/test/libraries/common/PMA_getRadioFields_test.php @@ -20,7 +20,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase $choices = array(); $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields($name, $choices), + PMA_Util::getRadioFields($name, $choices), "" ); } @@ -41,7 +41,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields($name, $choices), + PMA_Util::getRadioFields($name, $choices), $out ); } @@ -66,7 +66,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields( + PMA_Util::getRadioFields( $name, $choices, $checked_choice ), $out @@ -96,7 +96,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields( + PMA_Util::getRadioFields( $name, $choices, $checked_choice, true, false, $class ), $out @@ -122,7 +122,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields( + PMA_Util::getRadioFields( $name, $choices, $checked_choice, false ), $out @@ -149,7 +149,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields( + PMA_Util::getRadioFields( $name, $choices, $checked_choice, true, true ), $out @@ -176,7 +176,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields( + PMA_Util::getRadioFields( $name, $choices, $checked_choice, true, false ), $out @@ -206,7 +206,7 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase } $this->assertEquals( - PMA_CommonFunctions::getInstance()->getRadioFields( + PMA_Util::getRadioFields( $name, $choices, $checked_choice, true, true, $class ), $out diff --git a/test/libraries/common/PMA_getTitleForTarget_test.php b/test/libraries/common/PMA_getTitleForTarget_test.php index 8cba850319..f056d6300f 100644 --- a/test/libraries/common/PMA_getTitleForTarget_test.php +++ b/test/libraries/common/PMA_getTitleForTarget_test.php @@ -38,7 +38,7 @@ class PMA_getTitleForTarget_test extends PHPUnit_Framework_TestCase function testGetTitleForTarget($target, $result) { $this->assertEquals( - $result, PMA_CommonFunctions::getInstance()->getTitleForTarget($target) + $result, PMA_Util::getTitleForTarget($target) ); } diff --git a/test/libraries/common/PMA_localisedDateTimespan_test.php b/test/libraries/common/PMA_localisedDateTimespan_test.php index 388a8cfe56..827ce7d58e 100644 --- a/test/libraries/common/PMA_localisedDateTimespan_test.php +++ b/test/libraries/common/PMA_localisedDateTimespan_test.php @@ -72,7 +72,7 @@ class PMA_localisedDateTimespan_test extends PHPUnit_Framework_TestCase public function testLocalisedDate($a, $b, $e) { $this->assertEquals( - $e, PMA_CommonFunctions::getInstance()->localisedDate($a, $b) + $e, PMA_Util::localisedDate($a, $b) ); } @@ -98,7 +98,7 @@ class PMA_localisedDateTimespan_test extends PHPUnit_Framework_TestCase $GLOBALS['timespanfmt'] = '%s days, %s hours, %s minutes and %s seconds'; $this->assertEquals( - $e, PMA_CommonFunctions::getInstance()->timespanFormat($a) + $e, PMA_Util::timespanFormat($a) ); } } diff --git a/test/libraries/common/PMA_pow_test.php b/test/libraries/common/PMA_pow_test.php index 46d1767ad5..5464cbd710 100644 --- a/test/libraries/common/PMA_pow_test.php +++ b/test/libraries/common/PMA_pow_test.php @@ -18,7 +18,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase { $this->assertEquals( '1267650600228229401496703205376', - PMA_CommonFunctions::getInstance()->pow(2, 100) + PMA_Util::pow(2, 100) ); } @@ -27,7 +27,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase if (function_exists('bcpow')) { $this->assertEquals( '1267650600228229401496703205376', - PMA_CommonFunctions::getInstance()->pow(2, 100, 'bcpow') + PMA_Util::pow(2, 100, 'bcpow') ); } else { $this->markTestSkipped('function bcpow() does not exist'); @@ -39,7 +39,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase if (function_exists('gmp_pow')) { $this->assertEquals( '1267650600228229401496703205376', - PMA_CommonFunctions::getInstance()->pow(2, 100, 'gmp_pow') + PMA_Util::pow(2, 100, 'gmp_pow') ); } else { $this->markTestSkipped('function gmp_pow() does not exist'); @@ -50,7 +50,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase { $this->assertEquals( 0.25, - PMA_CommonFunctions::getInstance()->pow(2, -2) + PMA_Util::pow(2, -2) ); } @@ -59,7 +59,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase if (function_exists('pow')) { $this->assertEquals( 0.25, - PMA_CommonFunctions::getInstance()->pow(2, -2, 'pow') + PMA_Util::pow(2, -2, 'pow') ); } else { $this->markTestSkipped('function pow() does not exist'); @@ -71,7 +71,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase if (function_exists('bcpow')) { $this->assertEquals( 0.25, - PMA_CommonFunctions::getInstance()->pow(2, -2, 'bcpow') + PMA_Util::pow(2, -2, 'bcpow') ); } else { $this->markTestSkipped('function bcpow() does not exist'); @@ -83,7 +83,7 @@ class PMA_pow_test extends PHPUnit_Framework_TestCase if (function_exists('gmp_pow')) { $this->assertEquals( 0.25, - PMA_CommonFunctions::getInstance()->pow(2, -2, 'gmp_pow') + PMA_Util::pow(2, -2, 'gmp_pow') ); } else { $this->markTestSkipped('function gmp_pow() does not exist'); diff --git a/test/libraries/common/PMA_printableBitValue_test.php b/test/libraries/common/PMA_printableBitValue_test.php index ca3718a5c4..91c5c684b6 100644 --- a/test/libraries/common/PMA_printableBitValue_test.php +++ b/test/libraries/common/PMA_printableBitValue_test.php @@ -36,7 +36,7 @@ class PMA_PrintableBitValueTest extends PHPUnit_Framework_TestCase public function testPrintableBitValue($a, $b, $e) { $this->assertEquals( - $e, PMA_CommonFunctions::getInstance()->printableBitValue($a, $b) + $e, PMA_Util::printableBitValue($a, $b) ); } } diff --git a/test/libraries/common/PMA_quoting_slashing_test.php b/test/libraries/common/PMA_quoting_slashing_test.php index 7335161d07..9151e8b134 100644 --- a/test/libraries/common/PMA_quoting_slashing_test.php +++ b/test/libraries/common/PMA_quoting_slashing_test.php @@ -56,7 +56,7 @@ class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase public function testUnQuote($param, $expected) { $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->unQuote($param) + $expected, PMA_Util::unQuote($param) ); } @@ -82,7 +82,7 @@ class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase public function testUnQuoteSelectedChar($param, $expected) { $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->unQuote($param, '"') + $expected, PMA_Util::unQuote($param, '"') ); } @@ -108,10 +108,10 @@ class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase public function testBackquote($a, $b) { // Test bypass quoting (used by dump functions) - $this->assertEquals($a, PMA_CommonFunctions::getInstance()->backquote($a, false)); + $this->assertEquals($a, PMA_Util::backquote($a, false)); // Test backquote - $this->assertEquals($b, PMA_CommonFunctions::getInstance()->backquote($a)); + $this->assertEquals($b, PMA_Util::backquote($a)); } /** @@ -136,17 +136,17 @@ class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase public function testbackquoteCompat($a, $b) { // Test bypass quoting (used by dump functions) - $this->assertEquals($a, PMA_CommonFunctions::getInstance()->backquoteCompat($a, 'NONE', false)); + $this->assertEquals($a, PMA_Util::backquoteCompat($a, 'NONE', false)); // Test backquote (backquoting will be enabled only if isset $GLOBALS['sql_backquotes'] - $this->assertEquals($a, PMA_CommonFunctions::getInstance()->backquoteCompat($a, 'NONE')); + $this->assertEquals($a, PMA_Util::backquoteCompat($a, 'NONE')); // Run tests in MSSQL compatibility mode // Test bypass quoting (used by dump functions) - $this->assertEquals($a, PMA_CommonFunctions::getInstance()->backquoteCompat($a, 'MSSQL', false)); + $this->assertEquals($a, PMA_Util::backquoteCompat($a, 'MSSQL', false)); // Test backquote - $this->assertEquals($b, PMA_CommonFunctions::getInstance()->backquoteCompat($a, 'MSSQL')); + $this->assertEquals($b, PMA_Util::backquoteCompat($a, 'MSSQL')); } public function testBackquoteForbidenWords() @@ -154,7 +154,7 @@ class PMA_quoting_slashing_test extends PHPUnit_Framework_TestCase global $PMA_SQPdata_forbidden_word; foreach ($PMA_SQPdata_forbidden_word as $forbidden) { - $this->assertEquals("`" . $forbidden . "`", PMA_CommonFunctions::getInstance()->backquote($forbidden, false)); + $this->assertEquals("`" . $forbidden . "`", PMA_Util::backquote($forbidden, false)); } } } diff --git a/test/libraries/common/PMA_showDocu_test.php b/test/libraries/common/PMA_showDocu_test.php index 85a5494a4e..3fd6904269 100644 --- a/test/libraries/common/PMA_showDocu_test.php +++ b/test/libraries/common/PMA_showDocu_test.php @@ -29,7 +29,7 @@ class PMA_showDocu_test extends PHPUnit_Framework_TestCase . 'alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->showDocu($anchor) + $expected, PMA_Util::showDocu($anchor) ); } diff --git a/test/libraries/common/PMA_showMessage_test_disabled.php b/test/libraries/common/PMA_showMessage_test_disabled.php index 87048ef2dd..d813d38aeb 100644 --- a/test/libraries/common/PMA_showMessage_test_disabled.php +++ b/test/libraries/common/PMA_showMessage_test_disabled.php @@ -63,9 +63,9 @@ class PMA_showMessage_test extends PHPUnit_Framework_TestCase ]</div></div>" ); - echo PMA_CommonFunctions::getInstance()->getMessage("msg"); + echo PMA_Util::getMessage("msg"); - //$this->assertEquals("", PMA_CommonFunctions::getInstance()->getMessage("msg")); + //$this->assertEquals("", PMA_Util::getMessage("msg")); $this->assertTrue(true); } } diff --git a/test/libraries/common/PMA_showPHPDocu_test.php b/test/libraries/common/PMA_showPHPDocu_test.php index 8be38433f8..be73ad0fed 100644 --- a/test/libraries/common/PMA_showPHPDocu_test.php +++ b/test/libraries/common/PMA_showPHPDocu_test.php @@ -36,7 +36,7 @@ class PMA_showPHPDocu_test extends PHPUnit_Framework_TestCase . __('Documentation') . '" alt="' . __('Documentation') . '" class="icon ic_b_help" /></a>'; $this->assertEquals( - $expected, PMA_CommonFunctions::getInstance()->showPHPDocu($target) + $expected, PMA_Util::showPHPDocu($target) ); } } diff --git a/test/libraries/common/PMA_stringOperations_test.php b/test/libraries/common/PMA_stringOperations_test.php index 76e84d601e..71b66b49ed 100644 --- a/test/libraries/common/PMA_stringOperations_test.php +++ b/test/libraries/common/PMA_stringOperations_test.php @@ -58,7 +58,7 @@ class PMA_stringOperations_test extends PHPUnit_Framework_TestCase public function testFlipString($a, $e) { - $this->assertEquals($e, PMA_CommonFunctions::getInstance()->flipstring($a)); + $this->assertEquals($e, PMA_Util::flipstring($a)); } /** @@ -83,7 +83,7 @@ class PMA_stringOperations_test extends PHPUnit_Framework_TestCase { $GLOBALS['cfg']['Server']['user'] = 'root'; - $this->assertEquals($e, PMA_CommonFunctions::getInstance()->userDir($a)); + $this->assertEquals($e, PMA_Util::userDir($a)); } /** @@ -108,7 +108,7 @@ class PMA_stringOperations_test extends PHPUnit_Framework_TestCase public function testReplaceBinaryContents($a, $e) { $this->assertEquals( - $e, PMA_CommonFunctions::getInstance()->replaceBinaryContents($a) + $e, PMA_Util::replaceBinaryContents($a) ); } @@ -135,7 +135,7 @@ class PMA_stringOperations_test extends PHPUnit_Framework_TestCase public function testDuplicateFirstNewline($a, $e) { $this->assertEquals( - $e, PMA_CommonFunctions::getInstance()->duplicateFirstNewline($a) + $e, PMA_Util::duplicateFirstNewline($a) ); } diff --git a/test/libraries/common/PMA_unsupportedDatatypes_test.php b/test/libraries/common/PMA_unsupportedDatatypes_test.php index 89e3748626..c4e3cdd67e 100644 --- a/test/libraries/common/PMA_unsupportedDatatypes_test.php +++ b/test/libraries/common/PMA_unsupportedDatatypes_test.php @@ -19,7 +19,7 @@ class PMA_unsupportedDatatypes_test extends PHPUnit_Framework_TestCase { $no_support_types = array(); $this->assertEquals( - $no_support_types, PMA_CommonFunctions::getInstance()->unsupportedDatatypes() + $no_support_types, PMA_Util::unsupportedDatatypes() ); } }
\ No newline at end of file diff --git a/test/libraries/common/PMA_whichCrlf_test.php b/test/libraries/common/PMA_whichCrlf_test.php index 3052e7d485..1d99240330 100644 --- a/test/libraries/common/PMA_whichCrlf_test.php +++ b/test/libraries/common/PMA_whichCrlf_test.php @@ -31,11 +31,11 @@ class PMA_whichCrlf_test extends PHPUnit_Framework_TestCase if (PMA_USR_OS == 'Win') { $this->assertEquals( - "\r\n", PMA_CommonFunctions::getInstance()->whichCrlf() + "\r\n", PMA_Util::whichCrlf() ); } else { $this->assertEquals( - "\n", PMA_CommonFunctions::getInstance()->whichCrlf() + "\n", PMA_Util::whichCrlf() ); } @@ -46,7 +46,7 @@ class PMA_whichCrlf_test extends PHPUnit_Framework_TestCase if ($runkit) { define('PMA_USR_OS', 'Linux'); $this->assertEquals( - "\n", PMA_CommonFunctions::getInstance()->whichCrlf() + "\n", PMA_Util::whichCrlf() ); } @@ -56,7 +56,7 @@ class PMA_whichCrlf_test extends PHPUnit_Framework_TestCase define('PMA_USR_OS', 'Win'); } $this->assertEquals( - "\r\n", PMA_CommonFunctions::getInstance()->whichCrlf() + "\r\n", PMA_Util::whichCrlf() ); } diff --git a/test/libraries/core/PMA_headerLocation_test.php b/test/libraries/core/PMA_headerLocation_test.php index 44394ec6cd..c9638aafaa 100644 --- a/test/libraries/core/PMA_headerLocation_test.php +++ b/test/libraries/core/PMA_headerLocation_test.php @@ -296,7 +296,7 @@ class PMA_headerLocation_test extends PHPUnit_Framework_TestCase '</script>' . PHP_EOL; $this->expectOutputString($write); - echo PMA_CommonFunctions::getInstance()->getReloadNavigationScript(); + echo PMA_Util::getReloadNavigationScript(); $this->assertFalse(isset($GLOBALS['reload'])); unset($GLOBALS['db']); diff --git a/test/theme.php b/test/theme.php index cb0b43825c..e589a4b21c 100644 --- a/test/theme.php +++ b/test/theme.php @@ -143,7 +143,7 @@ $tabs['import']['link'] = 'server_import.php'; $tabs['import']['text'] = 'active'; $tabs['import']['class'] = 'active'; -echo PMA_CommonFunctions::getInstance()->getHtmlTabs($tabs, array()); +echo PMA_Util::getHtmlTabs($tabs, array()); unset($tabs); if (@file_exists($pmaThemeImage . 'logo_right.png')) { diff --git a/transformation_wrapper.php b/transformation_wrapper.php index 457f371c33..a36d2f3c47 100644 --- a/transformation_wrapper.php +++ b/transformation_wrapper.php @@ -49,14 +49,14 @@ foreach ($request_params as $one_request_param) { PMA_DBI_select_db($db); if (isset($where_clause)) { $result = PMA_DBI_query( - 'SELECT * FROM ' . PMA_CommonFunctions::getInstance()->backquote($table) . ' WHERE ' . $where_clause . ';', + 'SELECT * FROM ' . PMA_Util::backquote($table) . ' WHERE ' . $where_clause . ';', null, PMA_DBI_QUERY_STORE ); $row = PMA_DBI_fetch_assoc($result); } else { $result = PMA_DBI_query( - 'SELECT * FROM ' . PMA_CommonFunctions::getInstance()->backquote($table) . ' LIMIT 1;', + 'SELECT * FROM ' . PMA_Util::backquote($table) . ' LIMIT 1;', null, PMA_DBI_QUERY_STORE ); diff --git a/user_password.php b/user_password.php index 15b3e7b2d4..42e95c0188 100644 --- a/user_password.php +++ b/user_password.php @@ -83,7 +83,7 @@ function PMA_getChangePassMessage($change_password_message, $sql_query = '') $response->addJSON('message', $change_password_message['msg']); $response->isSuccess(false); } else { - $sql_query = PMA_CommonFunctions::getInstance()->getMessage( + $sql_query = PMA_Util::getMessage( $change_password_message['msg'], $sql_query, 'success' @@ -232,7 +232,7 @@ function PMA_changePassAuthType($_url_params, $password) function PMA_changePassDisplayPage($message, $sql_query, $_url_params) { echo '<h1>' . __('Change password') . '</h1>' . "\n\n"; - echo PMA_CommonFunctions::getInstance()->getMessage( + echo PMA_Util::getMessage( $message, $sql_query, 'success' ); echo '<a href="index.php'.PMA_generate_common_url($_url_params) diff --git a/view_create.php b/view_create.php index b0b6e1d9ac..90fe555edb 100644 --- a/view_create.php +++ b/view_create.php @@ -47,7 +47,7 @@ if (isset($_REQUEST['createview'])) { $sql_query .= $sep . ' ALGORITHM = ' . $_REQUEST['view']['algorithm']; } - $sql_query .= $sep . ' VIEW ' . PMA_CommonFunctions::getInstance()->backquote($_REQUEST['view']['name']); + $sql_query .= $sep . ' VIEW ' . PMA_Util::backquote($_REQUEST['view']['name']); if (! empty($_REQUEST['view']['column_names'])) { $sql_query .= $sep . ' (' . $_REQUEST['view']['column_names'] . ')'; @@ -98,7 +98,7 @@ if (isset($_REQUEST['createview'])) { $response = PMA_Response::getInstance(); $response->addJSON( 'message', - PMA_CommonFunctions::getInstance()->getMessage( + PMA_Util::getMessage( PMA_Message::success(), $sql_query ) ); @@ -149,7 +149,7 @@ $url_params['reload'] = 1; <form method="post" action="view_create.php"> <?php echo PMA_generate_common_hidden_inputs($url_params); ?> <fieldset> - <legend><?php echo __('Create view') . PMA_CommonFunctions::getInstance()->showMySQLDocu('SQL-Syntax', 'CREATE_VIEW'); ?></legend> + <legend><?php echo __('Create view') . PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_VIEW'); ?></legend> <table class="rte_table"> <tr><td><label for="or_replace">OR REPLACE</label></td> <td><input type="checkbox" name="view[or_replace]" id="or_replace" diff --git a/view_operations.php b/view_operations.php index db80bc28c1..8283f42d17 100644 --- a/view_operations.php +++ b/view_operations.php @@ -64,7 +64,7 @@ if (isset($result)) { $_message->isError(true); unset($warning_messages); } - echo PMA_CommonFunctions::getInstance()->getMessage( + echo PMA_Util::getMessage( $_message, $sql_query, $_type, $is_view = true ); unset($_message, $_type); |