<commit_before><?php

/**
 * Game Server Monitor
 *
 * Posts notifications when one of the monitored servers has players on it
 *
 * @version 1.0
 */

require_once 'vendor/autoload.php';
require_once 'lib/autoload.php';

$db = new SQLite3('data/gasemon.db');
$ini = parse_ini_file('config.ini');

$tweetBot = new gasemon\AhlTweetBot(
    $ini['tweetbot.cooldown'],
    $ini['tweetbot.consumerKey'],
    $ini['tweetbot.consumerSecret'],
    $ini['tweetbot.accessToken'],
    $ini['tweetbot.accessSecret']
);

$gm = new gasemon\ServerMonitor($db, $tweetBot, 'source');

$gm->runCheck();<commit_msg>Change to current dir at start for relative paths<commit_after><?php

/**
 * Game Server Monitor
 *
 * Posts notifications when one of the monitored servers has players on it
 *
 * @version 1.0
 */

chdir(__DIR__);

require_once 'vendor/autoload.php';
require_once 'lib/autoload.php';

$db = new SQLite3('data/gasemon.db');
$ini = parse_ini_file('config.ini');

$tweetBot = new gasemon\AhlTweetBot(
    $ini['tweetbot.cooldown'],
    $ini['tweetbot.consumerKey'],
    $ini['tweetbot.consumerSecret'],
    $ini['tweetbot.accessToken'],
    $ini['tweetbot.accessSecret']
);

$gm = new gasemon\ServerMonitor($db, $tweetBot, 'source');

$gm->runCheck();
{'fraction_non_alphanumeric': 0.16626506024096385, 'fraction_numerical': 0.004819277108433735, 'mean_word_length': 4.7953488372093025, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3334354', 'n_tokens_mistral': 458, 'n_tokens_neox': 442, 'n_words': 90}