Development

/branches/1.3/lib/task/project/sfUpgradeTo13Task.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/task/project/sfUpgradeTo13Task.class.php

Revision 23810, 1.9 kB (checked in by Kris.Wallsmith, 5 years ago)

[1.3] set svn:eol-style property to native and svn:keywords property to Id on all .php files

  • 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.3 release (from 1.2).
13  *
14  * @package    symfony
15  * @subpackage task
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfUpgradeTo13Task extends sfBaseTask
20 {
21   /**
22    * @see sfTask
23    */
24   protected function configure()
25   {
26     $this->namespace = 'project';
27     $this->name = 'upgrade1.3';
28     $this->briefDescription = 'Upgrade a symfony project to the 1.3 symfony release (from 1.2)';
29
30     $this->detailedDescription = <<<EOF
31 The [project:upgrade1.3|INFO] task upgrades a symfony project based on the 1.2
32 release to the 1.3 symfony release.
33
34   [./symfony project:upgrade1.3|INFO]
35
36 Please read the UPGRADE_TO_1_3 file to have information on what this task does.
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       $this->logSection('upgrade', strtolower(str_replace(array('sf', 'Upgrade'), '', $class)));
48
49       $upgrader = new $class($this->dispatcher, $this->formatter);
50       $upgrader->setCommandApplication($this->commandApplication);
51       $upgrader->setConfiguration($this->configuration);
52       $upgrader->upgrade();
53     }
54
55     $this->logSection('upgrade', 'complete!');
56   }
57
58   protected function getUpgradeClasses()
59   {
60     $baseDir = dirname(__FILE__).'/upgrade1.3/';
61     $classes = array();
62
63     foreach (glob($baseDir.'*.class.php') as $file)
64     {
65       $class = str_replace(array($baseDir, '.class.php'), '', $file);
66
67       if ('sfUpgrade' != $class)
68       {
69         $classes[] = $class;
70
71         require_once $baseDir.$class.'.class.php';
72       }
73     }
74
75     return $classes;
76   }
77 }
78
Note: See TracBrowser for help on using the browser.