Core/(Logs|Cache) -> Site

This commit is contained in:
2022-12-04 13:21:40 +01:00
parent b1059717c7
commit 87f7b44010
12 changed files with 11 additions and 15 deletions

View File

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

View File

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

View File

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

View File

@@ -1,3 +0,0 @@
*
!.gitkeep
!.gitignore

View File

View File

@@ -250,7 +250,7 @@ namespace Documents\Install {
$username = posix_getpwuid($userId)['name'];
$failedRequirements[] = sprintf("<b>%s</b> is not owned by current user: $username ($userId). " .
"Try running <b>chown -R $userId %s</b> or give the required directories write permissions: " .
"<b>Site/Configuration</b>, <b>Core/Cache</b>, <b>Core/External</b>",
"<b>Site/Configuration</b>, <b>Site/Cache</b>, <b>Site/Logs</b>, <b>Core/External</b>",
WEBROOT, WEBROOT);
$success = false;
}

View File

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

View File

@@ -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());

View File

@@ -1 +0,0 @@
DENY FROM ALL

View File

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