| 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 |
* Installs a plugin.
|
|
|
15 |
*
|
|
|
16 |
* @package symfony
|
|
|
17 |
* @subpackage task
|
|
|
18 |
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
19 |
* @version SVN: $Id: sfPluginAddChannelTask.class.php 11750 2008-09-23 18:33:28Z Carl.Vondrick $
|
|
|
20 |
*/
|
|
|
21 |
class sfPluginAddChannelTask extends sfPluginBaseTask
|
|
|
22 |
{
|
|
|
23 |
/**
|
|
|
24 |
* @see sfTask
|
|
|
25 |
*/
|
|
|
26 |
protected function configure()
|
|
|
27 |
{
|
|
|
28 |
$this->addArguments(array(
|
|
|
29 |
new sfCommandArgument('name', sfCommandArgument::REQUIRED, 'The channel name'),
|
|
|
30 |
));
|
|
|
31 |
|
|
|
32 |
$this->namespace = 'plugin';
|
|
|
33 |
$this->name = 'add-channel';
|
|
|
34 |
|
|
|
35 |
$this->briefDescription = 'Add a new PEAR channel';
|
|
|
36 |
|
|
|
37 |
$this->detailedDescription = <<<EOF
|
|
|
38 |
The [plugin:add-channel|INFO] task adds a new PEAR channel:
|
|
|
39 |
|
|
|
40 |
[./symfony plugin:add-channel symfony.plugins.pear.example.com|INFO]
|
|
|
41 |
EOF;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
/**
|
|
|
45 |
* @see sfTask
|
|
|
46 |
*/
|
|
|
47 |
protected function execute($arguments = array(), $options = array())
|
|
|
48 |
{
|
|
|
49 |
$this->logSection('plugin', sprintf('add channel "%s"', $arguments['name']));
|
|
|
50 |
|
|
|
51 |
$this->getPluginManager()->getEnvironment()->registerChannel($arguments['name']);
|
|
|
52 |
}
|
|
|
53 |
}
|