<commit_before><?php
session_start(); //Initialize session

// Load all config file
foreach (glob('config/*.php') as $file)
  include $file;

global $conf_env;

if ($conf_env['error page']) {
  function call_phrame_exception ($exception) {
    global $conf_env;
    global $error;
    $error = $exception;
    header('HTTP/1.1 500 Internal Server Error');
    include $conf_env['error page'];
  }
  set_exception_handler('call_phrame_exception');
  
  function error_handler($errorType, $message) {
    if ($errorType != E_NOTICE) {
      call_phrame_exception($message);
    }
  }
  set_error_handler('error_handler');
}

include 'phrame/adapter/'.$db_conf['adapter'].'.php';
db::connect($db_conf);

// Automaticly load all classes needed
function __autoload ($class_name) {
  $file_name = strtolower($class_name);
  switch (true) {
  // --- Phrame system files ---
  case file_exists('phrame/'.$file_name.'.php'):
    include 'phrame/'.$file_name.'.php'; break;

  // --- Controllers ---
  case file_exists('controllers/'.$file_name.'.php'):
    include 'controllers/'.$file_name.'.php'; break;<commit_msg>error_handler fixed<commit_after><?php
session_start(); //Initialize session

// Load all config file
foreach (glob('config/*.php') as $file)
  include $file;

global $conf_env;

if ($conf_env['error page']) {
  function call_phrame_exception ($exception) {
    global $conf_env;
    global $error;
    $error = $exception;
    header('HTTP/1.1 500 Internal Server Error');
    include $conf_env['error page'];
  }
  set_exception_handler('call_phrame_exception');
  
  function error_handler($errorType, $message) {
    if ($errorType != E_NOTICE) {
      call_phrame_exception(new Exception($message));
    }
  }
  set_error_handler('error_handler');
}

include 'phrame/adapter/'.$db_conf['adapter'].'.php';
db::connect($db_conf);

// Automaticly load all classes needed
function __autoload ($class_name) {
  $file_name = strtolower($class_name);
  switch (true) {
  // --- Phrame system files ---
  case file_exists('phrame/'.$file_name.'.php'):
    include 'phrame/'.$file_name.'.php'; break;

  // --- Controllers ---
  case file_exists('controllers/'.$file_name.'.php'):
    include 'controllers/'.$file_name.'.php'; break;
{'fraction_non_alphanumeric': 0.16808225301743407, 'fraction_numerical': 0.004470272686633884, 'mean_word_length': 4.097949886104783, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1236295', 'n_tokens_mistral': 751, 'n_tokens_neox': 739, 'n_words': 149}