Пример #1
0
 /**
  * Generate cache key for given path.
  *
  * @param string $path
  * @return string
  */
 public function generateKey($path)
 {
     $namespace = $this->loader->viewNamespace($path);
     $name = $this->loader->viewName($path);
     $hash = hash('md5', $namespace . ':' . $name . '.' . $this->environment->getID());
     return $this->environment->cacheDirectory() . '/' . $hash . '.php';
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function generateKey($name, $className)
 {
     $hash = hash('md5', $className . '.' . $this->environment->getID());
     return $this->environment->cacheDirectory() . '/' . $hash[0] . $hash[1] . '/' . $hash . '.php';
 }