|
Revision 7655, 1.6 kB
(checked in by fabien, 5 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 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
require_once(dirname(__FILE__).'/sfPluginBaseTask.class.php'); |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 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 |
|
|---|