Development

/branches/1.3/lib/task/plugin/sfPluginUpgradeTask.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/task/plugin/sfPluginUpgradeTask.class.php

Revision 8474, 2.0 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  * Upgrades 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 sfPluginUpgradeTask 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('stability', 's', sfCommandOption::PARAMETER_REQUIRED, 'The preferred stability (stable, beta, alpha)', null),
34       new sfCommandOption('release', 'r', sfCommandOption::PARAMETER_REQUIRED, 'The preferred version', null),
35       new sfCommandOption('channel', 'c', sfCommandOption::PARAMETER_REQUIRED, 'The PEAR channel name', null),
36     ));
37
38     $this->aliases = array('plugin-upgrade');
39     $this->namespace = 'plugin';
40     $this->name = 'upgrade';
41
42     $this->briefDescription = 'Upgrades a plugin';
43
44     $this->detailedDescription = <<<EOF
45 The [plugin:upgrade|INFO] task tries to upgrade a plugin:
46
47   [./symfony plugin:upgrade sfGuardPlugin|INFO]
48
49 The default channel is [symfony|INFO].
50
51 If the plugin contains some web content (images, stylesheets or javascripts),
52 the task also updates the [web/%name%|COMMENT] directory content on Windows.
53
54 See [plugin:install|INFO] for more information about the format of the plugin name and options.
55 EOF;
56   }
57
58   /**
59    * @see sfTask
60    */
61   protected function execute($arguments = array(), $options = array())
62   {
63     $this->logSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name']));
64
65     $this->getPluginManager()->installPlugin($arguments['name'], $options);
66   }
67 }
68
Note: See TracBrowser for help on using the browser.