Issues

ZF-3889: Use of personal Loader

Description

When I load my personnal loader :

 
require_once "Zend/Loader.php";
require_once "Olfp/Loader.php";

with special dir all is ok :

 
class Olfp_Loader extends Zend_Loader
{
    public static function loadClass($class, $dirs = null)
    {
        $dirs = array(
            './library/Client/Chu',
            './library'
        );

        parent::loadClass($class, $dirs);
    }

    public static function autoload($class)
    {
       try {
            self::loadClass($class);
            return $class;
        } catch (Exception $e) {
            return false;
        }
    }
}

when a write :

 
Olfp_Debug::name();

ouput is : "Olfp_Debug chu", so my special class is really loaded, it's ok.

but when a write just after this :

 
Zend_Session::start();

I've got an error :


Fatal error: Cannot redeclare class Zend_Session in C:\wamp\www\testPf\library\Zend\Session.php on line 49

Comments

Why don't you use the PluginLoader ? There is no need to extend the LoaderClass for providing new paths as this was the reason why the plugin loader was added.

The described usecase is incomplete and does not fit the implementation. Feel free to reopen it when you have an other usecase.

Changing issues in preparation for the 1.7.0 release.