Skip to content

Commit f1a3d53

Browse files
committed
CacheExtension: throws exception when is unable to create directory or directory is not writable
1 parent 222c801 commit f1a3d53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Bridges/CacheDI/CacheExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ public function __construct($tempDir)
2929

3030
public function loadConfiguration()
3131
{
32-
@mkdir($this->tempDir . '/cache'); // @ - directory may exists
32+
$dir = $this->tempDir . '/cache';
33+
Nette\Utils\FileSystem::createDir($dir);
34+
if (!is_writable($dir)) {
35+
throw new Nette\InvalidStateException("Make directory '$dir' writable.");
36+
}
3337

3438
$builder = $this->getContainerBuilder();
3539

0 commit comments

Comments
 (0)