<commit_before><?php

class dmUnitTestHelper
{
  protected
  $configuration,
  $context,
  $moduleManager;

  public function boot($app = 'admin', $env = 'test', $debug = true)
  {
    $this->bootFast($app, $env, $debug);

    // autoloader
    $autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir').'/project_autoload.cache');
    $autoload->loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array(
    sfConfig::get('sf_symfony_lib_dir').'/config/config',
    sfConfig::get('sf_config_dir'),
    )));
    $autoload->register();

    $this->context = dmContext::createInstance($this->configuration);

    $this->moduleManager = $this->context->getModuleManager();

    dmDb::table('DmPage')->checkBasicPages();

    return $this;
  }

  public function bootFast($app = 'admin', $env = 'test', $debug = true)
  {
    $rootDir = getcwd();

    // configuration
    require_once $rootDir.'/config/ProjectConfiguration.class.php';
    $this->configuration = ProjectConfiguration::getApplicationConfiguration($app, $env, $debug, $rootDir);

    // lime
    include $this->configuration->getSymfonyLibDir().'/vendor/lime/lime.php';

    register_shutdown_function(array($this, 'cleanup'));

    $this->cleanup();

    new sfDatabaseManager($this->configuration);
  }

  function cleanup()
  {
    // try/catch needed due to http://bugs.php.net/bug.php?id=33598
    try
    {
      if(method_exists($this->configuration, 'cleanup'))
      {
        $this->configuration->cleanup(new sfFilesystem());
      }
    }
    catch (Exception $e)
    {
      echo $e.PHP_EOL;
    }
  }<commit_msg>fixed dmUnitTestHelper<commit_after><?php

class dmUnitTestHelper
{
  protected
  $configuration,
  $context,
  $moduleManager;

  public function boot($app = 'admin', $env = 'test', $debug = true)
  {
    $this->bootFast($app, $env, $debug);

    // autoloader
    $autoload = sfSimpleAutoload::getInstance(sfConfig::get('sf_cache_dir').'/project_autoload.cache');
    $autoload->loadConfiguration(sfFinder::type('file')->name('autoload.yml')->in(array(
    sfConfig::get('sf_symfony_lib_dir').'/config/config',
    sfConfig::get('sf_config_dir'),
    )));
    $autoload->register();

    $this->initialize();

    dmDb::table('DmPage')->checkBasicPages();

    return $this;
  }

  public function bootFast($app = 'admin', $env = 'test', $debug = true)
  {
    $rootDir = getcwd();

    // configuration
    require_once $rootDir.'/config/ProjectConfiguration.class.php';
    $this->configuration = ProjectConfiguration::getApplicationConfiguration($app, $env, $debug, $rootDir);

    // lime
    include $this->configuration->getSymfonyLibDir().'/vendor/lime/lime.php';

    register_shutdown_function(array($this, 'cleanup'));

    $this->cleanup();

    new sfDatabaseManager($this->configuration);
  }

  protected function initialize()
  {
    $this->context = dmContext::createInstance($this->configuration);

    $this->moduleManager = $this->context->getModuleManager();
  }

  function cleanup()
  {
    // try/catch needed due to http://bugs.php.net/bug.php?id=33598
    try
    {
      if(method_exists($this->configuration, 'cleanup'))
      {
        $this->configuration->cleanup(new sfFilesystem());
      }
    }
    catch (Exception $e)
    {
      echo $e.PHP_EOL;
    }
  }
{'fraction_non_alphanumeric': 0.17215342796738145, 'fraction_numerical': 0.0030202355783751134, 'mean_word_length': 3.7449856733524354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '6640781', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1044, 'n_words': 155}