diff --git a/Core/API/LogsAPI.class.php b/Core/API/LogsAPI.class.php index 3d58dd9..ba43157 100644 --- a/Core/API/LogsAPI.class.php +++ b/Core/API/LogsAPI.class.php @@ -83,7 +83,7 @@ namespace Core\API\Logs { } // get all log entries from filesystem (if database failed) - $logPath = realpath(implode(DIRECTORY_SEPARATOR, [WEBROOT, "Core", "Logs"])); + $logPath = realpath(implode(DIRECTORY_SEPARATOR, [WEBROOT, "Site", "Logs"])); if ($logPath) { $index = 1; foreach (scandir($logPath) as $fileName) { diff --git a/Core/API/RoutesAPI.class.php b/Core/API/RoutesAPI.class.php index 8ec63de..43407aa 100644 --- a/Core/API/RoutesAPI.class.php +++ b/Core/API/RoutesAPI.class.php @@ -8,7 +8,7 @@ namespace Core\API { abstract class RoutesAPI extends Request { - const ROUTER_CACHE_CLASS = "\\Core\\Cache\\RouterCache"; + const ROUTER_CACHE_CLASS = "\\Site\\Cache\\RouterCache"; protected string $routerCachePath; diff --git a/Core/API/TemplateAPI.class.php b/Core/API/TemplateAPI.class.php index da46f4e..d82a075 100644 --- a/Core/API/TemplateAPI.class.php +++ b/Core/API/TemplateAPI.class.php @@ -45,7 +45,7 @@ namespace Core\API\Template { return $this->createError("Invalid template file extension. Allowed: " . implode(",", $allowedExtensions)); } - $templateCache = WEBROOT . "/Core/Cache/Templates/"; + $templateCache = WEBROOT . "/Site/Cache/Templates/"; $baseDirs = ["Site", "Core"]; $valid = false; diff --git a/Core/Cache/.gitignore b/Core/Cache/.gitignore deleted file mode 100644 index 75c53ed..0000000 --- a/Core/Cache/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitkeep -!.gitignore \ No newline at end of file diff --git a/Core/Cache/.gitkeep b/Core/Cache/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Core/Documents/Install.class.php b/Core/Documents/Install.class.php index ac0d2c1..8949ad8 100644 --- a/Core/Documents/Install.class.php +++ b/Core/Documents/Install.class.php @@ -250,7 +250,7 @@ namespace Documents\Install { $username = posix_getpwuid($userId)['name']; $failedRequirements[] = sprintf("%s is not owned by current user: $username ($userId). " . "Try running chown -R $userId %s or give the required directories write permissions: " . - "Site/Configuration, Core/Cache, Core/External", + "Site/Configuration, Site/Cache, Site/Logs, Core/External", WEBROOT, WEBROOT); $success = false; } diff --git a/Core/Driver/Logger/Logger.class.php b/Core/Driver/Logger/Logger.class.php index 7929e2b..dc40a84 100644 --- a/Core/Driver/Logger/Logger.class.php +++ b/Core/Driver/Logger/Logger.class.php @@ -82,7 +82,7 @@ class Logger { $module = preg_replace("/[^a-zA-Z0-9-]/", "-", $this->module); $date = (\DateTime::createFromFormat('U.u', microtime(true)))->format(self::LOG_FILE_DATE_FORMAT); $logFile = implode("_", [$module, $severity, $date]) . ".log"; - $logPath = implode(DIRECTORY_SEPARATOR, [WEBROOT, "Core", "Logs", $logFile]); + $logPath = implode(DIRECTORY_SEPARATOR, [WEBROOT, "Site", "Logs", $logFile]); @file_put_contents($logPath, $message); } @@ -130,7 +130,7 @@ class Logger { /** * Calling this method will prevent the logger from persisting log messages (writing to database/file), */ - public function unitTestMode() { + public function unitTestMode(): void { $this->unitTestMode = true; } } \ No newline at end of file diff --git a/Core/Elements/TemplateDocument.class.php b/Core/Elements/TemplateDocument.class.php index 87da5c8..f5f0c7f 100644 --- a/Core/Elements/TemplateDocument.class.php +++ b/Core/Elements/TemplateDocument.class.php @@ -31,7 +31,7 @@ class TemplateDocument extends Document { $this->parameters = $params; $this->twigLoader = new FilesystemLoader(self::TEMPLATE_PATH); $this->twigEnvironment = new Environment($this->twigLoader, [ - 'cache' => WEBROOT . '/Core/Cache/Templates/', + 'cache' => WEBROOT . '/Site/Cache/Templates/', 'auto_reload' => true ]); $this->twigEnvironment->addExtension(new CustomTwigFunctions()); diff --git a/Core/Logs/.htaccess b/Core/Logs/.htaccess deleted file mode 100644 index 47a6aee..0000000 --- a/Core/Logs/.htaccess +++ /dev/null @@ -1 +0,0 @@ -DENY FROM ALL \ No newline at end of file diff --git a/Core/Objects/Router/Router.class.php b/Core/Objects/Router/Router.class.php index b986433..9bbe2fc 100644 --- a/Core/Objects/Router/Router.class.php +++ b/Core/Objects/Router/Router.class.php @@ -113,7 +113,7 @@ class Router { * This file is automatically generated by the RoutesAPI on $date. */ -namespace Core\Cache; +namespace Site\Cache; $uses class RouterCache extends Router { diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 927866c..80ab317 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -13,8 +13,8 @@ RUN apt-get update -y && \ docker-php-ext-install gd && \ npm install --global yarn && ln -s /usr/local/bin/yarn /usr/bin/yarn -# Runkit (no stable release available) -RUN pecl install runkit7-4.0.0a3 && docker-php-ext-enable runkit7 && \ +# Runkit for unit testing (no stable release available) +RUN pecl install runkit7-4.0.0a6 && docker-php-ext-enable runkit7 && \ echo "runkit.internal_override=1" >> /usr/local/etc/php/conf.d/docker-php-ext-runkit7.ini # mysqli, zip, gmp diff --git a/index.php b/index.php index 995e3be..d0ad459 100644 --- a/index.php +++ b/index.php @@ -40,7 +40,7 @@ if ($installation) { } else { $router = null; - $routerCacheClass = '\Core\Cache\RouterCache'; + $routerCacheClass = '\Site\Cache\RouterCache'; $routerCachePath = getClassPath($routerCacheClass); if (is_file($routerCachePath)) { @include_once $routerCachePath;