<commit_before><?php

/*
 * This file is part of the symfony package.
 * (c) <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Upgrades config.php.
 *
 * @package    symfony
 * @subpackage command
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id$
 */
class sfAutoloadingUpgrade extends sfUpgrade
{
  public function upgrade()
  {
    $phpFinder = $this->getFinder('file')->name('config.php');
    foreach ($phpFinder->in(glob(sfConfig::get('sf_root_dir').'/apps/*/config')) as $file)
    {
      $content = file_get_contents($file);
      if (false !== strpos($content, 'spl_autoload_register'))
      {
        if (false !== strpos($content, "'sfAutoload'"))
        {
          $content = str_replace("'sfAutoload'", 'sfAutoload::getInstance()', $content);

          $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file)))));
          file_put_contents($file, $content);
        }

        continue;
      }
      $content .= <<<EOF

// insert your own autoloading callables here

if (sfConfig::get('sf_debug'))
{
  spl_autoload_register(array('sfAutoload::getInstance()', 'autoloadAgain'));
}
EOF;

      $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file)))));
      file_put_contents($file, $content);
    }
  }
}<commit_msg>fixed typo in autoloading upgrade<commit_after><?php

/*
 * This file is part of the symfony package.
 * (c) <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Upgrades config.php.
 *
 * @package    symfony
 * @subpackage command
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id$
 */
class sfAutoloadingUpgrade extends sfUpgrade
{
  public function upgrade()
  {
    $phpFinder = $this->getFinder('file')->name('config.php');
    foreach ($phpFinder->in(glob(sfConfig::get('sf_root_dir').'/apps/*/config')) as $file)
    {
      $content = file_get_contents($file);
      if (false !== strpos($content, 'spl_autoload_register'))
      {
        if (false !== strpos($content, "'sfAutoload'"))
        {
          $content = str_replace("'sfAutoload'", 'sfAutoload::getInstance()', $content);

          $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file)))));
          file_put_contents($file, $content);
        }

        continue;
      }
      $content .= <<<EOF

// insert your own autoloading callables here

if (sfConfig::get('sf_debug'))
{
  spl_autoload_register(array(sfAutoload::getInstance(), 'autoloadAgain'));
}
EOF;

      $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file)))));
      file_put_contents($file, $content);
    }
  }
}
{'fraction_non_alphanumeric': 0.17425227568270482, 'fraction_numerical': 0.0, 'mean_word_length': 3.697709923664122, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 37, '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': '2139917', 'n_tokens_mistral': 988, 'n_tokens_neox': 984, 'n_words': 208}