johannes Wed Jan 7 16:29:42 2009 UTC
Modified files:
/php-src/ext/mysqli mysqli.c
/php-src/ext/mysqli/tests 066.phpt bug34810.phpt
mysqli_class_mysqli_result_interface.phpt
mysqli_class_mysqli_stmt_interface.phpt
mysqli_mysqli_result_invalid_mode.phpt
Log:
Proper ctor usage (Fix #46044)
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.140&r2=1.141&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.140 php-src/ext/mysqli/mysqli.c:1.141
--- php-src/ext/mysqli/mysqli.c:1.140 Wed Dec 31 11:12:33 2008
+++ php-src/ext/mysqli/mysqli.c Wed Jan 7 16:29:42 2009
@@ -17,7 +17,7 @@
| Ulf Wendel <[email protected]> |
+----------------------------------------------------------------------+
- $Id: mysqli.c,v 1.140 2008/12/31 11:12:33 sebastian Exp $
+ $Id: mysqli.c,v 1.141 2009/01/07 16:29:42 johannes Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -424,41 +424,6 @@
}
/* }}} */
-static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC)
-{
- zend_class_entry * ce = Z_OBJCE_P(object);
-
- if (ce != mysqli_link_class_entry && ce != mysqli_stmt_class_entry &&
- ce != mysqli_result_class_entry && ce !=
mysqli_driver_class_entry &&
- ce != mysqli_warning_class_entry) {
- return zend_std_get_constructor(object TSRMLS_CC);
- } else {
- static zend_internal_function f;
- mysqli_object *obj = (mysqli_object
*)zend_objects_get_address(object TSRMLS_CC);
-
- f.function_name = obj->zo.ce->name;
- f.scope = obj->zo.ce;
- f.arg_info = NULL;
- f.num_args = 0;
- f.fn_flags = 0;
-
- f.type = ZEND_INTERNAL_FUNCTION;
- if (obj->zo.ce == mysqli_link_class_entry) {
- f.handler = ZEND_FN(mysqli_link_construct);
- } else if (obj->zo.ce == mysqli_stmt_class_entry) {
- f.handler = ZEND_FN(mysqli_stmt_construct);
- } else if (obj->zo.ce == mysqli_result_class_entry) {
- f.handler = ZEND_FN(mysqli_result_construct);
- } else if (obj->zo.ce == mysqli_driver_class_entry) {
- f.handler = ZEND_FN(mysqli_driver_construct);
- } else if (obj->zo.ce == mysqli_warning_class_entry) {
- f.handler = ZEND_MN(mysqli_warning___construct);
- }
-
- return (union _zend_function*)&f;
- }
-}
-
static int mysqli_object_has_property(zval *object, zval *member, int
has_set_exists TSRMLS_DC) /* {{{ */
{
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object
TSRMLS_CC);
@@ -713,7 +678,6 @@
mysqli_object_handlers.read_property = mysqli_read_property;
mysqli_object_handlers.write_property = mysqli_write_property;
mysqli_object_handlers.get_property_ptr_ptr =
std_hnd->get_property_ptr_ptr;
- mysqli_object_handlers.get_constructor = php_mysqli_constructor_get;
mysqli_object_handlers.has_property = mysqli_object_has_property;
mysqli_object_handlers.get_debug_info = mysqli_object_get_debug_info;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/066.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mysqli/tests/066.phpt
diff -u php-src/ext/mysqli/tests/066.phpt:1.3
php-src/ext/mysqli/tests/066.phpt:1.4
--- php-src/ext/mysqli/tests/066.phpt:1.3 Thu Aug 9 08:41:12 2007
+++ php-src/ext/mysqli/tests/066.phpt Wed Jan 7 16:29:42 2009
@@ -19,7 +19,7 @@
$mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
- if (($warning = new mysqli_warning($mysql))) {
+ if (($warning = $mysql->get_warnings())) {
do {
printf("Warning\n");
} while ($warning->next());
@@ -30,4 +30,4 @@
?>
--EXPECT--
Warning
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug34810.phpt?r1=1.9&r2=1.10&diff_format=u
Index: php-src/ext/mysqli/tests/bug34810.phpt
diff -u php-src/ext/mysqli/tests/bug34810.phpt:1.9
php-src/ext/mysqli/tests/bug34810.phpt:1.10
--- php-src/ext/mysqli/tests/bug34810.phpt:1.9 Tue Jan 6 00:56:03 2009
+++ php-src/ext/mysqli/tests/bug34810.phpt Wed Jan 7 16:29:42 2009
@@ -24,7 +24,7 @@
$mysql->query("CREATE TABLE test_warnings (a int not null)");
$mysql->query("SET sql_mode=''");
$mysql->query("INSERT INTO test_warnings VALUES
(1),(2),(NULL)");
- var_dump(new mysqli_warning($mysql));
+ var_dump($mysql->get_warnings());
}
}
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt
diff -u php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt:1.4
php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt:1.5
--- php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt:1.4
Tue Jan 6 00:56:03 2009
+++ php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt Wed Jan
7 16:29:42 2009
@@ -187,7 +187,7 @@
Constructor:
-Warning: mysqli_result::mysqli_result() expects parameter 2 to be long,
Unicode string given in %s on line %d
+Warning: mysqli_result::__construct() expects parameter 2 to be long, Unicode
string given in %s on line %d
-Warning: mysqli_result::mysqli_result() expects parameter 1 to be mysqli,
Unicode string given in %s on line %d
+Warning: mysqli_result::__construct() expects parameter 1 to be mysqli,
Unicode string given in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt
diff -u php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt:1.5
php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt:1.6
--- php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt:1.5
Tue Jan 6 00:56:03 2009
+++ php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt Wed Jan
7 16:29:42 2009
@@ -187,5 +187,5 @@
Prepare using the constructor:
-Warning: mysqli_stmt::mysqli_stmt() expects parameter 2 to be binary string,
object given in %s on line %d
+Warning: mysqli_stmt::__construct() expects parameter 2 to be binary string,
object given in %s on line %d
done!
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt
diff -u php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt:1.2
php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt:1.3
--- php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt:1.2 Thu Aug
9 10:01:20 2007
+++ php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt Wed Jan
7 16:29:42 2009
@@ -22,5 +22,5 @@
print "done!";
?>
--EXPECTF--
-Warning: mysqli_result::mysqli_result(): Invalid value for resultmode in %s on
line %d
+Warning: mysqli_result::__construct(): Invalid value for resultmode in %s on
line %d
done!
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php