123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- require_once(dirname(__FILE__).'/sfPluginBaseTask.class.php');
- class sfPluginListTask extends sfPluginBaseTask
- {
-
- protected function configure()
- {
- $this->aliases = array('plugin-list');
- $this->namespace = 'plugin';
- $this->name = 'list';
- $this->briefDescription = 'Lists installed plugins';
- $this->detailedDescription = <<<EOF
- The [plugin:list|INFO] task lists all installed plugins:
- [./symfony plugin:list|INFO]
- It also gives the channel and version for each plugin.
- EOF;
- }
-
- protected function execute($arguments = array(), $options = array())
- {
- $this->log($this->formatter->format('Installed plugins:', 'COMMENT'));
- foreach ($this->getPluginManager()->getInstalledPlugins() as $package)
- {
- $alias = $this->getPluginManager()->getEnvironment()->getRegistry()->getChannel($package->getChannel())->getAlias();
- $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')));
- }
- }
- }
|