Reduce the name of the cache directories to 1 character

This commit is contained in:
Tristan Darricau
2015-04-28 19:35:37 +02:00
parent 7d5fe0fbd4
commit 29723092b8
+3 -3
View File
@@ -250,7 +250,7 @@ class Twig_Environment
$class = substr($this->getTemplateClass($name), strlen($this->templateClassPrefix));
return $this->getCache().'/'.substr($class, 0, 2).'/'.substr($class, 2, 2).'/'.substr($class, 4).'.php';
return $this->getCache().'/'.$class[0].'/'.$class[1].'/'.$class.'.php';
}
/**
@@ -1271,11 +1271,11 @@ class Twig_Environment
if (false === @mkdir($dir, 0777, true)) {
clearstatcache(false, $dir);
if (!is_dir($dir)) {
throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir));
throw new RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir));
}
}
} elseif (!is_writable($dir)) {
throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir));
throw new RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir));
}
$tmpFile = tempnam($dir, basename($file));