From 9317df199a8b7ef033a82b06c674006411d15ba9 Mon Sep 17 00:00:00 2001 From: Slivo-fr Date: Tue, 21 May 2019 13:49:06 +0200 Subject: [PATCH] fix mailtest, small fix on history file, default mail setting value --- Settings.php | 2 +- bin/mailcheck.php | 3 ++- src/Killbot.php | 10 ++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Settings.php b/Settings.php index 937aa4e..876ff85 100644 --- a/Settings.php +++ b/Settings.php @@ -41,7 +41,7 @@ class Settings ******************************************************************************************************************/ // Enable sending mails - public static $SEND_MAIL = true; + public static $SEND_MAIL = false; // Server configuration public static $SMTP_SERVER = 'smtp.example.com'; diff --git a/bin/mailcheck.php b/bin/mailcheck.php index c33320b..b657995 100644 --- a/bin/mailcheck.php +++ b/bin/mailcheck.php @@ -1,6 +1,7 @@ killHistory = array_slice($this->killHistory, 0, Settings::$KILL_HISTORY_MAX_LENGTH); - Utils::writeFile(json_encode($this->killHistory), Utils::getLogPath(), self::KILL_HISTORY_FILENAME, 'w+'); + + Utils::writeFile( + json_encode($this->killHistory) . PHP_EOL, + Utils::getLogPath(), + self::KILL_HISTORY_FILENAME, + 'w+' + ); } /** @@ -399,7 +405,7 @@ protected function loadKillHistory() $file = Utils::getLogPath().self::KILL_HISTORY_FILENAME; if (file_exists($file)) { - $json = file_get_contents(Utils::getLogPath().self::KILL_HISTORY_FILENAME); + $json = file_get_contents(Utils::getLogPath() . self::KILL_HISTORY_FILENAME); $this->killHistory = json_decode($json, true); } }