Skip to content

Commit 19cacc7

Browse files
author
Sebastian Buckpesch
committed
Check if cache folder exists instead of trying to create it all the time
1 parent 52f396b commit 19cacc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AppArena/Models/Cache.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function __construct( $options ) {
4242
$dir = $options['dir'];
4343
}
4444
if ( $dir ) {
45-
if ( ! @mkdir( $dir, 0755, true ) && ! is_dir( $dir ) ) {
46-
throw new \Exception( 'Cannot create cache folder' );
47-
}
45+
if (!file_exists($dir) && !@mkdir($dir, 0755, true) && !is_dir($dir)) {
46+
throw new \Exception( 'Cannot create cache folder' );
47+
}
4848

4949
if ( ! is_writable( $dir ) ) {
5050
throw new \Exception( $dir . ' is not writeable for the webserver.' );

0 commit comments

Comments
 (0)