Development

/branches/1.1/lib/task/project/sfUpgradeTo11Task.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/task/project/sfUpgradeTo11Task.class.php

Revision 7400, 1.6 kB (checked in by fabien, 6 years ago)

fixed CLI verbose switch

  • 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.1 release.
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfUpgradeTo11Task extends sfBaseTask
20 {
21   /**
22    * @see sfTask
23    */
24   protected function configure()
25   {
26     $this->namespace = 'project';
27     $this->name = 'upgrade1.1';
28     $this->briefDescription = 'Upgrade a symfony project to the 1.1 symfony release';
29
30     $this->detailedDescription = <<<EOF
31 The [project:upgrade1.1|INFO] task upgrades a symfony project
32 based the 1.0 release to the 1.1 symfony release.
33
34   [./symfony project:upgrade1.1|INFO]
35
36 Please read the UPGRADE 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.1/';
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     }
67
68     return $classes;
69   }
70 }
71
Note: See TracBrowser for help on using the browser.