Development

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

You must first sign up to be able to contribute.

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

Revision 8474, 2.2 kB (checked in by fabien, 6 years ago)

fixed typo (closes #3342)

  • 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  * Uninstall a plugin.
15  *
16  * @package    symfony
17  * @subpackage task
18  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
19  * @version    SVN: $Id$
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
Note: See TracBrowser for help on using the browser.