<commit_before><?php

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

pake_desc('upgrade to a new symfony release');
pake_task('upgrade', 'project_exists');

pake_desc('downgrade to a previous symfony release');
pake_task('downgrade', 'project_exists');

function run_downgrade($task, $args)
{
  throw new Exception('I have no downgrade script for this release.');
}

function run_upgrade($task, $args)
{
  if (!isset($args[0]))
  {
    throw new Exception('You must provide the upgrade script to use (0.8 to upgrade to 0.8 for example).');
  }

  $version = $args[0];

   if ($version == '0.8')
   {
     run_upgrade_0_8($task, $args);
   }
   else
   {
     throw new Exception('I have no upgrade script for this release.');
   }
}

function run_upgrade_0_8($task, $args)
{
  // upgrade propel.ini
  _upgrade_0_8_propel_ini();

  // upgrade model classes
  _upgrade_0_8_propel_model();

  // find all applications for this project
  $apps = pakeFinder::type('directory')->name(sfConfig::get('sf_app_module_dir_name'))->mindepth(1)->maxdepth(1)->relative()->in(sfConfig::get('sf_apps_dir_name'));

  // install symfony CLI
  pake_remove(sfConfig::get('sf_root_dir').'/symfony', '');
  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/project/symfony', sfConfig::get('sf_root_dir').'/symfony');
  pake_chmod('symfony', sfConfig::get('sf_root_dir'), 0777);

  // update schemas
  _upgrade_0_8_schemas();

  // add bootstrap files for tests
  _add_0_8_test_bootstraps();

  // upgrade main config.php
  _upgrade_0_8_main_config_php();

  // upgrade all applications
  foreach ($apps as $app_module_dir)
  {
    $app = str_replace(DIRECTORY_SEPARATOR.sfConfig::get('sf_app_module_dir_name'), '', $app_module_dir);
    pake_echo_action('upgrade 0.8', sprintf('[upgrading application "%s"]', $app));

    $app_dir = sfConfig::get('sf_apps_dir_name').'/'.$app;
<commit_msg>fixed bug in upgrade script on case sensitive systems<commit_after><?php

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

pake_desc('upgrade to a new symfony release');
pake_task('upgrade');

pake_desc('downgrade to a previous symfony release');
pake_task('downgrade', 'project_exists');

function run_downgrade($task, $args)
{
  throw new Exception('I have no downgrade script for this release.');
}

function run_upgrade($task, $args)
{
  if (!isset($args[0]))
  {
    throw new Exception('You must provide the upgrade script to use (0.8 to upgrade to 0.8 for example).');
  }

  $version = $args[0];

   if ($version == '0.8')
   {
     run_upgrade_0_8($task, $args);
   }
   else
   {
     throw new Exception('I have no upgrade script for this release.');
   }
}

function run_upgrade_0_8($task, $args)
{
  // check we have a project
  if (!file_exists('symfony') && !file_exists('SYMFONY'))
  {
    throw new Exception('You must be in a symfony project directory');
  }

  // upgrade propel.ini
  _upgrade_0_8_propel_ini();

  // upgrade model classes
  _upgrade_0_8_propel_model();

  // find all applications for this project
  $apps = pakeFinder::type('directory')->name(sfConfig::get('sf_app_module_dir_name'))->mindepth(1)->maxdepth(1)->relative()->in(sfConfig::get('sf_apps_dir_name'));

  // install symfony CLI
  if (file_exists(sfConfig::get('sf_root_dir').'/SYMFONY'))
  {
    pake_remove(sfConfig::get('sf_root_dir').'/SYMFONY', '');
  }
  pake_copy(sfConfig::get('sf_symfony_data_dir').'/skeleton/project/symfony', sfConfig::get('sf_root_dir').'/symfony');
  pake_chmod('symfony', sfConfig::get('sf_root_dir'), 0777);

  // update schemas
  _upgrade_0_8_schemas();

  // add bootstrap files for tests
  _add_0_8_test_bootstraps();

  // upgrade main config.php
  _upgrade_0_8_main_config_php();

  // upgrade all applications
  foreach ($apps as $app_module_dir)
  {
    $app = str_replace(DIRECTORY_SEPARATOR.sfConfig::get('sf_app_module_dir_name'), '', $app_module_dir);
    pake_echo_action('upgrade 0.8', sprintf('[upgrading application "%s"]', $app));

    $app_dir = sfConfig::get('sf_apps_dir_name').'/'.$app;

{'fraction_non_alphanumeric': 0.1516892668352103, 'fraction_numerical': 0.017467248908296942, 'mean_word_length': 4.659297789336801, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '332601', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1482, 'n_words': 345}