-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathExampleStopCommand.php
More file actions
32 lines (25 loc) · 945 Bytes
/
ExampleStopCommand.php
File metadata and controls
32 lines (25 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace CodeMeme\Bundle\CodeMemeDaemonBundle\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use CodeMeme\Bundle\CodeMemeDaemonBundle\Daemon;
class ExampleStopCommand extends ContainerAwareCommand
{
protected function configure()
{
$this->setName('example:stop')
->setDescription('Stops the example daemon')
->setHelp(<<<EOT
The <info>{$this->getName()}</info> Stop the Example daemon from running in the background.
EOT
);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$daemon = new Daemon($this->getContainer()->getParameter('example.daemon.options'));
$daemon->stop();
}
}