From b93dd7a36bfd7c10434d1acad50b9826fcd365ce Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 4 Jul 2011 11:28:51 +0200 Subject: [PATCH] tweaked UPDATE file --- UPDATE.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/UPDATE.md b/UPDATE.md index c50bc5f3b5..c4d68c830f 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -10,21 +10,27 @@ RC3 to RC4 ---------- * Annotation classes must be annotated with @Annotation (see the validator constraints for examples) -* Annotations are not using the PHP autoloading but their own mechanism. This allows much more control - about possible failure states. To make your code work you have to add the following lines to your - autoload.php: - AnnotationRegistry::registerLoader(function($class) use ($loader) { - $loader->loadClass($class); - return class_exists($class, false); - }); - AnnotationRegistry::registerFile( - __DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php' - ); +* Annotations are not using the PHP autoloading but their own mechanism. This + allows much more control about possible failure states. To make your code + work, add the following lines at the end of your `autoload.php` file: - The `$loader` variable is an instance of the UniversalClassLoader. Additionally you might have to adjust - the ORM path to the DoctrineAnnotations.php. If you are not using the UniversalClassLoader see the - [Doctrine Annotations documentation](http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html) + use Doctrine\Common\Annotations\AnnotationRegistry; + + AnnotationRegistry::registerLoader(function($class) use ($loader) { + $loader->loadClass($class); + return class_exists($class, false); + }); + + AnnotationRegistry::registerFile( + __DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php' + ); + + The `$loader` variable is an instance of `UniversalClassLoader`. + Additionally you might have to adjust the ORM path to the + `DoctrineAnnotations.php`. If you are not using the `UniversalClassLoader` + see the [Doctrine Annotations + documentation](http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html) for more details on how to register annotations. beta5 to RC1