* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Upgrade a project to the 1.2 release (from 1.1). * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfUpgradeTo12Task.class.php 10628 2008-08-03 15:03:08Z fabien $ */ class sfUpgradeTo12Task extends sfBaseTask { /** * @see sfTask */ 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 = <<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; } }