dsp             Sun Dec 30 17:59:31 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/pdo/tests      bug_43663.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/pdo    pdo_dbh.c 
  Log:
  - Fixed bug #43663 (Extending PDO class with a __call() function doesn't 
work). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1043&r2=1.2027.2.547.2.1044&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1043 php-src/NEWS:1.2027.2.547.2.1044
--- php-src/NEWS:1.2027.2.547.2.1043    Sat Dec 29 10:52:51 2007
+++ php-src/NEWS        Sun Dec 30 17:59:30 2007
@@ -3,6 +3,8 @@
 ?? ??? 2008, PHP 5.2.6
 - Fixed weired behavior in CGI parameter parsing. (Dmitry, Hannes Magnusson)
 
+- Fixed bug #43663 (Extending PDO class with a __call() function doesn't 
work). 
+  (David Soria Parra)
 - Fixed bug #43635 (mysql extension ingores INI settings on NULL values
   passed to mysql_connect()). (Ilia)
 - Fixed bug #43620 (Workaround for a bug inside libcurl 7.16.2 that can result 
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.31.2.17&r2=1.82.2.31.2.18&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 
php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.18
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17    Wed Sep 12 18:26:49 2007
+++ php-src/ext/pdo/pdo_dbh.c   Sun Dec 30 17:59:31 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_dbh.c,v 1.82.2.31.2.17 2007/09/12 18:26:49 iliaa Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.18 2007/12/30 17:59:31 dsp Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -1273,12 +1273,18 @@
 
                if 
(zend_hash_find(dbh->cls_methods[PDO_DBH_DRIVER_METHOD_KIND_DBH],
                                lc_method_name, method_len+1, (void**)&fbc) == 
FAILURE) {
-                       fbc = NULL;
+                       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;
+                       }
+
                        goto out;
                }
                /* got it */
        }
-       
+
 out:
        efree(lc_method_name);
        return fbc;

http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_43663.phpt?view=markup&rev=1.1
Index: php-src/ext/pdo/tests/bug_43663.phpt
+++ php-src/ext/pdo/tests/bug_43663.phpt
--TEST--
PDO Common: Bug #43663 (__call on classes derived from PDO)
--FILE--
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded('pdo')) die('skip');
?>
--FILE--
<?php
class test extends PDO{
    function __call($name, array $args) {
        echo "Called $name in ".__CLASS__."\n";
    }
    function foo() {
        echo "Called foo in ".__CLASS__."\n";
    }
}
$a = new test('sqlite::memory:');
$a->foo();
$a->bar();
--EXPECT--
Called foo in test
Called bar in test

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to