PMA_DBI_free_result() now accepts more than one resource to be freed

This commit is contained in:
Sebastian Mendel
2005-12-09 10:04:01 +00:00
parent a50b2c495a
commit 12f1164148
3 changed files with 28 additions and 12 deletions

View File

@@ -5,8 +5,12 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2005-12-09 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/dbi:
PMA_DBI_free_result() now accepts more than one resource to be freed
2005-12-08 Marc Delisle <lem9@users.sourceforge.net> 2005-12-08 Marc Delisle <lem9@users.sourceforge.net>
* scripts/setup.php: Typos * scripts/setup.php: Typos
* libraries/common.lib.php: unneeded parameter in PMA_safe_db_list() * libraries/common.lib.php: unneeded parameter in PMA_safe_db_list()
2005-12-08 Michal Čihař <michal@cihar.com> 2005-12-08 Michal Čihař <michal@cihar.com>
@@ -25,7 +29,7 @@ $Source$
writable permissions, refuse to work with existing config dir. writable permissions, refuse to work with existing config dir.
* lang/*, libraries/auth/config.auth.lib.php: Suggest to run setup script * lang/*, libraries/auth/config.auth.lib.php: Suggest to run setup script
if auth with default values fails. if auth with default values fails.
* libraries/grab_globals.lib.php: Do not choke on arrays in $_SERVER * libraries/grab_globals.lib.php: Do not choke on arrays in $_SERVER
array (bug #1370414). array (bug #1370414).
* libraries/sql_query_form.lib.php: Require bookmark code when we use it. * libraries/sql_query_form.lib.php: Require bookmark code when we use it.
* libraries/export/sql.php: Backquote database name (RFE#1376336). * libraries/export/sql.php: Backquote database name (RFE#1376336).

View File

@@ -144,11 +144,17 @@ function PMA_DBI_fetch_row($result) {
return PMA_mysql_fetch_array($result, MYSQL_NUM); return PMA_mysql_fetch_array($result, MYSQL_NUM);
} }
function PMA_DBI_free_result($result) { /**
if (!is_bool($result)) { * Frees the memory associated with the results
return mysql_free_result($result); *
} else { * @param result $result,... one or more mysql result resources
return 0; */
function PMA_DBI_free_result() {
foreach ( func_get_args() as $result ) {
if ( is_resource($result)
&& get_resource_type($result) === 'mysql result' ) {
mysqli_free_result($result);
}
} }
} }

View File

@@ -179,11 +179,17 @@ function PMA_DBI_fetch_row($result) {
return PMA_mysqli_fetch_array($result, MYSQLI_NUM); return PMA_mysqli_fetch_array($result, MYSQLI_NUM);
} }
function PMA_DBI_free_result($result) { /**
if (!is_bool($result)) { * Frees the memory associated with the results
return mysqli_free_result($result); *
} else { * @param result $result,... one or more mysql result resources
return 0; */
function PMA_DBI_free_result() {
foreach ( func_get_args() as $result ) {
if ( is_object($result)
&& is_a($result, 'mysqli_result') ) {
mysqli_free_result($result);
}
} }
} }