[Templating] fixed bug when the cache dir does not exist
This commit is contained in:
parent
44c4c58268
commit
5b619bfa2d
@ -34,13 +34,18 @@ class CacheLoader extends Loader
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param Loader $loader A Loader instance
|
* @param Loader $loader A Loader instance
|
||||||
* @param string $dir The directory where to store the cache files
|
* @param string $dir The directory where to store the cache files
|
||||||
*/
|
*/
|
||||||
public function __construct(Loader $loader, $dir)
|
public function __construct(Loader $loader, $dir)
|
||||||
{
|
{
|
||||||
$this->loader = $loader;
|
$this->loader = $loader;
|
||||||
$this->dir = $dir;
|
$this->dir = $dir;
|
||||||
|
|
||||||
|
if (!file_exists($dir))
|
||||||
|
{
|
||||||
|
mkdir($dir, 0777, true);
|
||||||
|
}
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user