DDC-1249: Comment @var will be loaded through AnnotationRegistry? #1570

Closed
opened 2026-01-22 13:18:32 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 5, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user h-andreas:

Plugging in version 2.1 of Doctrine2 and Common gives me some fatal errors require() [function.require]: Failed opening required 'Doctrine/ORM/Mapping/var.php. Are Doc Comments like @var handled through the autoloading process?

Is this a bug or am i doing something wrong? Using Zend, i'm doing the following in bootstrap

$loader->pushAutoloader(array(new \Doctrine\Common\ClassLoader('Doctrine'), 'loadClass'), 'Doctrine');

...

// TODO remove hacky workaround
Annotations\AnnotationRegistry::registerLoader(function($fqcn) {
  return class_exists($fqcn, true);
});

Originally created by @doctrinebot on GitHub (Jul 5, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user h-andreas: Plugging in version 2.1 of Doctrine2 and Common gives me some fatal errors `require() [function.require]: Failed opening required 'Doctrine/ORM/Mapping/var.php`. Are Doc Comments like @var handled through the autoloading process? Is this a bug or am i doing something wrong? Using Zend, i'm doing the following in bootstrap ```$loader = Zend_Loader_Autoloader::getInstance(); $loader->pushAutoloader(array(new \Doctrine\Common\ClassLoader('Doctrine'), 'loadClass'), 'Doctrine'); ... // TODO remove hacky workaround Annotations\AnnotationRegistry::registerLoader(function($fqcn) { return class_exists($fqcn, true); }); ``` ```
admin added the Bug label 2026-01-22 13:18:32 +01:00
admin closed this issue 2026-01-22 13:18:32 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 5, 2011):

Comment created by @beberlei:

The autoloader has to be silent, Doctrine\Common\ClassLoader is not.

You should use the migration help provided in the https://github.com/doctrine/doctrine2/blob/master/UPGRADETO_21 file.

If you are just using the Doctrine ORM Annotations you should put the following into your bootstrap:

\Doctrine\Common\Annotations\AnnotationRegistry::registerFile('/doctrine-src/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');

If you are using own annotations aswell you can see the docs how it works: http://www.doctrine-project.org/projects/common/2.1/docs/en

@doctrinebot commented on GitHub (Jul 5, 2011): Comment created by @beberlei: The autoloader has to be silent, Doctrine\Common\ClassLoader is not. You should use the migration help provided in the https://github.com/doctrine/doctrine2/blob/master/UPGRADE*TO_2*1 file. If you are just using the Doctrine ORM Annotations you should put the following into your bootstrap: ``` \Doctrine\Common\Annotations\AnnotationRegistry::registerFile('/doctrine-src/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); ``` If you are using own annotations aswell you can see the docs how it works: http://www.doctrine-project.org/projects/common/2.1/docs/en
Author
Owner

@doctrinebot commented on GitHub (Jul 5, 2011):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jul 5, 2011): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1570