<commit_before><?php

require_once dirname(__FILE__).'/../../../../../../autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->enableAllPluginsExcept();
  }

  public function initializeDoctrine()
  {
    chdir(sfConfig::get('sf_root_dir'));

    $task = new sfDoctrineBuildTask($this->dispatcher, new sfFormatter());
    $task->setConfiguration($this);
    $task->run(array(), array(
      'no-confirmation' => true,
      'db'              => true,
      'model'           => true,
      'forms'           => true,
      'filters'         => true,
    ));
  }

  public function loadFixtures($fixtures)
  {
    $path = sfConfig::get('sf_data_dir') . '/' . $fixtures;
    if ( ! file_exists($path)) {
      throw new sfException('Invalid data fixtures file');
    }
    chdir(sfConfig::get('sf_root_dir'));
    $task = new sfDoctrineDataLoadTask($this->dispatcher, new sfFormatter());
    $task->setConfiguration($this);
    $task->run(array($path));
  }

  public function configureDoctrine(Doctrine_Manager $manager)
  {
    $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, true);

    $options = array('baseClassName' => 'myDoctrineRecord');
    sfConfig::set('doctrine_model_builder_options', $options);
  }

  public function configureDoctrineConnection(Doctrine_Connection $connection)
  {
  }

  public function configureDoctrineConnectionDoctrine2(Doctrine_Connection $connection)
  {
    $connection->setAttribute(Doctrine_Core::ATTR_VALIDATE, false);
  }
}<commit_msg>Fix doctrine test<commit_after><?php

require_once dirname(__FILE__).'/../../../../../../autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->enableAllPluginsExcept();

    $this->dispatcher->connect('doctrine.configure', array($this, 'configureDoctrineEvent'));
    $this->dispatcher->connect('doctrine.configure_connection', array($this, 'configureDoctrineConnectionEvent'));
  }

  public function initializeDoctrine()
  {
    chdir(sfConfig::get('sf_root_dir'));

    $task = new sfDoctrineBuildTask($this->dispatcher, new sfFormatter());
    $task->setConfiguration($this);
    $task->run(array(), array(
      'no-confirmation' => true,
      'db'              => true,
      'model'           => true,
      'forms'           => true,
      'filters'         => true,
    ));
  }

  public function loadFixtures($fixtures)
  {
    $path = sfConfig::get('sf_data_dir') . '/' . $fixtures;
    if ( ! file_exists($path)) {
      throw new sfException('Invalid data fixtures file');
    }
    chdir(sfConfig::get('sf_root_dir'));
    $task = new sfDoctrineDataLoadTask($this->dispatcher, new sfFormatter());
    $task->setConfiguration($this);
    $task->run(array($path));
  }

  public function configureDoctrineEvent(sfEvent $event)
  {
    $manager = $event->getSubject();
    $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, true);

    $options = array('baseClassName' => 'myDoctrineRecord');
    sfConfig::set('doctrine_model_builder_options', $options);
  }

  public function configureDoctrineConnectionEvent(sfEvent $event)
  {
    $parameters = $event->getParameters();

    if ('doctrine2' === $parameters['connection']->getName())
    {
      $parameters['connection']->setAttribute(Doctrine_Core::ATTR_VALIDATE, false);
    }
  }
}
{'fraction_non_alphanumeric': 0.15867052023121386, 'fraction_numerical': 0.0005780346820809249, 'mean_word_length': 3.8270571827057185, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '2658570', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1029, 'n_words': 165}