first commit

This commit is contained in:
O K
2025-12-07 13:58:49 +02:00
commit bbe4168168
9 changed files with 412 additions and 0 deletions

15
classes/BotLogger.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
class BotLogger
{
const LOG_FILE = _PS_ROOT_DIR_ . '/var/logs/botlimiter_ban.log';
public static function logBan($ip, $reason)
{
$date = date('Y-m-d H:i:s');
$message = sprintf("[%s] [IP:%s] [REASON:%s]" . PHP_EOL, $date, $ip, $reason);
// Append to log file
file_put_contents(self::LOG_FILE, $message, FILE_APPEND | LOCK_EX);
}
}