Skip to content

Commit 1542bb2

Browse files
committed
CacheExtension: avoid autoloading of FileStorage when not required
1 parent 5413285 commit 1542bb2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Bridges/CacheDI/CacheExtension.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ public function loadConfiguration()
4848

4949
public function afterCompile(Nette\PhpGenerator\ClassType $class)
5050
{
51-
$class->methods['initialize']->addBody(
52-
'Nette\Caching\Storages\FileStorage::$useDirectories = ?;',
53-
array($this->checkTempDir($this->tempDir . '/cache'))
54-
);
51+
if (!$this->checkTempDir($this->tempDir . '/cache')) {
52+
$class->methods['initialize']->addBody('Nette\Caching\Storages\FileStorage::$useDirectories = FALSE;');
53+
}
5554
}
5655

5756

0 commit comments

Comments
 (0)