| 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 |
* Upgrades a plugin.
|
|
|
15 |
*
|
|
|
16 |
* @package symfony
|
|
|
17 |
* @subpackage task
|
|
|
18 |
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
19 |
* @version SVN: $Id: sfPluginUpgradeTask.class.php 23922 2009-11-14 14:58:38Z fabien $
|
|
|
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->namespace = 'plugin';
|
|
|
39 |
$this->name = 'upgrade';
|
|
|
40 |
|
|
|
41 |
$this->briefDescription = 'Upgrades a plugin';
|
|
|
42 |
|
|
|
43 |
$this->detailedDescription = <<<EOF
|
|
|
44 |
The [plugin:upgrade|INFO] task tries to upgrade a plugin:
|
|
|
45 |
|
|
|
46 |
[./symfony plugin:upgrade sfGuardPlugin|INFO]
|
|
|
47 |
|
|
|
48 |
The default channel is [symfony|INFO].
|
|
|
49 |
|
|
|
50 |
If the plugin contains some web content (images, stylesheets or javascripts),
|
|
|
51 |
the task also updates the [web/%name%|COMMENT] directory content on Windows.
|
|
|
52 |
|
|
|
53 |
See [plugin:install|INFO] for more information about the format of the plugin name and options.
|
|
|
54 |
EOF;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
* @see sfTask
|
|
|
59 |
*/
|
|
|
60 |
protected function execute($arguments = array(), $options = array())
|
|
|
61 |
{
|
|
|
62 |
$this->logSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name']));
|
|
|
63 |
|
|
|
64 |
$this->getPluginManager()->installPlugin($arguments['name'], $options);
|
|
|
65 |
}
|
|
|
66 |
}
|