Permalink
Browse files

FileSystem driver now tries to create cache folder before throwing In…

…validArgumentException
  • Loading branch information...
1 parent 071352c commit 19436bda6bcc6e9c5df7ff4f52027d2f12cba8ea @lolautruche lolautruche committed Mar 8, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Stash/Driver/FileSystem.php
View
4 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 19436bd

Please sign in to comment.