From 1aa90dc8723a840fa9ed04c3599244c7dde253c6 Mon Sep 17 00:00:00 2001
From: Benjamin Eberlei <kontakt@beberlei.de>
Date: Sat, 18 Jun 2011 21:25:29 +0200
Subject: [PATCH] Add UPGRADE note about annotations parser changes

---
 UPGRADE_TO_2_1 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/UPGRADE_TO_2_1 b/UPGRADE_TO_2_1
index bfb759ec7..69dee07dc 100644
--- a/UPGRADE_TO_2_1
+++ b/UPGRADE_TO_2_1
@@ -4,3 +4,19 @@ your project from Doctrine 2.0.x to 2.1
 ## Interface for EntityRepository
 
 The EntityRepository now has an interface Doctrine\Common\Persistence\ObjectRepository. This means that your classes that override EntityRepository and extend find(), findOneBy() or findBy() must be adjusted to follow this interface.
+
+## AnnotationReader changes
+
+The annotation reader was heavily refactored between 2.0 and 2.1-RC1. In theory the operation of the new reader should be backwards compatible, but it has to be setup differently to work that way:
+
+    $reader = new \Doctrine\Common\Annotations\AnnotationReader();
+    $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
+    // new code necessary starting here
+    $reader->setIgnoreNotImportedAnnotations(true);
+    $reader->setEnableParsePhpImports(false);
+    $reader = new \Doctrine\Common\Annotations\CachedReader(
+        new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache()
+    );
+
+This is already done inside the ``$config->newDefaultAnnotationDriver``, so everything should automatically work if you are using this method. You can verify if everything still works by executing a console command such as schema-validate that loads all metadata into memory.
+