Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
Check if cached page should be directory and save to /index.html
givanz1cb64248a249
diff --git a/system/cache/file.php b/system/cache/file.phpindex 2e82d6e..70cda03 100755--- a/system/cache/file.php+++ b/system/cache/file.php@@ -81,11 +81,14 @@ class File {$file = $this->cacheDir . $namespace . '.' . $this->cachePrefix . basename($key) . '.' . $expire;$handle = fopen($file, 'w');- flock($handle, LOCK_EX);- fwrite($handle, json_encode($value/*, JSON_PRETTY_PRINT*/));- fflush($handle);- flock($handle, LOCK_UN);- fclose($handle);++ if ($handle) {+ flock($handle, LOCK_EX);+ fwrite($handle, json_encode($value/*, JSON_PRETTY_PRINT*/));+ fflush($handle);+ flock($handle, LOCK_UN);+ fclose($handle);+ }}public function getMulti($namespace, $keys, $serverKey = false) {diff --git a/system/page-cache.php b/system/page-cache.phpindex 1cd10e6..cba4d21 100755--- a/system/page-cache.php+++ b/system/page-cache.php@@ -70,7 +70,7 @@ class PageCache {}if (substr($path, -1) == '/') {- $path .= 'index.html';+ $path .= DS . 'index.html';}return $file_cache = $this->cacheFolder . $path;@@ -95,6 +95,10 @@ class PageCache {function startGenerating() {$dir = dirname($this->fileName);+ if (is_dir($this->fileName)) {+ $this->fileName .= DS . 'index.html';+ }+if (! is_dir($dir)) {//if page with the same name as folder removeif (file_exists($dir)) {@@ -185,7 +189,7 @@ class PageCache {http_response_code() == 200) {//create directory structureif (is_dir($this->fileName)) {- $this->fileName .= 'index.html';+ $this->fileName .= DS . 'index.html';}$dir = dirname($this->fileName);