1. sfPluginUninstallTask.class.php
  2. /** * Uninstall a plugin. * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfPluginUninstallTask.class.php 23922 2009-11-14 14:58:38Z fabien $ */
  3. class sfPluginUninstallTask 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('channel', 'c', sfCommandOption::PARAMETER_REQUIRED, 'The PEAR channel name', null),
  15. new sfCommandOption('install_deps', 'd', sfCommandOption::PARAMETER_NONE, 'Whether to force installation of dependencies', null),
  16. ));
  17. $this->namespace = 'plugin';
  18. $this->name = 'uninstall';
  19. $this->briefDescription = 'Uninstalls a plugin';
  20. $this->detailedDescription = <<<EOF
  21. The [plugin:uninstall|INFO] task uninstalls a plugin:
  22. [./symfony plugin:uninstall sfGuardPlugin|INFO]
  23. The default channel is [symfony|INFO].
  24. You can also uninstall a plugin which has a different channel:
  25. [./symfony plugin:uninstall --channel=mypearchannel sfGuardPlugin|INFO]
  26. [./symfony plugin:uninstall -c mypearchannel sfGuardPlugin|INFO]
  27. Or you can use the [channel/package|INFO] notation:
  28. [./symfony plugin:uninstall mypearchannel/sfGuardPlugin|INFO]
  29. You can get the PEAR channel name of a plugin by launching the
  30. [plugin:list] task.
  31. If the plugin contains some web content (images, stylesheets or javascripts),
  32. the task also removes the [web/%name%|COMMENT] symbolic link (on *nix)
  33. or directory (on Windows).
  34. EOF;
  35. }
  36. /**
  37. * @see sfTask
  38. */
  39. protected function execute($arguments = array(), $options = array())
  40. {
  41. $this->logSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name']));
  42. $this->getPluginManager()->uninstallPlugin($arguments['name'], $options['channel']);
  43. }
  44. }

Debug toolbar