Re: cvs: pear /Pager Pager.php package.xml

From: Date: Sat, 20 May 2006 17:28:18 +0000
Subject: Re: cvs: pear /Pager Pager.php package.xml
References: 1  Groups: php.pear.cvs php.pear.dev 
Request: Send a blank email to pear-dev+get-42534@lists.php.net to get a copy of this message
Sorry, but i disagree with mirko The Pager 2.4.1 is compatible with __autoload feature, but we have to write it correctly. Check this : function __autoload($class_name) {
    $class_name = str_replace('_', '/', $class_name);
    include_once $class_name . ".php";
} rather than mirko soluce function __autoload($class_name) {
    include_once $class_name . ".php";
} Remember that in mirko's script we try to load a Pager_Sliding object. And in PEAR installation structure this class is in file 'Sliding.php' into PEAR/Pager directory. so when with his __autoload copy, try to load "Pager_Sliding.php" it raise a warning. No fixes was really necessary in Pager package. Laurent Lorenzo Alberton a écrit :
quipo Sat May 20 14:20:09 2006 UTC
  Modified files:                  /pear/Pager	Pager.php package.xml   Log:
fixed bug #7657 (not compatible with autoload). Thanks to mirko at stranicata dot com
         // Attempt to include a custom version of the named class, but don't treat
         // a failure as fatal.  The caller may have already included their own
         // version of the named class.
-        if (!class_exists($classname)) {
+        if (!class_exists($classname, false)) {
             include_once $classfile;
         }
 


« previous php.pear.dev (#42534) next »