Skip to content

Commit 2c495ca

Browse files
committed
Merge pull request #285 from Geolim4/final
Fixed windows driver issue with mkdir
2 parents ae52be5 + 1744ce3 commit 2c495ca

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/phpFastCache/Core/phpFastCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public static function getPath($skip_create_path = false, $config)
199199

200200
if (!@file_exists($full_path) || !@is_writable($full_path)) {
201201
if (!@file_exists($full_path)) {
202-
@mkdir($full_path, self::__setChmodAuto($config));
202+
@mkdir($full_path, self::__setChmodAuto($config), true);
203203
}
204204
if (!@is_writable($full_path)) {
205205
@chmod($full_path, self::__setChmodAuto($config));
@@ -208,7 +208,7 @@ public static function getPath($skip_create_path = false, $config)
208208
// switch back to tmp dir again if the path is not writeable
209209
$full_path = rtrim($tmp_dir,'/') . '/' . $securityKey;
210210
if (!@file_exists($full_path)) {
211-
@mkdir($full_path, self::__setChmodAuto($config));
211+
@mkdir($full_path, self::__setChmodAuto($config), true);
212212
}
213213
if (!@is_writable($full_path)) {
214214
@chmod($full_path, self::__setChmodAuto($config));

src/phpFastCache/Drivers/files.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private function getFilePath($keyword, $skip = false)
7070
*/
7171
if ($skip == false) {
7272
if (!file_exists($path)) {
73-
if (!mkdir($path, $this->__setChmodAuto())) {
73+
if (!mkdir($path, $this->__setChmodAuto(), true)) {
7474
throw new phpFastCacheDriverException('PLEASE CHMOD ' . $this->getPath() . ' - 0777 OR ANY WRITABLE PERMISSION!', 92);
7575
}
7676
}

src/phpFastCache/Drivers/sqlite.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ public function __construct($config = array())
7474
}
7575

7676
if (!file_exists($this->getPath() . '/' . self::SQLITE_DIR)) {
77-
if (!mkdir($this->getPath() . '/' . self::SQLITE_DIR,
78-
$this->__setChmodAuto())
79-
) {
77+
if (!mkdir($this->getPath() . '/' . self::SQLITE_DIR, $this->__setChmodAuto(), true)) {
8078
$this->fallback = true;
8179
}
8280
}

0 commit comments

Comments
 (0)