johannes Tue Sep 16 23:34:31 2008 UTC
Modified files:
/php-src/ext/pdo pdo_dbh.c
/php-src/ext/pdo_mysql/tests pdo_mysql_subclass.phpt
Log:
- Fix #44425 (Extending PDO/MySQL class with a __call() function doesn't work)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.151&r2=1.152&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.151 php-src/ext/pdo/pdo_dbh.c:1.152
--- php-src/ext/pdo/pdo_dbh.c:1.151 Fri Jul 25 08:53:11 2008
+++ php-src/ext/pdo/pdo_dbh.c Tue Sep 16 23:34:31 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_dbh.c,v 1.151 2008/07/25 08:53:11 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.152 2008/09/16 23:34:31 johannes Exp $ */
/* The PDO Database Handle Class */
@@ -1273,9 +1273,7 @@
if
(zend_u_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH],
ztype, lc_method_name, method_len+1,
(void**)&fbc) == FAILURE) {
- if (std_object_handlers.get_method) {
- fbc = std_object_handlers.get_method(object_pp,
lc_method_name, method_len TSRMLS_CC);
- }
+
if (!fbc) {
fbc = NULL;
}
@@ -1285,6 +1283,10 @@
}
out:
+ if (std_object_handlers.get_method) {
+ fbc = std_object_handlers.get_method(object_pp, lc_method_name,
method_len TSRMLS_CC);
+ }
+
pdo_zstr_efree(lc_method_name);
return fbc;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt
diff -u php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt:1.1
php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt:1.2
--- php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt:1.1 Mon Jul 21
13:05:51 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt Tue Sep 16 23:34:31 2008
@@ -36,7 +36,7 @@
}
public function __call($method, $args) {
- print "__call()";
+ print "__call(".var_export($method,true).",
".var_export($args, true).")\n";
// $this->protocol();
}
@@ -74,8 +74,6 @@
$db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
---XFAIL--
-PDO doesn't like __call()
--EXPECTF--
__construct('%s', '%s', '%s')
exec('DROP TABLE IF EXISTS test')
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php