Skip to content

Commit

Permalink
CacheExtension: throws exception when is unable to create directory o…
Browse files Browse the repository at this point in the history
…r directory is not writable
  • Loading branch information
dg committed Aug 17, 2017
1 parent 222c801 commit f1a3d53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Bridges/CacheDI/CacheExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public function __construct($tempDir)

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

$builder = $this->getContainerBuilder();

Expand Down

0 comments on commit f1a3d53

Please sign in to comment.