We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 222c801 commit 3db3fb1Copy full SHA for 3db3fb1
src/Bridges/CacheDI/CacheExtension.php
@@ -29,7 +29,14 @@ public function __construct($tempDir)
29
30
public function loadConfiguration()
31
{
32
- @mkdir($this->tempDir . '/cache'); // @ - directory may exists
+ $dir = $this->tempDir . '/cache';
33
+ Nette\Utils\FileSystem::createDir($dir);
34
+
35
+ $uniq = uniqid('_', true);
36
+ if (!@mkdir("$dir/$uniq")) { // @ - is escalated to exception
37
+ throw new Nette\InvalidStateException("Unable to write to directory '$dir'. Make this directory writable.");
38
+ }
39
+ rmdir("$dir/$uniq");
40
41
$builder = $this->getContainerBuilder();
42
0 commit comments