johannes                Tue Sep 16 23:35:50 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/pdo    pdo_dbh.c 
    /php-src/ext/pdo_mysql/tests        pdo_mysql_subclass.phpt 
  Log:
  MFH 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.82.2.31.2.17.2.11&r2=1.82.2.31.2.17.2.12&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.11 
php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.12
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.11       Fri Jul 25 08:23:06 2008
+++ php-src/ext/pdo/pdo_dbh.c   Tue Sep 16 23:35:50 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_dbh.c,v 1.82.2.31.2.17.2.11 2008/07/25 08:23:06 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.17.2.12 2008/09/16 23:35:50 johannes Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -1293,9 +1293,6 @@
 
                if 
(zend_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH],
                                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;
@@ -1307,6 +1304,12 @@
        }
 
 out:
+       if (!fbc) {
+               if (std_object_handlers.get_method) {
+                       fbc = std_object_handlers.get_method(object_pp, 
lc_method_name, method_len TSRMLS_CC);
+               }
+       }
+
        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.2.2&r2=1.1.2.3&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.2.2 
php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt:1.1.2.2 Mon Jul 21 
13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt Tue Sep 16 23:35:50 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

Reply via email to