From 93fd4692f6eb753cae16358131c8049d84cfbb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 22 Jan 2015 08:30:07 +0100 Subject: symfony is there --- src/Acme/DemoBundle/Command/HelloWorldCommand.php | 48 +++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/Acme/DemoBundle/Command/HelloWorldCommand.php (limited to 'src/Acme/DemoBundle/Command/HelloWorldCommand.php') diff --git a/src/Acme/DemoBundle/Command/HelloWorldCommand.php b/src/Acme/DemoBundle/Command/HelloWorldCommand.php new file mode 100644 index 00000000..998cbcdf --- /dev/null +++ b/src/Acme/DemoBundle/Command/HelloWorldCommand.php @@ -0,0 +1,48 @@ +getContainer(). + * + * @author Tobias Schultze + */ +class HelloWorldCommand extends Command +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this + ->setName('acme:hello') + ->setDescription('Hello World example command') + ->addArgument('who', InputArgument::OPTIONAL, 'Who to greet.', 'World') + ->setHelp(<<%command.name% command greets somebody or everybody: + +php %command.full_name% + +The optional argument specifies who to greet: + +php %command.full_name% Fabien +EOF + ); + } + + /** + * {@inheritdoc} + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $output->writeln(sprintf('Hello %s!', $input->getArgument('who'))); + } +} -- cgit v1.2.3