Skip to content
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.

Commit

Permalink
Added the annotation namespace registration with the AnnotationRegist…
Browse files Browse the repository at this point in the history
…ry to the autoloader code blocks.
  • Loading branch information
marnusw committed Mar 21, 2012
1 parent 3e272b5 commit 27697d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand All @@ -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
-----------------------------

Expand Down

0 comments on commit 27697d1

Please sign in to comment.