예제 #1
0
 /**
  * Loads document proxy class into cache.
  *
  * @param \ReflectionClass $reflectionClass
  *
  * @return string Proxy document path.
  */
 public function load(\ReflectionClass $reflectionClass)
 {
     $cacheBundleDir = $this->getCacheDir($reflectionClass->getName());
     $cache = new ConfigCache($cacheBundleDir . DIRECTORY_SEPARATOR . md5(strtolower($reflectionClass->getShortName())) . '.php', $this->debug);
     if (!$cache->isFresh()) {
         $code = ProxyFactory::generate($reflectionClass);
         $cache->write($code, [new FileResource($reflectionClass->getFileName())]);
     }
     return $cache->getPath();
 }