12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- class sfUpgradeTo12Task extends sfBaseTask
- {
-
- protected function configure()
- {
- $this->namespace = 'project';
- $this->name = 'upgrade1.2';
- $this->briefDescription = 'Upgrade a symfony project to the 1.2 symfony release (from 1.1)';
- $this->detailedDescription = <<<EOF
- The [project:upgrade1.2|INFO] task upgrades a symfony project
- based on the 1.1 release to the 1.2 symfony release.
- [./symfony project:upgrade1.2|INFO]
- Please read the UPGRADE_TO_1_2 file to have information on what does this task.
- EOF;
- }
-
- protected function execute($arguments = array(), $options = array())
- {
- foreach ($this->getUpgradeClasses() as $class)
- {
- $upgrader = new $class($this->dispatcher, $this->formatter);
- $upgrader->setCommandApplication($this->commandApplication);
- $upgrader->upgrade();
- }
- }
- protected function getUpgradeClasses()
- {
- $baseDir = dirname(__FILE__).'/upgrade1.2/';
- $classes = array();
- foreach (glob($baseDir.'*.class.php') as $file)
- {
- $class = str_replace(array($baseDir, '.class.php'), '', $file);
- if ('sfUpgrade' != $class)
- {
- $classes[] = $class;
- require_once $baseDir.$class.'.class.php';
- }
- }
- return $classes;
- }
- }
|