Skip to content

Commit

Permalink
FileJournal: creates directory it needs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkulhan committed Sep 6, 2010
1 parent 73ddbf4 commit 6f34939
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Nette/Caching/FileJournal.php
Expand Up @@ -101,7 +101,15 @@ class FileJournal extends Nette\Object implements ICacheJournal
*/
public function __construct($dir)
{
if (!is_dir($dir)) {
umask(0000);
if (!@mkdir($dir, 0777, TRUE)) { // intentionally @
throw new \InvalidStateException('Cannot create directory ' . $dir . '.');
}
}

$this->file = $dir . '/' . self::FILE;

$this->open();
}

Expand Down

0 comments on commit 6f34939

Please sign in to comment.