fixed cache option initialization

This commit is contained in:
Fabien Potencier
2011-01-06 08:03:47 +01:00
parent dbc5bdbd87
commit d2d63bd11b
+5 -7
View File
@@ -103,9 +103,7 @@ class Twig_Environment
);
$this->strictVariables = (bool) $options['strict_variables'];
$this->runtimeInitialized = false;
if ($options['cache']) {
$this->setCache($options['cache']);
}
$this->setCache($options['cache']);
}
/**
@@ -224,11 +222,11 @@ class Twig_Environment
*/
public function setCache($cache)
{
$this->cache = $cache;
if ($this->cache && !is_dir($this->cache)) {
mkdir($this->cache, 0777, true);
if (!$this->cache) {
$this->cache = false;
}
$this->cache = $cache;
}
/**