Symfony2: autoload / register namespaces from inside the bundle

I am working on a package in which I use Doctrine CouchDB ODM. How to autoload and register namespaces from within a package? Here are the relevant working lines from app/autoload.php that I need to move:

 use Symfony\Component\ClassLoader\UniversalClassLoader; $loader->registerNamespaces(array( // ... 'Doctrine\\CouchDB' => __DIR__.'/../vendor/doctrine-odm/lib', 'Doctrine\\ODM\\CouchDB' => __DIR__.'/../vendor/doctrine-odm/lib', )); 

Thanks!

+4
source share
1 answer

To solve this problem, a composer was added: http://knplabs.com/blog/symfony2-with-composer

+2
source

Source: https://habr.com/ru/post/1383920/


All Articles