Sync global-autoresponder current state

This commit is contained in:
Marek Miklewicz
2026-07-04 15:16:50 +02:00
parent 196ee224fe
commit af775ce976
47 changed files with 1165 additions and 1037 deletions
+18
View File
@@ -8,6 +8,7 @@ final class PluginLogger
public static function init(string $path): void
{
self::$path = $path;
self::ensureLogFile();
@ini_set('log_errors', '1');
@ini_set('error_log', $path);
@@ -67,4 +68,21 @@ final class PluginLogger
default => 'E_' . $severity,
};
}
private static function ensureLogFile(): void
{
if (self::$path === '') {
return;
}
$dir = dirname(self::$path);
if (!is_dir($dir) || !is_writable($dir)) {
return;
}
if (!is_file(self::$path)) {
@file_put_contents(self::$path, '');
}
if (is_file(self::$path)) {
@chmod(self::$path, 0600);
}
}
}