1. sfPluginUpgradeTask.class.php
  2. /** * Upgrades a plugin. * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfPluginUpgradeTask.class.php 23922 2009-11-14 14:58:38Z fabien $ */
  3. class sfPluginUpgradeTask extends sfPluginBaseTask
  4. {
  5. /**
  6. * @see sfTask
  7. */
  8. protected function configure()
  9. {
  10. $this->addArguments(array(
  11. new sfCommandArgument('name', sfCommandArgument::REQUIRED, 'The plugin name'),
  12. ));
  13. $this->addOptions(array(
  14. new sfCommandOption('stability', 's', sfCommandOption::PARAMETER_REQUIRED, 'The preferred stability (stable, beta, alpha)', null),
  15. new sfCommandOption('release', 'r', sfCommandOption::PARAMETER_REQUIRED, 'The preferred version', null),
  16. new sfCommandOption('channel', 'c', sfCommandOption::PARAMETER_REQUIRED, 'The PEAR channel name', null),
  17. ));
  18. $this->namespace = 'plugin';
  19. $this->name = 'upgrade';
  20. $this->briefDescription = 'Upgrades a plugin';
  21. $this->detailedDescription = <<<EOF
  22. The [plugin:upgrade|INFO] task tries to upgrade a plugin:
  23. [./symfony plugin:upgrade sfGuardPlugin|INFO]
  24. The default channel is [symfony|INFO].
  25. If the plugin contains some web content (images, stylesheets or javascripts),
  26. the task also updates the [web/%name%|COMMENT] directory content on Windows.
  27. See [plugin:install|INFO] for more information about the format of the plugin name and options.
  28. EOF;
  29. }
  30. /**
  31. * @see sfTask
  32. */
  33. protected function execute($arguments = array(), $options = array())
  34. {
  35. $this->logSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name']));
  36. $this->getPluginManager()->installPlugin($arguments['name'], $options);
  37. }
  38. }

Debug toolbar