Skip to content

Commit

Permalink
fix mailtest, small fix on history file, default mail setting value
Browse files Browse the repository at this point in the history
  • Loading branch information
Slivo-fr committed May 21, 2019
1 parent 346a561 commit 9317df1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion bin/mailcheck.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

require_once('vendor/autoload.php');
require_once(__DIR__ . '/../vendor/autoload.php');
require_once(__DIR__ . '/../Settings.php');

use Killbot\AlertHandler;

Expand Down
10 changes: 8 additions & 2 deletions src/Killbot.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,13 @@ protected function getPendingFiles(): array
protected function saveKillHistory()
{
$this->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+'
);
}

/**
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 9317df1

Please sign in to comment.