<commit_before><?php
/* 
 * Sets up the Felix Online environment 
 */

date_default_timezone_set('Europe/London');

// define current working directory
if(!defined('BASE_DIRECTORY')) define('BASE_DIRECTORY', dirname(__FILE__));
if(!defined('CACHE_DIRECTORY')) define('CACHE_DIRECTORY', BASE_DIRECTORY.'/cache/');

// Composer
require BASE_DIRECTORY.'/vendor/autoload.php';

require_once(BASE_DIRECTORY.'/inc/ez_sql_core.php');
require_once(BASE_DIRECTORY.'/inc/ez_sql_mysqli.php');
require_once(BASE_DIRECTORY.'/inc/SafeSQL.class.php');
require_once(BASE_DIRECTORY.'/glue.php');
$config = require_once(BASE_DIRECTORY.'/inc/config.inc.php');
require_once(BASE_DIRECTORY.'/inc/const.inc.php');
require_once(BASE_DIRECTORY.'/inc/functions.inc.php'); // TODO move to utilities
require_once(BASE_DIRECTORY.'/inc/validator.inc.php');
require_once(BASE_DIRECTORY.'/inc/is_email.inc.php');

/*
 * Models
 */
require_once(BASE_DIRECTORY.'/core/baseModel.class.php');
require_once(BASE_DIRECTORY.'/core/BaseManager.php');
require_once(BASE_DIRECTORY.'/core/user.class.php');
require_once(BASE_DIRECTORY.'/core/frontpage.class.php');
foreach (glob(BASE_DIRECTORY.'/core/*.php') as $filename) {
	require_once($filename);
}

//require_once(BASE_DIRECTORY.'/inc/authentication.php');
require_once(BASE_DIRECTORY.'/inc/rss.inc.php');

// Initialize Akismet
if (LOCAL) { // development connector
	$connector = new \RzekaE\Akismet\Connector\Test();
} else {
	$connector = new \RzekaE\Akismet\Connector\Curl();
}
$akismet = new \RzekaE\Akismet\Akismet($connector);

// Initialize App
$app = new \FelixOnline\Core\App($config);

$app['db'] = $db;

$app['safesql'] = $safesql;

$app['env'] = \FelixOnline\Core\Environment::getInstance();
$app['currentuser'] = new CurrentUser();

$app->run();<commit_msg>Don't initialise environment in bootstrap. It is done in the app class<commit_after><?php
/* 
 * Sets up the Felix Online environment 
 */

date_default_timezone_set('Europe/London');

// define current working directory
if(!defined('BASE_DIRECTORY')) define('BASE_DIRECTORY', dirname(__FILE__));
if(!defined('CACHE_DIRECTORY')) define('CACHE_DIRECTORY', BASE_DIRECTORY.'/cache/');

// Composer
require BASE_DIRECTORY.'/vendor/autoload.php';

require_once(BASE_DIRECTORY.'/inc/ez_sql_core.php');
require_once(BASE_DIRECTORY.'/inc/ez_sql_mysqli.php');
require_once(BASE_DIRECTORY.'/inc/SafeSQL.class.php');
require_once(BASE_DIRECTORY.'/glue.php');
$config = require_once(BASE_DIRECTORY.'/inc/config.inc.php');
require_once(BASE_DIRECTORY.'/inc/const.inc.php');
require_once(BASE_DIRECTORY.'/inc/functions.inc.php'); // TODO move to utilities
require_once(BASE_DIRECTORY.'/inc/validator.inc.php');
require_once(BASE_DIRECTORY.'/inc/is_email.inc.php');

/*
 * Models
 */
require_once(BASE_DIRECTORY.'/core/baseModel.class.php');
require_once(BASE_DIRECTORY.'/core/BaseManager.php');
require_once(BASE_DIRECTORY.'/core/user.class.php');
require_once(BASE_DIRECTORY.'/core/frontpage.class.php');
foreach (glob(BASE_DIRECTORY.'/core/*.php') as $filename) {
	require_once($filename);
}

//require_once(BASE_DIRECTORY.'/inc/authentication.php');
require_once(BASE_DIRECTORY.'/inc/rss.inc.php');

// Initialize Akismet
if (LOCAL) { // development connector
	$connector = new \RzekaE\Akismet\Connector\Test();
} else {
	$connector = new \RzekaE\Akismet\Connector\Curl();
}
$akismet = new \RzekaE\Akismet\Akismet($connector);

// Initialize App
$app = new \FelixOnline\Core\App($config);

$app['db'] = $db;
$app['safesql'] = $safesql;

$app['currentuser'] = new CurrentUser();

$app->run();
{'fraction_non_alphanumeric': 0.17957351290684623, 'fraction_numerical': 0.0, 'mean_word_length': 6.275510204081633, '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': '2428664', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1261, 'n_words': 164}