Search code examples
classloaderdoctrine-orm

Doctrine2 Classloader, how to load multiple directories with exact same namespace


Is it possible to load multiple directories under the exact same namespace like this?

$loader = new ClassLoader('DoctrineExtensions',
   "/path/to/vendor/doctrine2-extensions-beberlei/lib");
$loader->register();

$loader = new ClassLoader('DoctrineExtensions',
   "/path/to/vendor/doctrine2-extensions-srosato/lib");
$loader->register();

I have read the documentation but it seems that it supports specials cases and general cases only (say DoctrineExtensions\SpecialCase being the special case and DoctrineExtensions being the general case) but I want to have two general cases at once, is this currently feasible?


Solution

  • Impossible. Doctrine 2 ClassLoader follows the PSR #0 http://groups.google.com/group/php-standards/web/psr-0-final-proposal

    This means we're straight to 1 NS === 1 Directory.

    Regards,