Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The latest commit b98a1dbf92fbd9c43904 broke mongo-odm with symfony2 RC4 #129

Closed
laczoka opened this issue Jul 17, 2011 · 2 comments
Closed

Comments

@laczoka
Copy link

laczoka commented Jul 17, 2011

Hi,

if you setup mongodb-odm with symfony2 rc4 the annotation classes are not correctly autoloaded even you add the

Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver::registerAnnotationClasses();

to autoload.php. For some reason the registered custom autoload function is not triggered and the annotation classes are not loaded.

In AnnotationDriver::loadMetadataForClass():

$this->reader->getClassAnnotations($reflClass) returns an incomplete class.

This is happens, because the FQN of the Annotation is mapped to vendor/doctrine-mongodb-dm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/xxxxAnnotationClassNamexxxxx.php.

whereas the annotation class definitions are in a single file!

@laczoka
Copy link
Author

laczoka commented Jul 17, 2011

As a workaround, I found eager registration works if you add the following line to autoload.php:

AnnotationRegistry::registerFile(DIR.'/../vendor/doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php');

@laczoka laczoka closed this as completed Jul 17, 2011
@laczoka laczoka reopened this Jul 17, 2011
@laczoka
Copy link
Author

laczoka commented Jul 17, 2011

sorry, accidentally closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants