<commit_before><?php
/**
 * Router script for test server
 */
error_reporting(E_ALL | E_PARSE);
define('WCMF_BASE', realpath(dirname(__FILE__).'/../..').'/');

use wcmf\lib\core\ClassLoader;
use wcmf\lib\presentation\Application;
use wcmf\lib\util\TestUtil;

// remove everything after ? from url
$requestedFile = preg_replace('/\?.*$/', '', $_SERVER["REQUEST_URI"]);
if (is_file(WCMF_BASE.'app/public'.$requestedFile)) {
  // serve the requested resource as-is.
  return false;
}
else {
  require_once(dirname(WCMF_BASE)."/vendor/autoload.php");
  new ClassLoader(WCMF_BASE);

  TestUtil::initFramework(WCMF_BASE.'app/config/');

  // create the application
  $application = new Application();
  try {
    // initialize the application
    $request = $application->initialize('', '', 'cms');

    // run the application
    $application->run($request);
  }
  catch (Exception $ex) {
    try {
      $application->handleException($ex);
    }
    catch (Exception $unhandledEx) {
      var_dump($unhandledEx);
    }
  }
}
?><commit_msg>fixing tests<commit_after><?php
/**
 * Router script for test server
 */
error_reporting(E_ALL | E_PARSE);
define('WCMF_BASE', realpath(dirname(__FILE__).'/../..').'/');

use wcmf\lib\core\ClassLoader;
use wcmf\lib\presentation\Application;
use wcmf\lib\util\TestUtil;

// remove everything after ? from url
$requestedFile = preg_replace('/\?.*$/', '', $_SERVER["REQUEST_URI"]);
if (is_file(WCMF_BASE.'app/public'.$requestedFile)) {
  // serve the requested resource as-is.
  return false;
}
else {
  require_once(dirname(WCMF_BASE)."/vendor/autoload.php");
  new ClassLoader(WCMF_BASE);

  TestUtil::initFramework(WCMF_BASE.'app/config/');

  // create the application
  $application = new Application();
  try {
    // initialize the application
    $request = $application->initialize('', '', 'cms');

    // run the application
    $application->run($request);
  }
  catch (Exception $ex) {
    try {
      $application->handleException($ex);
    }
    catch (Exception $unhandledEx) {
      var_export($unhandledEx);
    }
  }
}
?>
{'fraction_non_alphanumeric': 0.17382906808305165, 'fraction_numerical': 0.0, 'mean_word_length': 3.8411214953271027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2099409', 'n_tokens_mistral': 709, 'n_tokens_neox': 690, 'n_words': 129}