diff --git a/.htaccess b/public/.htaccess
similarity index 68%
rename from .htaccess
rename to public/.htaccess
index eadd3fa..b9204c7 100644
--- a/.htaccess
+++ b/public/.htaccess
@@ -3,18 +3,15 @@
RewriteEngine On
- RewriteCond %{REQUEST_FILENAME} !-f [OR]
- RewriteCond %{REQUEST_FILENAME} -f
+ RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^(.*)$ src/index.php [L]
+ RewriteRule ^(.*)$ index.php [L]
-
-# RedirectMatch 403 ^/vendor/*$
-ErrorDocument 403 /src/index.php
+ErrorDocument 403 /index.php
-
+
Order Allow,Deny
Deny from all
diff --git a/src/index.php b/public/index.php
similarity index 94%
rename from src/index.php
rename to public/index.php
index d7c0ef2..614421b 100644
--- a/src/index.php
+++ b/public/index.php
@@ -16,6 +16,11 @@ $ap = AdminPanel::getInstance();
2: match routes directly with modules
*/
$cache = $ap->getCache();
+
+if (!$ap->isCacheEnabled()) {
+ $cache->clear();
+}
+
$caches = $cache->getMultiple(array(
'routes',
'templates',
@@ -24,8 +29,9 @@ $caches = $cache->getMultiple(array(
//if cache don't exist create it!
$cachesBool = $caches["routes"] === null || $caches['templates'] === null || $caches['forms'] === null;
-if (!($ap->isCacheEnabled()) || $cachesBool) {
- $modulesDIR = __DIR__ . "/Modules";
+if (!$ap->isCacheEnabled() || $cachesBool) {
+ $cache->clear();
+ $modulesDIR = dirname(__DIR__) . "/src/Modules";
$modules = array_diff(scandir($modulesDIR), array('..', '.'));
/** @var string $module */
foreach ($modules as $module) {
@@ -65,7 +71,8 @@ if (!($ap->isCacheEnabled()) || $cachesBool) {
}
$caches = $cache->getMultiple(array(
'routes',
- 'templates'
+ 'templates',
+ 'forms'
));
}
//load each templates