Teaching ZF2 + without composer

I have a working ZF2 application (skeleton) and you want to integrate Doctrine.

I downloaded 2 modules (DoctrineModule and DoctrineORMModule) from github since I cannot use the composer (therefore, please do not respond with "get composer").

After hours of troubleshooting, I keep getting the following error:

Fatal error: Doctrine \ Common \ Annotations \ AnnotationRegistry 'was not found in the doctrine /DoctrineModule/src/DoctrineModule/Module.php on line 54.

I spend hours searching and trying to debug, but I can’t find a way to fix it. Please help me.

+2
source share
3 answers

DoctrineORMModule ( ).

(0.7.*) DoctrineORMModule :

, init_autoloader.php ( ). - factory:

Zend\Loader\AutoloaderFactory::factory(array(
    'Zend\Loader\StandardAutoloader' => array(
        'autoregister_zf' => true,
        'namespaces' => array(
            'Doctrine\Common'   => __DIR__ . '/vendor/doctrine/common',
            'Doctrine\DBAL'     => __DIR__ . '/vendor/doctrine/dbal',
            'Symfony\Console'   => __DIR__ . '/vendor/symfony/console',
            'DoctrineModule'    => __DIR__ . '/vendor/doctrine/doctrine-module',
            'DoctrineORMModule' => __DIR__ . '/vendor/doctrine/doctrine-orm-module',
        ),
    ),
));

git

0.8.* , - , doctrine/common, , .

.

+5

Module.php :

public function getAutoloaderConfig()
{
    return array(
        'Zend\Loader\StandardAutoloader' => array(
            'namespaces' => array(
                __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                'Doctrine' => //Path where your doctrine dist resides
            ),
        ),
    );
}

DoctrineModule DoctrineORMModule, ZF2 .

0

Doctrine\Common, . Doctrine\Common - Composer; composer.json require:

"doctrine / common": "> = 2.1", then run the php composer.phar update to establish the dependency.

If you are not using Composer, visit the Doctrine project website for installation details.

0
source

All Articles