Hello,
I tried phpMyAdmin 2.11.5 with snapshot of PHP 5.3.0-dev
(Sat, 01 Mar 2008 08:22:44 -0500).
It won't work and produces the following errors:
Deprecated: get_magic_quotes_gpc() [function.get-magic-quotes-gpc]: This function is deprecated and removed in PHP 6. See http://php.net/\{migrate}#get_magic_quotes_gpc for details. in phpmyadmin\libraries\common.inc.php on line 225
Deprecated: is_a(): Deprecated. Please use the instanceof operator in phpmyadmin\libraries\dbi\mysqli.dbi.lib.php on line 337
[multiple times]
I've changed sources by this way to solve the problem:
common.inc.php , Line 225:
if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) {
Replacement for function in file mysqli.dbi.lib.php:
function PMA_DBI_free_result()
{
foreach (func_get_args() as $result) {
if (is_object($result)
&& (get_class($result) == strtolower('mysqli_result')
or is_subclass_of($result, 'mysqli_result')) ) {
mysqli_free_result($result);
}
}
}
Hope that helps.
Logged In: YES
user_id=210714
Originator: NO
Thanks, I'll merge for 2.11.6.
Why the strtolower() ?
Logged In: YES
user_id=210714
Originator: NO
Also, I'll merge this code from 3.0-dev instead:
if ($result instanceof mysqli_result) {
Logged In: YES
user_id=419005
Originator: YES
> Why the strtolower() ?
:) Mechanically. I was in a hurry.
I didn't use `instanceof` for compatibility with PHP 4, as the operator was introduced in PHP 5.
Logged In: YES
user_id=210714
Originator: NO
This is in mysqli.dbi.lib.php and mysqli is not part of PHP 4.
Do you agree with this patch?
http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/branches/QA_2_11/phpMyAdmin/libraries/dbi/mysqli.dbi.lib.php?r1=10503&r2=11157
Logged In: YES
user_id=419005
Originator: YES
The code works perfectly. Thank you for responding.
Logged In: YES
user_id=2046917
Originator: NO
In PHP 5.3.0-dev I get:
in ./libraries/common.inc.php#239
get_magic_quotes_gpc() [function.get-magic-quotes-gpc]: This function is deprecated and removed in PHP 6. See http://php.net/\{migrate}#get_magic_quotes_gpc for details.
Backtrace
./libraries/common.inc.php#239: get_magic_quotes_gpc()
./index.php#34: require_once(./libraries/common.inc.php)
---
get_magic_quotes_gpc() still exists in PHP 5.3, but throws a depreciation warning, causing phpMyAdmin to fail.
Logged In: YES
user_id=210714
Originator: NO
minichate,
are you using phpMyAdmin 2.11.6? (it has not been released yet)
Logged In: YES
user_id=2046917
Originator: NO
Nope, 3.0-dev
https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin
Revision 11173
Logged In: YES
user_id=210714
Originator: NO
I was sure that putting a "@" before get_magic_quotes_gpc() would remove the warning. Please show me the line 239 from your file.
Logged In: YES
user_id=210714
Originator: NO
Does it work better if line 239 becomes:
if (function_exists('get_magic_quotes_gpc') && version_compare(PHP_VERSION, '5.3.0') < 0 && @get_magic_quotes_gpc()) {
Logged In: YES
user_id=2046917
Originator: NO
Same error:
in ./libraries/common.inc.php#240
get_magic_quotes_gpc() [function.get-magic-quotes-gpc]: This function is deprecated and removed in PHP 6. See http://php.net/\{migrate}#get_magic_quotes_gpc for details.
Backtrace
./libraries/common.inc.php#240: get_magic_quotes_gpc()
./index.php#34: require_once(./libraries/common.inc.php)
Lines 237 - 245:
// remove quotes added by php
// (@ before get_magic_quotes_gpc() because it's deprecated in PHP 5.3)
if (function_exists('get_magic_quotes_gpc') &&
version_compare(PHP_VERSION, '5.3.0') < 0 && @get_magic_quotes_gpc()) {
PMA_arrayWalkRecursive($_GET, 'stripslashes', true);
PMA_arrayWalkRecursive($_POST, 'stripslashes', true);
PMA_arrayWalkRecursive($_COOKIE, 'stripslashes', true);
PMA_arrayWalkRecursive($_REQUEST, 'stripslashes', true);
}
Logged In: YES
user_id=210714
Originator: NO
Ok, it's because version 5.3.0-dev is really lower than 5.3.0. This works:
if (function_exists('get_magic_quotes_gpc')
&& (version_compare(PHP_VERSION, '5.2.99') == -1)
&& @get_magic_quotes_gpc()) {
Logged In: YES
user_id=210714
Originator: NO
Merged.
Logged In: YES
user_id=2046917
Originator: NO
Thanks! Latest trunk now works!