Completed
Push — master ( 78d52b...0b84d9 )
by Benjamin
02:36
created

SitemapCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
4
namespace Alpixel\Bundle\CMSBundle\Command;
5
6
use Presta\SitemapBundle\Command\DumpSitemapsCommand;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
use Alpixel\Bundle\CronBundle\Annotation\CronJob;
10
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
11
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
12
13
14
/**
15
 * @author Benjamin HUBERT <[email protected]>
16
 * @CronJob("P1D", startTime="today 1:00")
17
 */
18
class SitemapCommand extends DumpSitemapsCommand implements ContainerAwareInterface
19
{
20
    use ContainerAwareTrait;
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function configure()
26
    {
27
        parent::configure();
28
        $this->setName('alpixel:cms:sitemap');
29
        $this->setDescription('Alias of the presta:sitemaps:dump used for cronjobs');
30
    }
31
32
    public function execute(InputInterface $input, OutputInterface $output)
33
    {
34
        $target = $this->container->getParameter('kernel.root_dir') . '/../web/';
35
        $input->setArgument('target', $target);
36
        parent::execute($input, $output);
37
    }
38
}