Development

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

You must first sign up to be able to contribute.

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

Revision 23922, 2.2 kB (checked in by fabien, 4 years ago)

[1.4] removed deprecated stuff

  • 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->namespace = 'plugin';
38     $this->name = 'uninstall';
39
40     $this->briefDescription = 'Uninstalls a plugin';
41
42     $this->detailedDescription = <<<EOF
43 The [plugin:uninstall|INFO] task uninstalls a plugin:
44
45   [./symfony plugin:uninstall sfGuardPlugin|INFO]
46
47 The default channel is [symfony|INFO].
48
49 You can also uninstall a plugin which has a different channel:
50
51   [./symfony plugin:uninstall --channel=mypearchannel sfGuardPlugin|INFO]
52
53   [./symfony plugin:uninstall -c mypearchannel sfGuardPlugin|INFO]
54
55 Or you can use the [channel/package|INFO] notation:
56
57   [./symfony plugin:uninstall mypearchannel/sfGuardPlugin|INFO]
58
59 You can get the PEAR channel name of a plugin by launching the
60 [plugin:list] task.
61
62 If the plugin contains some web content (images, stylesheets or javascripts),
63 the task also removes the [web/%name%|COMMENT] symbolic link (on *nix)
64 or directory (on Windows).
65 EOF;
66   }
67
68   /**
69    * @see sfTask
70    */
71   protected function execute($arguments = array(), $options = array())
72   {
73     $this->logSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name']));
74
75     $this->getPluginManager()->uninstallPlugin($arguments['name'], $options['channel']);
76   }
77 }
78
Note: See TracBrowser for help on using the browser.