From 1419fcf3c2e597d7944fe75340f34b100779a30d Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 23 Oct 2009 10:02:09 +0000 Subject: [PATCH] remove deprecated parameter of PMA_Table::countRecords() --- db_qbe.php | 2 +- db_structure.php | 6 +++--- libraries/Table.class.php | 25 ++++--------------------- libraries/common.lib.php | 3 +-- libraries/display_export.lib.php | 2 +- libraries/display_tbl.lib.php | 2 +- libraries/relation.lib.php | 2 +- libraries/tbl_info.inc.php | 2 +- sql.php | 4 ++-- 9 files changed, 15 insertions(+), 33 deletions(-) diff --git a/db_qbe.php b/db_qbe.php index 6b358eb95..04a7e554d 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -802,7 +802,7 @@ if (isset($Field) && count($Field) > 0) { $checked_tables = $col_cand; foreach ($col_cand as $tab) { if ($checked_tables[$tab] != 1) { - $tsize[$tab] = PMA_Table::countRecords($db, $tab, true, false); + $tsize[$tab] = PMA_Table::countRecords($db, $tab, false); $checked_tables[$tab] = 1; } $csize[$tab] = $tsize[$tab]; diff --git a/db_structure.php b/db_structure.php index ef2351537..9bed614e1 100644 --- a/db_structure.php +++ b/db_structure.php @@ -192,7 +192,7 @@ foreach ($tables as $keyname => $each_table) { case 'MEMORY' : if ($db_is_information_schema) { $each_table['Rows'] = PMA_Table::countRecords($db, - $each_table['Name'], $return = true); + $each_table['Name']); } if ($is_show_stats) { @@ -212,7 +212,7 @@ foreach ($tables as $keyname => $each_table) { if ($each_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) { $each_table['COUNTED'] = true; $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, - $each_table['TABLE_NAME'], $return = true, $force_exact = true, + $each_table['TABLE_NAME'], $force_exact = true, $is_view = false); } else { $each_table['COUNTED'] = false; @@ -241,7 +241,7 @@ foreach ($tables as $keyname => $each_table) { if ($each_table['TABLE_TYPE'] == 'VIEW') { // countRecords() takes care of $cfg['MaxExactCountViews'] $each_table['TABLE_ROWS'] = PMA_Table::countRecords($db, - $each_table['TABLE_NAME'], $return = true, $force_exact = true, + $each_table['TABLE_NAME'], $force_exact = true, $is_view = true); $table_is_view = true; } diff --git a/libraries/Table.class.php b/libraries/Table.class.php index dc15b2aea..bddc1b15b 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -199,7 +199,7 @@ class PMA_Table if ($this->get('TABLE_ROWS') === null) { $this->set('TABLE_ROWS', PMA_Table::countRecords($this->getDbName(), - $this->getName(), true, true)); + $this->getName(), true)); } $create_options = explode(' ', $this->get('TABLE_ROWS')); @@ -241,7 +241,7 @@ class PMA_Table static public function sGetToolTip($db, $table) { return PMA_Table::sGetStatusInfo($db, $table, 'Comment') - . ' (' . PMA_Table::countRecords($db, $table, true) . ')'; + . ' (' . PMA_Table::countRecords($db, $table) . ')'; } /** @@ -403,7 +403,6 @@ class PMA_Table * * @param string the current database name * @param string the current table name - * @param boolean whether to retain or to displays the result * @param boolean whether to force an exact count * * @return mixed the number of records if "retain" param is true, @@ -411,8 +410,7 @@ class PMA_Table * * @access public */ - static public function countRecords($db, $table, $ret = false, - $force_exact = false, $is_view = null) + static public function countRecords($db, $table, $force_exact = false, $is_view = null) { if (isset(PMA_Table::$cache[$db][$table]['ExactRows'])) { $row_count = PMA_Table::$cache[$db][$table]['ExactRows']; @@ -464,22 +462,7 @@ class PMA_Table } } - if ($ret) { - return $row_count; - } - - /** - * @deprecated at the moment nowhere is $return = false used - */ - // Note: as of PMA 2.8.0, we no longer seem to be using - // PMA_Table::countRecords() in display mode. - echo PMA_formatNumber($row_count, 0); - if ($is_view) { - echo ' ' - . sprintf($GLOBALS['strViewHasAtLeast'], - $GLOBALS['cfg']['MaxExactCount'], - '[a@./Documentation.html#cfg_MaxExactCount@_blank]', '[/a]'); - } + return $row_count; } // end of the 'PMA_Table::countRecords()' function /** diff --git a/libraries/common.lib.php b/libraries/common.lib.php index f57164bf1..94d7d8240 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -811,8 +811,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = $tbl_is_view = PMA_Table::isView($db, $table['Name']); if ($tbl_is_view || 'information_schema' == $db) { - $table['Rows'] = PMA_Table::countRecords($db, $table['Name'], - $return = true); + $table['Rows'] = PMA_Table::countRecords($db, $table['Name']); } } diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index e3b533613..ec3ae7ae9 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -109,7 +109,7 @@ echo PMA_pluginGetJavascript($export_list); ', ' '); diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 259471ee3..c5d52a251 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -160,7 +160,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) $the_total = $unlim_num_rows; } elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1') && (strlen($db) && !empty($table))) { - $the_total = PMA_Table::countRecords($db, $table, true); + $the_total = PMA_Table::countRecords($db, $table); } // 4. If navigation bar or sorting fields names URLs should be diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 1544571d1..ab9465091 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -1003,7 +1003,7 @@ function PMA_getForeignData($foreigners, $field, $override_total, $foreign_filte // We could also do the SELECT anyway, with a LIMIT, and ensure that // the current value of the field is one of the choices. - $the_total = PMA_Table::countRecords($foreign_db, $foreign_table, TRUE); + $the_total = PMA_Table::countRecords($foreign_db, $foreign_table); if ($override_total == true || $the_total < $GLOBALS['cfg']['ForeignKeyMaxLimit']) { // foreign_display can be FALSE if no display field defined: diff --git a/libraries/tbl_info.inc.php b/libraries/tbl_info.inc.php index ab551b62f..5151acb08 100644 --- a/libraries/tbl_info.inc.php +++ b/libraries/tbl_info.inc.php @@ -86,7 +86,7 @@ if ($showtable) { if (null === $showtable['Rows']) { $showtable['Rows'] = PMA_Table::countRecords($GLOBALS['db'], - $showtable['Name'], true, true); + $showtable['Name'], true); } $table_info_num_rows = isset($showtable['Rows']) ? $showtable['Rows'] : 0; $row_format = isset($showtable['Row_format']) ? $showtable['Row_format'] : ''; diff --git a/sql.php b/sql.php index ed4f9c75e..997ce7555 100644 --- a/sql.php +++ b/sql.php @@ -96,7 +96,7 @@ PMA_displayTable_checkConfigParams(); * Need to find the real end of rows? */ if (isset($find_real_end) && $find_real_end) { - $unlim_num_rows = PMA_Table::countRecords($db, $table, true, true); + $unlim_num_rows = PMA_Table::countRecords($db, $table, $force_exact = true); $_SESSION['tmp_user_values']['pos'] = @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']) - 1) * $_SESSION['tmp_user_values']['max_rows']); } @@ -396,7 +396,7 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) { ) { // "j u s t b r o w s i n g" - $unlim_num_rows = PMA_Table::countRecords($db, $table, true); + $unlim_num_rows = PMA_Table::countRecords($db, $table); } else { // n o t " j u s t b r o w s i n g "