Skip to content
This repository
Browse code

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

…validArgumentException
  • Loading branch information...
commit 19436bda6bcc6e9c5df7ff4f52027d2f12cba8ea 1 parent 071352c
Jérôme Vieilledent authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  src/Stash/Driver/FileSystem.php
4  src/Stash/Driver/FileSystem.php
@@ -384,8 +384,8 @@ protected function checkFileSystemPermissions()
384 384
             throw new RuntimeException('Cache path was not set correctly.');
385 385
         }
386 386
 
387  
-        if(!is_dir($this->cachePath)) {
388  
-            throw new InvalidArgumentException('Cache path is not a directory.');
  387
+        if(!is_dir($this->cachePath) && !@mkdir( $this->cachePath, $this->dirPermissions, true )) {
  388
+            throw new InvalidArgumentException('Failed to create cache path.');
389 389
         }
390 390
 
391 391
         if(!is_writable($this->cachePath)) {

0 notes on commit 19436bd

Please sign in to comment.
Something went wrong with that request. Please try again.