sfPluginAddChannelTask.class.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. require_once(dirname(__FILE__).'/sfPluginBaseTask.class.php');
  10. /**
  11. * Installs a plugin.
  12. *
  13. * @package symfony
  14. * @subpackage task
  15. * @author Fabien Potencier <fabien.potencier@symfony-project.com>
  16. * @version SVN: $Id: sfPluginAddChannelTask.class.php 11750 2008-09-23 18:33:28Z Carl.Vondrick $
  17. */
  18. class sfPluginAddChannelTask extends sfPluginBaseTask
  19. {
  20. /**
  21. * @see sfTask
  22. */
  23. protected function configure()
  24. {
  25. $this->addArguments(array(
  26. new sfCommandArgument('name', sfCommandArgument::REQUIRED, 'The channel name'),
  27. ));
  28. $this->namespace = 'plugin';
  29. $this->name = 'add-channel';
  30. $this->briefDescription = 'Add a new PEAR channel';
  31. $this->detailedDescription = <<<EOF
  32. The [plugin:add-channel|INFO] task adds a new PEAR channel:
  33. [./symfony plugin:add-channel symfony.plugins.pear.example.com|INFO]
  34. EOF;
  35. }
  36. /**
  37. * @see sfTask
  38. */
  39. protected function execute($arguments = array(), $options = array())
  40. {
  41. $this->logSection('plugin', sprintf('add channel "%s"', $arguments['name']));
  42. $this->getPluginManager()->getEnvironment()->registerChannel($arguments['name']);
  43. }
  44. }