mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-05 18:41:02 +00:00
symfony is there
This commit is contained in:
parent
0440249631
commit
93fd4692f6
291 changed files with 11356 additions and 1696 deletions
48
src/Acme/DemoBundle/Command/HelloWorldCommand.php
Normal file
48
src/Acme/DemoBundle/Command/HelloWorldCommand.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace Acme\DemoBundle\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* Hello World command for demo purposes.
|
||||
*
|
||||
* You could also extend from Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
|
||||
* to get access to the container via $this->getContainer().
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
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(<<<EOF
|
||||
The <info>%command.name%</info> command greets somebody or everybody:
|
||||
|
||||
<info>php %command.full_name%</info>
|
||||
|
||||
The optional argument specifies who to greet:
|
||||
|
||||
<info>php %command.full_name%</info> Fabien
|
||||
EOF
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$output->writeln(sprintf('Hello <comment>%s</comment>!', $input->getArgument('who')));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue