com php-src: Fix #32490: constructor of mysqli has wrong name: NEWS ext/mysqli/mysqli_fe.c ext/mysqli/tests/bug3249 0.phpt
ext/mysqli/tests/bug38003.phpt ext/m ysqli/tests/mysqli_class_mysqli_interface.phpt ext/my sqli/tests/mysqli_class_mysqli_reflection.phpt ext/my
sqli/tests/mysqli_connect_oo.phpt
| From: | Christoph Michael Becker | Date: | Tue, 01 Sep 2015 19:44:16 +0000 |
| Subject: | com php-src: Fix #32490: constructor of mysqli has wrong name: NEWS ext/mysqli/mysqli_fe.c ext/mysqli/tests/bug3249 0.phpt ext/mysqli/tests/bug38003.phpt ext/m ysqli/tests/mysqli_class_mysqli_interface.phpt ext/my sqli/tests/mysqli_class_mysqli_reflection.phpt ext/my sqli/tests/mysqli_connect_oo.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88843@lists.php.net to get a copy of this message | ||
Commit: b15eff63862c9ac24184b8121431019a352a42f8
Author: Christoph M. Becker <cmbecker69@gmx.de> Tue, 1 Sep 2015 18:38:11 +0200
Committer: Christoph M. Becker <cmb@php.net> Tue, 1 Sep 2015 21:44:16 +0200
Parents: 50d6fd6a032aad352d0daa52540698131813a4ec
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b15eff63862c9ac24184b8121431019a352a42f8
Log:
Fix #32490: constructor of mysqli has wrong name
As of PHP 7 old style constructor names are deprecated, so we rename
mysqli::mysqli() to mysqli::__construct().
Bugs:
https://bugs.php.net/32490
Changed paths:
M NEWS
M ext/mysqli/mysqli_fe.c
A ext/mysqli/tests/bug32490.phpt
M ext/mysqli/tests/bug38003.phpt
M ext/mysqli/tests/mysqli_class_mysqli_interface..phpt
M ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt
M ext/mysqli/tests/mysqli_connect_oo.phpt
diff --git a/NEWS b/NEWS index 4a44940..8d5a381 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,9 @@ PHP NEWS . Fixed bug #70330 (Segmentation Fault with multiple "curl_copy_handle"). (Laruence) +- Mysqli: + . Fixed bug#32490 (constructor of mysqli has wrong name). (cmb) + - Pcntl: . Fixed bug #70386 (Can't compile on NetBSD because of missing WCONTINUED and WIFCONTINUED). (Matteo) diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index f69491f..430175f 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -551,7 +551,7 @@ const zend_function_entry mysqli_link_methods[] = { PHP_FALIAS(init,mysqli_init_method, arginfo_mysqli_no_params) PHP_FALIAS(kill,mysqli_kill, arginfo_class_mysqli_kill) PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_query) - PHP_FALIAS(mysqli, mysqli_link_construct, arginfo_mysqli_connect) + PHP_FALIAS(__construct, mysqli_link_construct, arginfo_mysqli_connect) PHP_FALIAS(more_results, mysqli_more_results, arginfo_mysqli_no_params) PHP_FALIAS(next_result, mysqli_next_result, arginfo_mysqli_no_params) PHP_FALIAS(options, mysqli_options, arginfo_class_mysqli_options) diff --git a/ext/mysqli/tests/bug32490.phpt b/ext/mysqli/tests/bug32490.phpt new file mode 100644 index 0000000..3d877c0 --- /dev/null +++ b/ext/mysqli/tests/bug32490.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #32490 (constructor of mysqli has wrong name) +--SKIPIF-- +<?php if (!extension_loaded("mysqli")) die("skip mysqli not available"); ?> +--FILE-- +<?php +var_dump(method_exists("mysqli", "mysqli")); +var_dump(method_exists("mysqli", "__construct")); +?> +--EXPECT-- +bool(false) +bool(true) + diff --git a/ext/mysqli/tests/bug38003.phpt b/ext/mysqli/tests/bug38003.phpt index a5f1a23..f3a4823 100644 --- a/ext/mysqli/tests/bug38003.phpt +++ b/ext/mysqli/tests/bug38003.phpt @@ -17,7 +17,5 @@ $DB = new DB(); echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to private DB::__construct() from invalid context in %s:%d -Stack trace: -#0 {main} - thrown in %s on line %d +Fatal error: Access level to DB::__construct() must be public (as in class mysqli) in %s%ebug38003.php on line %d + diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt index ea86c19..c816163 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt @@ -19,6 +19,7 @@ require_once('skipifconnectfailure.inc'); printf("\nMethods:\n"); $methods = get_class_methods($mysqli); $expected_methods = array( + '__construct' => true, 'autocommit' => true, 'begin_transaction' => true, 'change_user' => true, @@ -36,7 +37,6 @@ require_once('skipifconnectfailure.inc'); 'kill' => true, 'more_results' => true, 'multi_query' => true, - 'mysqli' => true, 'next_result' => true, 'options' => true, 'ping' => true, diff --git a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt index 8f6c249..22829ee 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt @@ -37,7 +37,7 @@ Modifiers: '0' Parent Class: '' Extension: 'mysqli' -Inspecting method 'mysqli' +Inspecting method '__construct' isFinal: no isAbstract: no isPublic: yes @@ -53,42 +53,100 @@ Modifiers: 8448 Number of Parameters: 6 Number of Required Parameters: 0 -Inspecting parameter 'host' of method 'mysqli' +Inspecting parameter 'host' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'user' of method 'mysqli' +Inspecting parameter 'user' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'password' of method 'mysqli' +Inspecting parameter 'password' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'database' of method 'mysqli' +Inspecting parameter 'database' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'port' of method 'mysqli' +Inspecting parameter 'port' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'socket' of method 'mysqli' +Inspecting parameter 'socket' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting method '__construct' +isFinal: no +isAbstract: no +isPublic: yes +isPrivate: no +isProtected: no +isStatic: no +isConstructor: yes +isDestructor: no +isInternal: yes +isUserDefined: no +returnsReference: no +Modifiers: 8448 +Number of Parameters: 6 +Number of Required Parameters: 0 + +Inspecting parameter 'host' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'user' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'password' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'database' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'port' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'socket' of method '__construct' isArray: no allowsNull: no isPassedByReference: no @@ -525,64 +583,6 @@ isPassedByReference: no isOptional: no isDefaultValueAvailable: no -Inspecting method 'mysqli' -isFinal: no -isAbstract: no -isPublic: yes -isPrivate: no -isProtected: no -isStatic: no -isConstructor: yes -isDestructor: no -isInternal: yes -isUserDefined: no -returnsReference: no -Modifiers: 8448 -Number of Parameters: 6 -Number of Required Parameters: 0 - -Inspecting parameter 'host' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'user' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'password' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'database' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'port' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'socket' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - Inspecting method 'next_result' isFinal: no isAbstract: no diff --git a/ext/mysqli/tests/mysqli_connect_oo.phpt b/ext/mysqli/tests/mysqli_connect_oo.phpt index 35cc116..32dfac0 100644 --- a/ext/mysqli/tests/mysqli_connect_oo.phpt +++ b/ext/mysqli/tests/mysqli_connect_oo.phpt @@ -147,7 +147,7 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECTF-- -Warning: mysqli::mysqli(): (%s/%d): Access denied for user '%sunknown%s'@'%s' (using password: %s) in %s on line %d +Warning: mysqli::__construct(): (%s/%d): Access denied for user '%sunknown%s'@'%s' (using password: %s) in %s on line %d ... and now Exceptions Access denied for user '%s'@'%s' (using password: %s) done! \ No newline at end of file
diff --git a/NEWS b/NEWS index 4a44940..8d5a381 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,9 @@ PHP NEWS . Fixed bug #70330 (Segmentation Fault with multiple "curl_copy_handle"). (Laruence) +- Mysqli: + . Fixed bug#32490 (constructor of mysqli has wrong name). (cmb) + - Pcntl: . Fixed bug #70386 (Can't compile on NetBSD because of missing WCONTINUED and WIFCONTINUED). (Matteo) diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index f69491f..430175f 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -551,7 +551,7 @@ const zend_function_entry mysqli_link_methods[] = { PHP_FALIAS(init,mysqli_init_method, arginfo_mysqli_no_params) PHP_FALIAS(kill,mysqli_kill, arginfo_class_mysqli_kill) PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_query) - PHP_FALIAS(mysqli, mysqli_link_construct, arginfo_mysqli_connect) + PHP_FALIAS(__construct, mysqli_link_construct, arginfo_mysqli_connect) PHP_FALIAS(more_results, mysqli_more_results, arginfo_mysqli_no_params) PHP_FALIAS(next_result, mysqli_next_result, arginfo_mysqli_no_params) PHP_FALIAS(options, mysqli_options, arginfo_class_mysqli_options) diff --git a/ext/mysqli/tests/bug32490.phpt b/ext/mysqli/tests/bug32490.phpt new file mode 100644 index 0000000..3d877c0 --- /dev/null +++ b/ext/mysqli/tests/bug32490.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #32490 (constructor of mysqli has wrong name) +--SKIPIF-- +<?php if (!extension_loaded("mysqli")) die("skip mysqli not available"); ?> +--FILE-- +<?php +var_dump(method_exists("mysqli", "mysqli")); +var_dump(method_exists("mysqli", "__construct")); +?> +--EXPECT-- +bool(false) +bool(true) + diff --git a/ext/mysqli/tests/bug38003.phpt b/ext/mysqli/tests/bug38003.phpt index a5f1a23..f3a4823 100644 --- a/ext/mysqli/tests/bug38003.phpt +++ b/ext/mysqli/tests/bug38003.phpt @@ -17,7 +17,5 @@ $DB = new DB(); echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to private DB::__construct() from invalid context in %s:%d -Stack trace: -#0 {main} - thrown in %s on line %d +Fatal error: Access level to DB::__construct() must be public (as in class mysqli) in %s%ebug38003.php on line %d + diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt index ea86c19..c816163 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt @@ -19,6 +19,7 @@ require_once('skipifconnectfailure.inc'); printf("\nMethods:\n"); $methods = get_class_methods($mysqli); $expected_methods = array( + '__construct' => true, 'autocommit' => true, 'begin_transaction' => true, 'change_user' => true, @@ -36,7 +37,6 @@ require_once('skipifconnectfailure.inc'); 'kill' => true, 'more_results' => true, 'multi_query' => true, - 'mysqli' => true, 'next_result' => true, 'options' => true, 'ping' => true, diff --git a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt index 8f6c249..22829ee 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt @@ -37,7 +37,7 @@ Modifiers: '0' Parent Class: '' Extension: 'mysqli' -Inspecting method 'mysqli' +Inspecting method '__construct' isFinal: no isAbstract: no isPublic: yes @@ -53,42 +53,100 @@ Modifiers: 8448 Number of Parameters: 6 Number of Required Parameters: 0 -Inspecting parameter 'host' of method 'mysqli' +Inspecting parameter 'host' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'user' of method 'mysqli' +Inspecting parameter 'user' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'password' of method 'mysqli' +Inspecting parameter 'password' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'database' of method 'mysqli' +Inspecting parameter 'database' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'port' of method 'mysqli' +Inspecting parameter 'port' of method '__construct' isArray: no allowsNull: no isPassedByReference: no isOptional: yes isDefaultValueAvailable: no -Inspecting parameter 'socket' of method 'mysqli' +Inspecting parameter 'socket' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting method '__construct' +isFinal: no +isAbstract: no +isPublic: yes +isPrivate: no +isProtected: no +isStatic: no +isConstructor: yes +isDestructor: no +isInternal: yes +isUserDefined: no +returnsReference: no +Modifiers: 8448 +Number of Parameters: 6 +Number of Required Parameters: 0 + +Inspecting parameter 'host' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'user' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'password' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'database' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'port' of method '__construct' +isArray: no +allowsNull: no +isPassedByReference: no +isOptional: yes +isDefaultValueAvailable: no + +Inspecting parameter 'socket' of method '__construct' isArray: no allowsNull: no isPassedByReference: no @@ -525,64 +583,6 @@ isPassedByReference: no isOptional: no isDefaultValueAvailable: no -Inspecting method 'mysqli' -isFinal: no -isAbstract: no -isPublic: yes -isPrivate: no -isProtected: no -isStatic: no -isConstructor: yes -isDestructor: no -isInternal: yes -isUserDefined: no -returnsReference: no -Modifiers: 8448 -Number of Parameters: 6 -Number of Required Parameters: 0 - -Inspecting parameter 'host' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'user' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'password' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'database' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'port' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - -Inspecting parameter 'socket' of method 'mysqli' -isArray: no -allowsNull: no -isPassedByReference: no -isOptional: yes -isDefaultValueAvailable: no - Inspecting method 'next_result' isFinal: no isAbstract: no diff --git a/ext/mysqli/tests/mysqli_connect_oo.phpt b/ext/mysqli/tests/mysqli_connect_oo.phpt index 35cc116..32dfac0 100644 --- a/ext/mysqli/tests/mysqli_connect_oo.phpt +++ b/ext/mysqli/tests/mysqli_connect_oo.phpt @@ -147,7 +147,7 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECTF-- -Warning: mysqli::mysqli(): (%s/%d): Access denied for user '%sunknown%s'@'%s' (using password: %s) in %s on line %d +Warning: mysqli::__construct(): (%s/%d): Access denied for user '%sunknown%s'@'%s' (using password: %s) in %s on line %d ... and now Exceptions Access denied for user '%s'@'%s' (using password: %s) done! \ No newline at end of file