Permalink
Browse files

Merge pull request #66 from lolautruche/filesystem_dir_creation

FileSystem driver now tries to create cache folder before throwing InvalidArgumentException
  • Loading branch information...
2 parents 27c024d + 19436bd commit 1606a2b768da071b97a001434a4d5d341bf975d9 @tedivm tedivm committed Mar 30, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Stash/Driver/FileSystem.php
@@ -384,8 +384,8 @@ protected function checkFileSystemPermissions()
throw new RuntimeException('Cache path was not set correctly.');
}
- if(!is_dir($this->cachePath)) {
- throw new InvalidArgumentException('Cache path is not a directory.');
+ if(!is_dir($this->cachePath) && !@mkdir( $this->cachePath, $this->dirPermissions, true )) {
+ throw new InvalidArgumentException('Failed to create cache path.');
}
if(!is_writable($this->cachePath)) {

0 comments on commit 1606a2b

Please sign in to comment.