Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Check if cache folders are writable and display warning

givanz3161992a5aa4
diff --git a/admin/controller/tools/cache.php b/admin/controller/tools/cache.php
index fe2e0f6..0974d70 100755
--- a/admin/controller/tools/cache.php
+++ b/admin/controller/tools/cache.php
@@ -70,6 +70,18 @@ class Cache extends Base {
}
function index() {
- $this->view->isPageCacheDirWritable = is_writable(DIR_PUBLIC . PAGE_CACHE_DIR);
+ $folders = [
+ '/public/page-cache' => DIR_PUBLIC . PAGE_CACHE_DIR,
+ '/public/image-cache' => DIR_PUBLIC . DS . 'image-cache',
+ '/storage/model/app' => DIR_STORAGE . 'model' . DS . 'app',
+ '/storage/model/admin' => DIR_STORAGE . 'model' . DS . 'admin',
+ '/storage/compiled_templates' => DIR_COMPILED_TEMPLATES,
+ ];
+
+ foreach ($folders as $folder => $path) {
+ if (! is_writable($path)) {
+ $this->view->info[] = sprintf('Folder is not writable, clear cache might not work for this layer, make sure that <b>%s</b> is writable by php', $folder);
+ }
+ }
}
}
diff --git a/system/cache-manager.php b/system/cache-manager.php
index 550ae4c..44f5f46 100755
--- a/system/cache-manager.php
+++ b/system/cache-manager.php
@@ -68,7 +68,7 @@ class CacheManager {
}
if ($site_id) {
- $name .= "{$site}_id_";
+ $name .= "{$site_id}_";
}
if ($theme) {