1. sfPluginListTask.class.php
  2. /** * Lists installed plugins. * * @package symfony * @subpackage task * @author Fabien Potencier * @version SVN: $Id: sfPluginListTask.class.php 23922 2009-11-14 14:58:38Z fabien $ */
  3. class sfPluginListTask extends sfPluginBaseTask
  4. {
  5. /**
  6. * @see sfTask
  7. */
  8. protected function configure()
  9. {
  10. $this->namespace = 'plugin';
  11. $this->name = 'list';
  12. $this->briefDescription = 'Lists installed plugins';
  13. $this->detailedDescription = <<<EOF
  14. The [plugin:list|INFO] task lists all installed plugins:
  15. [./symfony plugin:list|INFO]
  16. It also gives the channel and version for each plugin.
  17. EOF;
  18. }
  19. /**
  20. * @see sfTask
  21. */
  22. protected function execute($arguments = array(), $options = array())
  23. {
  24. $this->log($this->formatter->format('Installed plugins:', 'COMMENT'));
  25. foreach ($this->getPluginManager()->getInstalledPlugins() as $package)
  26. {
  27. $alias = $this->getPluginManager()->getEnvironment()->getRegistry()->getChannel($package->getChannel())->getAlias();
  28. $this->log(sprintf(' %-40s %10s-%-6s %s', $this->formatter->format($package->getPackage(), 'INFO'), $package->getVersion(), $package->getState() ? $package->getState() : null, $this->formatter->format(sprintf('# %s (%s)', $package->getChannel(), $alias), 'COMMENT')));
  29. }
  30. }
  31. }

Debug toolbar