Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 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: sfPluginUninstallTask.class.php 23922 2009-11-14 14:58:38Z fabien $
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
}