Development

/branches/1.2/lib/task/project/upgrade1.1/sfTestUpgrade.class.php

You must first sign up to be able to contribute.

root/branches/1.2/lib/task/project/upgrade1.1/sfTestUpgrade.class.php

Revision 7962, 1.5 kB (checked in by fabien, 7 years ago)

moved *Configuration classes in "better" places

  • moved ProjectConfiguration? from lib/ to config/
  • moved $APP_NAME$Configuration to apps/$APP_NAME$/config/
  • added a ProjectConfiguration::getApplicationConfiguration() to retrieve an application configuration
  • removed sfApplicationConfiguration::getForApplication() method (please use ProjectConfiguration::getApplicationConfiguration)
  • updated the UPGRADE file for early adopters (how to upgrade projects that live on the 1.1 branch)
  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * Upgrade tests.
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfTestUpgrade extends sfUpgrade
20 {
21   public function upgrade()
22   {
23     // upgrade test bootstrap files
24     $unit = sfConfig::get('sf_test_dir').'/bootstrap/unit.php';
25     if (file_exists($unit))
26     {
27       $content = file_get_contents($unit);
28       if (false !== strpos($content, 'SF_ROOT_DIR') || false !== strpos($content, 'lib/ProjectConfiguration'))
29       {
30         $this->logSection('test', sprintf('Migrating %s', $unit));
31         file_put_contents($unit, file_get_contents(dirname(__FILE__).'/../../generator/skeleton/project/test/bootstrap/unit.php'));
32       }
33     }
34
35     $functional = sfConfig::get('sf_test_dir').'/bootstrap/functional.php';
36     if (file_exists($functional))
37     {
38       $content = file_get_contents($functional);
39       if (false !== strpos($content, 'SF_ROOT_DIR') || false !== strpos($content, 'new $class'))
40       {
41         $this->logSection('test', sprintf('Migrating %s', $functional));
42         file_put_contents($functional, file_get_contents(dirname(__FILE__).'/../../generator/skeleton/project/test/bootstrap/functional.php'));
43       }
44     }
45   }
46 }
47
Note: See TracBrowser for help on using the browser.