InitCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 2
c 4
b 1
f 0
lcom 0
cbo 2
dl 0
loc 19
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 8 1
1
<?php
2
3
namespace Ivan1986\SupervisorBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
class InitCommand extends ContainerAwareCommand
10
{
11
    protected function configure()
12
    {
13
        $this
14
            ->setName('supervisor:init')
15
            ->setDescription('Create base config files for run local supervisor')
16
        ;
17
    }
18
19
    protected function execute(InputInterface $input, OutputInterface $output)
20
    {
21
        $conf = $this->getContainer()->get('templating')->render('@Supervisor/supervisord.conf.twig', array(
22
23
        ));
24
        file_put_contents($this->getContainer()->getParameter('kernel.root_dir').'/supervisord.conf', $conf);
25
        mkdir($this->getContainer()->getParameter('kernel.root_dir').'/supervisor');
26
    }
27
}
28