<commit_before><?php
// TODO, remove these
date_default_timezone_set('America/Los_Angeles');

if(isset($_GET['__route__']) && strstr($_GET['__route__'], '.json'))
  header('Content-type: application/json');

$basePath = dirname(dirname(__FILE__));
$epiPath = "{$basePath}/libraries/external/epi";
require "{$epiPath}/Epi.php";
require "{$basePath}/libraries/compatability.php";
require "{$basePath}/libraries/models/UserConfig.php";

Epi::setSetting('exceptions', true);
Epi::setPath('base', $epiPath);
Epi::setPath('config', "{$basePath}/configs");
Epi::setPath('view', '');
Epi::init('api','cache','config','curl','form','logger','route','session','template','database');

$routeObj = getRoute();
$apiObj = getApi();

// loads configs and dependencies
$userConfigObj = new UserConfig;
$hasConfig = $userConfigObj->load();

$configObj = getConfig();
EpiCache::employ($configObj->get('epi')->cache);
$sessionParams = array($configObj->get('epi')->session);
if($configObj->get('epiSessionParams'))
  $sessionParams = array_merge($sessionParams, (array)$configObj->get('epiSessionParams'));
EpiSession::employ($sessionParams);<commit_msg>Sessions might need to span domains (TLD) so we modify the parameter if needed. #508<commit_after><?php
// TODO, remove these
date_default_timezone_set('America/Los_Angeles');

if(isset($_GET['__route__']) && strstr($_GET['__route__'], '.json'))
  header('Content-type: application/json');

$basePath = dirname(dirname(__FILE__));
$epiPath = "{$basePath}/libraries/external/epi";
require "{$epiPath}/Epi.php";
require "{$basePath}/libraries/compatability.php";
require "{$basePath}/libraries/models/UserConfig.php";

Epi::setSetting('exceptions', true);
Epi::setPath('base', $epiPath);
Epi::setPath('config', "{$basePath}/configs");
Epi::setPath('view', '');
Epi::init('api','cache','config','curl','form','logger','route','session','template','database');

$routeObj = getRoute();
$apiObj = getApi();

// loads configs and dependencies
$userConfigObj = new UserConfig;
$hasConfig = $userConfigObj->load();

$configObj = getConfig();
EpiCache::employ($configObj->get('epi')->cache);
$sessionParams = array($configObj->get('epi')->session);
if($configObj->get('epiSessionParams')) {
  $sessionParams = array_merge($sessionParams, (array)$configObj->get('epiSessionParams'));
  // for TLDs we need to override the cookie domain if specified
  if(isset($sessionParams['domain']) && stristr($_SERVER['HTTP_HOST'], $sessionParams['domain']) === false)
    $sessionParams['domain'] = $_SERVER['HTTP_HOST'];
}
EpiSession::employ($sessionParams);
{'fraction_non_alphanumeric': 0.21328671328671328, 'fraction_numerical': 0.0011655011655011655, 'mean_word_length': 9.258964143426295, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3194132', 'n_tokens_mistral': 828, 'n_tokens_neox': 806, 'n_words': 132}