Skip to content

Commit

Permalink
Add creating of cache directory if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Nov 28, 2023
1 parent 20c23c1 commit eebe225
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Supportive/DependencyInjection/ServiceContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,17 @@ private static function loadServices(ContainerBuilder $container, ?SplFileInfo $
return;
}

if (!file_exists($cacheFile->getPathname())
$dirname = $cacheFile->getPath() ?: '.';

if ((
!is_dir($dirname)
&& mkdir($dirname.'/', 0777, true)
&& !is_dir($dirname)
) || (
!file_exists($cacheFile->getPathname())
&& !touch($cacheFile->getPathname())
&& !is_writable($cacheFile->getPathname())
) {
)) {
throw CacheFileException::notWritable($cacheFile);
}

Expand Down

0 comments on commit eebe225

Please sign in to comment.