MIOLO20
Toggle main menu visibility
Página principal
Estruturas de dados
Estruturas de dados
Hierarquia de classes
Campos de dados
Tudo
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Funções
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variáveis
$
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Ficheiros
Lista de ficheiros
Globais
Tudo
$
_
a
c
d
e
f
g
i
l
m
o
p
r
s
u
Funções
Variáveis
$
_
c
e
f
l
m
o
p
s
Exemplos
•
Tudo
Estruturas de dados
Namespaces
Ficheiros
Funções
Variáveis
Carregando...
Procurando...
Nenhuma entrada encontrada
ListCommand.php
Ir para a documentação deste ficheiro.
1
<?php
2
3
namespace
Symfony\Component\Console\Command
;
4
5
use
Symfony\Component\Console\Input\InputArgument
;
6
use
Symfony\Component\Console\Input\InputOption
;
7
use
Symfony\Component\Console\Input\InputInterface
;
8
use
Symfony\Component\Console\Output\OutputInterface
;
9
use
Symfony\Component\Console\Output\Output
;
10
use
Symfony\Component\Console\Command\Command
;
11
12
/*
13
* This file is part of the Symfony framework.
14
*
15
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
16
*
17
* This source file is subject to the MIT license that is bundled
18
* with this source code in the file LICENSE.
19
*/
20
26
class
ListCommand
extends
Command
27
{
31
protected
function
configure
()
32
{
33
$this
34
->setDefinition(array(
35
new
InputArgument
(
'namespace'
, InputArgument::OPTIONAL,
'The namespace name'
),
36
new
InputOption
(
'xml'
,
null
, InputOption::VALUE_NONE,
'To output help as XML'
),
37
))
38
->setName(
'list'
)
39
->setDescription(
'Lists commands'
)
40
->setHelp(<<<EOF
41
The <info>list</info> command lists all commands:
42
43
<info>./
symfony
list</info>
44
45
You can also display the commands
for
a specific
namespace
:
46
47
<info>./
symfony
list test</info>
48
49
You can also output the information as XML by
using
the <comment>--xml</comment> option:
50
51
<info>./
symfony
list --xml</info>
52
EOF
53
);
54
}
31
protected
function
configure
() {
…
}
55
59
protected
function
execute
(
InputInterface
$input,
OutputInterface
$output)
60
{
61
if
($input->
getOption
(
'xml'
)) {
62
$output->writeln($this->application->asXml($input->
getArgument
(
'namespace'
)), Output::OUTPUT_RAW);
63
}
else
{
64
$output->writeln($this->application->asText($input->
getArgument
(
'namespace'
)));
65
}
66
}
59
protected
function
execute
(
InputInterface
$input,
OutputInterface
$output) {
…
}
67
}
26
class
ListCommand
extends
Command
{
…
};
Symfony\Component\Console\Command\Command
Definição
Command.php:27
Symfony\Component\Console\Command\ListCommand
Definição
ListCommand.php:27
Symfony\Component\Console\Command\ListCommand\configure
configure()
Definição
ListCommand.php:31
Symfony\Component\Console\Command\ListCommand\execute
execute(InputInterface $input, OutputInterface $output)
Definição
ListCommand.php:59
Symfony\Component\Console\Input\InputArgument
Definição
InputArgument.php:20
Symfony\Component\Console\Input\InputOption
Definição
InputOption.php:20
Symfony\Component\Console\Output\Output
Definição
Output.php:26
Symfony\Component\Console\Input\InputInterface
Definição
InputInterface.php:20
Symfony\Component\Console\Input\InputInterface\getOption
getOption($name)
Symfony\Component\Console\Input\InputInterface\getArgument
getArgument($name)
Symfony\Component\Console\Output\OutputInterface
Definição
OutputInterface.php:20
Symfony\Component\Console\Command
Definição
Command.php:3
symfony
classes
extensions
doctrine-dbal
Doctrine
Symfony
Component
Console
Command
ListCommand.php
Gerado por
1.10.0