Moved index & htaccess to public folder

This commit is contained in:
Florian Bouillon 2019-04-25 10:26:11 +02:00
parent 51a299bf62
commit ae535719f2
2 changed files with 14 additions and 10 deletions

View File

@ -3,18 +3,15 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ src/index.php [L]
RewriteRule ^(.*)$ index.php [L]
</IfModule>
# RedirectMatch 403 ^/vendor/*$
ErrorDocument 403 /src/index.php
ErrorDocument 403 /index.php
<FilesMatch ".*\.(php|html|twig|json)$">
<FilesMatch ".*\.(php)$">
<IfVersion < 2.4>
Order Allow,Deny
Deny from all

View File

@ -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