@@ 14-37 (lines=24) @@ | ||
11 | /** |
|
12 | * @author Kevin Bond <[email protected]> |
|
13 | */ |
|
14 | class ListCommand extends BaseListCommand |
|
15 | { |
|
16 | /** |
|
17 | * {@inheritdoc} |
|
18 | */ |
|
19 | protected function execute(InputInterface $input, OutputInterface $output) |
|
20 | { |
|
21 | /** @var Application $application */ |
|
22 | $application = $this->getApplication(); |
|
23 | ||
24 | if (!$application instanceof Application) { |
|
25 | throw new \RuntimeException('Application must be instance of Symfony\Bundle\FrameworkBundle\Console\Application'); |
|
26 | } |
|
27 | ||
28 | $container = $application->getKernel()->getContainer(); |
|
29 | ||
30 | $this->getHelperSet()->set(new BackupHelper( |
|
31 | $container->get('zenstruck_backup.profile_registry'), |
|
32 | $container->get('zenstruck_backup.executor') |
|
33 | )); |
|
34 | ||
35 | parent::execute($input, $output); |
|
36 | } |
|
37 | } |
|
38 |
@@ 14-37 (lines=24) @@ | ||
11 | /** |
|
12 | * @author Kevin Bond <[email protected]> |
|
13 | */ |
|
14 | class RunCommand extends BaseRunCommand |
|
15 | { |
|
16 | /** |
|
17 | * {@inheritdoc} |
|
18 | */ |
|
19 | protected function execute(InputInterface $input, OutputInterface $output) |
|
20 | { |
|
21 | /** @var Application $application */ |
|
22 | $application = $this->getApplication(); |
|
23 | ||
24 | if (!$application instanceof Application) { |
|
25 | throw new \RuntimeException('Application must be instance of Symfony\Bundle\FrameworkBundle\Console\Application'); |
|
26 | } |
|
27 | ||
28 | $container = $application->getKernel()->getContainer(); |
|
29 | ||
30 | $this->getHelperSet()->set(new BackupHelper( |
|
31 | $container->get('zenstruck_backup.profile_registry'), |
|
32 | $container->get('zenstruck_backup.executor') |
|
33 | )); |
|
34 | ||
35 | parent::execute($input, $output); |
|
36 | } |
|
37 | } |
|
38 |