From f4a4e5e8e660234b72a7a48b865cdcd95dc3c829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Fri, 26 Jul 2013 20:28:57 +0200 Subject: [PATCH] MDL-40891 prevent exceptions when creating directories in file store Even if cache creation fails moodle should continue working. --- cache/stores/file/lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index 455665817eb..c8e2116b1e2 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -266,7 +266,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i $this->definition = $definition; $hash = preg_replace('#[^a-zA-Z0-9]+#', '_', $this->definition->get_id()); $this->path = $this->filestorepath.'/'.$hash; - make_writable_directory($this->path); + make_writable_directory($this->path, false); if ($this->prescan && $definition->get_mode() !== self::MODE_REQUEST) { $this->prescan = false; } @@ -318,7 +318,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i $dir = $this->path . '/' . $subdir; if ($create) { // Create the directory. This function does it recursivily! - make_writable_directory($dir); + make_writable_directory($dir, false); } return $dir . '/' . $key . '.cache'; }