Development

/branches/1.2/lib/task/plugin/sfPluginListTask.class.php

You must first sign up to be able to contribute.

root/branches/1.2/lib/task/plugin/sfPluginListTask.class.php

Revision 7655, 1.6 kB (checked in by fabien, 6 years ago)

fixed typo in plugin:list task

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 require_once(dirname(__FILE__).'/sfPluginBaseTask.class.php');
12
13 /**
14  * Lists installed plugins.
15  *
16  * @package    symfony
17  * @subpackage task
18  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
19  * @version    SVN: $Id$
20  */
21 class sfPluginListTask extends sfPluginBaseTask
22 {
23   /**
24    * @see sfTask
25    */
26   protected function configure()
27   {
28     $this->aliases = array('plugin-list');
29     $this->namespace = 'plugin';
30     $this->name = 'list';
31
32     $this->briefDescription = 'Lists installed plugins';
33
34     $this->detailedDescription = <<<EOF
35 The [plugin:list|INFO] task lists all installed plugins:
36
37   [./symfony plugin:list|INFO]
38
39 It also gives the channel and version for each plugin.
40 EOF;
41   }
42
43   /**
44    * @see sfTask
45    */
46   protected function execute($arguments = array(), $options = array())
47   {
48     $this->log($this->formatter->format('Installed plugins:', 'COMMENT'));
49
50     foreach ($this->getPluginManager()->getInstalledPlugins() as $package)
51     {
52       $alias = $this->getPluginManager()->getEnvironment()->getRegistry()->getChannel($package->getChannel())->getAlias();
53       $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')));
54     }
55   }
56 }
57
Note: See TracBrowser for help on using the browser.