This repository has been archived by the owner. It is now read-only.

Added the annotation namespace registration with the AnnotationRegistry #10

Merged
merged 1 commit into from Apr 4, 2012
Jump to file or symbol
Failed to load files and symbols.
+8 −1
Split
@@ -23,7 +23,8 @@ You have to make sure that both dependencies are installed and autoloadable.
The Github checkout of comes with a submodule of the Doctrine Common library. It contains
the ``Doctrine\Common\ClassLoader`` which should be used for autoloading all the necessary
-Doctrine classes.
+Doctrine classes. It is also necessary to register the annotation namespace with the
+AnnotationRegistry so the Doctrine annotation classes can be loaded on demand.
.. code-block:: php
@@ -43,6 +44,9 @@ Doctrine classes.
$loader = new \Doctrine\Common\ClassLoader("Symfony", $couchPath . "/vendor");
$loader->register();
+ $annotationNs = 'Doctrine\\ODM\\CouchDB\\Mapping\\Annotations';
+ Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($annotationNs, $couchPath);
+
If Doctrine Common is installed via PEAR the ClassLoader can be loaded
from the include path:
@@ -63,6 +67,9 @@ from the include path:
$loader = new \Doctrine\Common\ClassLoader("Symfony");
$loader->register();
+ $annotationNs = 'Doctrine\\ODM\\CouchDB\\Mapping\\Annotations';
+ Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($annotationNs, $couchPath);
+
Obtaining the DocumentManager
-----------------------------