<commit_before><?php
/*

All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.

---------------------------------------------------------------------
Emoncms - open source energy visualisation
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org

*/

define('EMONCMS_EXEC', 1);
chdir("/var/www/master");
require "process_settings.php";
require "Lib/EmonLogger.php";
$log = new EmonLogger(__FILE__);

// Connect to mysql
$mysqli = @new mysqli(
    $settings["sql"]["server"],
    $settings["sql"]["username"],
    $settings["sql"]["password"],
    $settings["sql"]["database"],
    $settings["sql"]["port"]
);

if ($mysqli->connect_error) { 
    $log->error("Cannot connect to MYSQL database:". $mysqli->connect_error);
    die('Check log\n');
}

// Connect to redis
if ($settings['redis']['enabled']) {
    $redis = new Redis();
    if (!$redis->connect($settings['redis']['host'], $settings['redis']['port'])) {
        $log->error("Cannot connect to redis at ".$settings['redis']['host'].":".$settings['redis']['port']);  die('Check log\n');
    }
    if (!empty($settings['redis']['prefix'])) $redis->setOption(Redis::OPT_PREFIX, $settings['redis']['prefix']);
    if (!empty($settings['redis']['auth'])) {
        if (!$redis->auth($settings['redis']['auth'])) {
            $log->error("Cannot connect to redis at ".$settings['redis']['host'].", autentication failed"); die('Check log\n');
        }
    }
} else {
    $redis = false;
}

// Default userid 
$userid = 1;

require("Modules/user/user_model.php");
$user = new User($mysqli,$redis,null);

require_once "Modules/feed/feed_model.php";
$feed = new Feed($mysqli,$redis,$settings['feed']);
<commit_msg>revert change to load_emoncms<commit_after><?php
/*

All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.

---------------------------------------------------------------------
Emoncms - open source energy visualisation
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org

*/

define('EMONCMS_EXEC', 1);
chdir("/var/www/emoncms");
require "process_settings.php";
require "Lib/EmonLogger.php";
$log = new EmonLogger(__FILE__);

// Connect to mysql
$mysqli = @new mysqli(
    $settings["sql"]["server"],
    $settings["sql"]["username"],
    $settings["sql"]["password"],
    $settings["sql"]["database"],
    $settings["sql"]["port"]
);

if ($mysqli->connect_error) { 
    $log->error("Cannot connect to MYSQL database:". $mysqli->connect_error);
    die('Check log\n');
}

// Connect to redis
if ($settings['redis']['enabled']) {
    $redis = new Redis();
    if (!$redis->connect($settings['redis']['host'], $settings['redis']['port'])) {
        $log->error("Cannot connect to redis at ".$settings['redis']['host'].":".$settings['redis']['port']);  die('Check log\n');
    }
    if (!empty($settings['redis']['prefix'])) $redis->setOption(Redis::OPT_PREFIX, $settings['redis']['prefix']);
    if (!empty($settings['redis']['auth'])) {
        if (!$redis->auth($settings['redis']['auth'])) {
            $log->error("Cannot connect to redis at ".$settings['redis']['host'].", autentication failed"); die('Check log\n');
        }
    }
} else {
    $redis = false;
}

// Default userid 
$userid = 1;

require("Modules/user/user_model.php");
$user = new User($mysqli,$redis,null);

require_once "Modules/feed/feed_model.php";
$feed = new Feed($mysqli,$redis,$settings['feed']);

{'fraction_non_alphanumeric': 0.24562410329985654, 'fraction_numerical': 0.0011477761836441894, 'mean_word_length': 3.841666666666667, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '469500', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1116, 'n_words': 227}