| 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 sfPluginUninstallTask extends sfPluginBaseTask |
|---|
| 22 |
{ |
|---|
| 23 |
|
|---|
| 24 |
* @see sfTask |
|---|
| 25 |
*/ |
|---|
| 26 |
protected function configure() |
|---|
| 27 |
{ |
|---|
| 28 |
$this->addArguments(array( |
|---|
| 29 |
new sfCommandArgument('name', sfCommandArgument::REQUIRED, 'The plugin name'), |
|---|
| 30 |
)); |
|---|
| 31 |
|
|---|
| 32 |
$this->addOptions(array( |
|---|
| 33 |
new sfCommandOption('channel', 'c', sfCommandOption::PARAMETER_REQUIRED, 'The PEAR channel name', null), |
|---|
| 34 |
new sfCommandOption('install_deps', 'd', sfCommandOption::PARAMETER_NONE, 'Whether to force installation of dependencies', null), |
|---|
| 35 |
)); |
|---|
| 36 |
|
|---|
| 37 |
$this->aliases = array('plugin-uninstall'); |
|---|
| 38 |
$this->namespace = 'plugin'; |
|---|
| 39 |
$this->name = 'uninstall'; |
|---|
| 40 |
|
|---|
| 41 |
$this->briefDescription = 'Uninstalls a plugin'; |
|---|
| 42 |
|
|---|
| 43 |
$this->detailedDescription = <<<EOF |
|---|
| 44 |
The [plugin:uninstall|INFO] task uninstalls a plugin: |
|---|
| 45 |
|
|---|
| 46 |
[./symfony plugin:uninstall sfGuardPlugin|INFO] |
|---|
| 47 |
|
|---|
| 48 |
The default channel is [symfony|INFO]. |
|---|
| 49 |
|
|---|
| 50 |
You can also uninstall a plugin which has a different channel: |
|---|
| 51 |
|
|---|
| 52 |
[./symfony plugin:uninstall --channel=mypearchannel sfGuardPlugin|INFO] |
|---|
| 53 |
|
|---|
| 54 |
[./symfony plugin:uninstall -c mypearchannel sfGuardPlugin|INFO] |
|---|
| 55 |
|
|---|
| 56 |
Or you can use the [channel/package|INFO] notation: |
|---|
| 57 |
|
|---|
| 58 |
[./symfony plugin:uninstall mypearchannel/sfGuardPlugin|INFO] |
|---|
| 59 |
|
|---|
| 60 |
You can get the PEAR channel name of a plugin by launching the |
|---|
| 61 |
[plugin:list] task. |
|---|
| 62 |
|
|---|
| 63 |
If the plugin contains some web content (images, stylesheets or javascripts), |
|---|
| 64 |
the task also removes the [web/%name%|COMMENT] symbolic link (on *nix) |
|---|
| 65 |
or directory (on Windows). |
|---|
| 66 |
EOF; |
|---|
| 67 |
} |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
* @see sfTask |
|---|
| 71 |
*/ |
|---|
| 72 |
protected function execute($arguments = array(), $options = array()) |
|---|
| 73 |
{ |
|---|
| 74 |
$this->logSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name'])); |
|---|
| 75 |
|
|---|
| 76 |
$this->getPluginManager()->uninstallPlugin($arguments['name'], $options['channel']); |
|---|
| 77 |
} |
|---|
| 78 |
} |
|---|
| 79 |
|
|---|