Skip to content

Commit

Permalink
Merge pull request #82 from woutersamaey/patch-1
Browse files Browse the repository at this point in the history
Auto-create cache dir as it is likely not to exist
  • Loading branch information
jasny committed Mar 27, 2022
2 parents 5103244 + c9f02a4 commit 0b8f985
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AbstractFile.php
Expand Up @@ -41,6 +41,9 @@ public function __construct(?string $cacheDir = null)
{
if (!$cacheDir) {
$cacheDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'cache';
if(!is_dir($cacheDir)) {
mkdir($cacheDir, 0777, true);
}
}

$this->cacheDir = rtrim($cacheDir, '/');
Expand Down

0 comments on commit 0b8f985

Please sign in to comment.