MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
ListCommand.php
Ir para a documentação deste ficheiro.
1<?php
2
4
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
26class 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
41The <info>list</info> command lists all commands:
42
43 <info>./symfony list</info>
44
45You can also display the commands for a specific namespace:
46
47 <info>./symfony list test</info>
48
49You can also output the information as XML by using the <comment>--xml</comment> option:
50
51 <info>./symfony list --xml</info>
52EOF
53 );
54 }
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 }
67}
execute(InputInterface $input, OutputInterface $output)
Definição ListCommand.php:59