public function FileCacheReader::getClassAnnotations in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php \Doctrine\Common\Annotations\FileCacheReader::getClassAnnotations()
Gets the annotations applied to a class.
Parameters
\ReflectionClass $class The ReflectionClass of the class from which: the class annotations should be read.
Return value
array An array of Annotations.
Overrides Reader::getClassAnnotations
1 call to FileCacheReader::getClassAnnotations()
- FileCacheReader::getClassAnnotation in vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ FileCacheReader.php - Gets a class annotation.
File
- vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ FileCacheReader.php, line 96
Class
- FileCacheReader
- File cache reader for annotations.
Namespace
Doctrine\Common\AnnotationsCode
public function getClassAnnotations(\ReflectionClass $class) {
if (!isset($this->classNameHashes[$class->name])) {
$this->classNameHashes[$class->name] = sha1($class->name);
}
$key = $this->classNameHashes[$class->name];
if (isset($this->loadedAnnotations[$key])) {
return $this->loadedAnnotations[$key];
}
$path = $this->dir . '/' . strtr($key, '\\', '-') . '.cache.php';
if (!is_file($path)) {
$annot = $this->reader
->getClassAnnotations($class);
$this
->saveCacheFile($path, $annot);
return $this->loadedAnnotations[$key] = $annot;
}
if ($this->debug && false !== ($filename = $class
->getFilename()) && filemtime($path) < filemtime($filename)) {
@unlink($path);
$annot = $this->reader
->getClassAnnotations($class);
$this
->saveCacheFile($path, $annot);
return $this->loadedAnnotations[$key] = $annot;
}
return $this->loadedAnnotations[$key] = (include $path);
}