Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: 2.0.0-BETA2, 2.0.0-BETA3, 2.0.0-BETA4
-
Fix Version/s: None
-
Component/s: Annotations
-
Labels:None
Description
Take a look at lib/Doctrine/Common/Annotations/AnnotationReader.php:137
/**
* Gets the annotations applied to a class.
*
* @param string|ReflectionClass $class The name or ReflectionClass of the class from which
* the class annotations should be read.
* @return array An array of Annotations.
*/
public function getClassAnnotations(ReflectionClass $class)
{
$cacheKey = $class->getName() . self::$CACHE_SALT;
// Attempt to grab data from cache
if (($data = $this->cache->fetch($cacheKey)) !== false) {
return $data;
}
$annotations = $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
$this->cache->save($cacheKey, $annotations, null);
return $annotations;
}
It uses the class name and a static salt to create a cache key. Actually, everything in that class uses a class name to assemble a cache key.
This makes it impossible to have mulitple instances of the same application in different states. Practically: it makes it impossible to have testing and staging, or staging and production versions on the same host if they use the same type of caching (which you sort of need in a staging environment).
Confused "fix" with "affects", sorry