Development

/branches/1.2/lib/task/project/sfUpgradeTo12Task.class.php

You must first sign up to be able to contribute.

root/branches/1.2/lib/task/project/sfUpgradeTo12Task.class.php

Revision 10628, 1.7 kB (checked in by fabien, 6 years ago)

introduced send_http_header setting for the response + added an upgrade task

  • added a new send_http_header setting for sfWebResponse
  • added a project:upgrade1.2 task to upgrade a project from 1.1 to 1.2
  • added a UPDATE_TO_1_2 file to explain the main changes in symfony 1.2
  • 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) 2004-2006 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 a project to the 1.2 release (from 1.1).
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfUpgradeTo12Task extends sfBaseTask
20 {
21   /**
22    * @see sfTask
23    */
24   protected function configure()
25   {
26     $this->namespace = 'project';
27     $this->name = 'upgrade1.2';
28     $this->briefDescription = 'Upgrade a symfony project to the 1.2 symfony release (from 1.1)';
29
30     $this->detailedDescription = <<<EOF
31 The [project:upgrade1.2|INFO] task upgrades a symfony project
32 based on the 1.1 release to the 1.2 symfony release.
33
34   [./symfony project:upgrade1.2|INFO]
35
36 Please read the UPGRADE_TO_1_2 file to have information on what does this task.
37 EOF;
38   }
39
40   /**
41    * @see sfTask
42    */
43   protected function execute($arguments = array(), $options = array())
44   {
45     foreach ($this->getUpgradeClasses() as $class)
46     {
47       $upgrader = new $class($this->dispatcher, $this->formatter);
48       $upgrader->setCommandApplication($this->commandApplication);
49       $upgrader->upgrade();
50     }
51   }
52
53   protected function getUpgradeClasses()
54   {
55     $baseDir = dirname(__FILE__).'/upgrade1.2/';
56     $classes = array();
57
58     foreach (glob($baseDir.'*.class.php') as $file)
59     {
60       $class = str_replace(array($baseDir, '.class.php'), '', $file);
61
62       if ('sfUpgrade' != $class)
63       {
64         $classes[] = $class;
65
66         require_once $baseDir.$class.'.class.php';
67       }
68     }
69
70     return $classes;
71   }
72 }
73
Note: See TracBrowser for help on using the browser.