|
@@ -0,0 +1,36 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace KeaBundle\Command;
|
|
|
+
|
|
|
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
|
|
+use Symfony\Component\Console\Input\InputInterface;
|
|
|
+use Symfony\Component\Console\Input\InputOption;
|
|
|
+use Symfony\Component\Console\Output\OutputInterface;
|
|
|
+
|
|
|
+class KeaConfigCommand extends ContainerAwareCommand
|
|
|
+{
|
|
|
+
|
|
|
+ protected function configure()
|
|
|
+ {
|
|
|
+ $this
|
|
|
+ ->setName('kea:config')
|
|
|
+ ->setDescription('Kea DHCP Config')
|
|
|
+ ->setHelp('Create Kea DHCP Config')
|
|
|
+ ->addOption('class', null, InputOption::VALUE_OPTIONAL, 'Kea Class Config in KeaBundle\Services. e.g. BaseKea', 'BaseKea')
|
|
|
+ ;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param InputInterface $input
|
|
|
+ * @param OutputInterface $output
|
|
|
+ */
|
|
|
+ protected function execute(InputInterface $input, OutputInterface $output)
|
|
|
+ {
|
|
|
+ $this->output = $output;
|
|
|
+ $class = $input->getOption('class');
|
|
|
+ $keaConfigService = $this->getContainer()->get('kea.config');
|
|
|
+
|
|
|
+ $output->writeln($keaConfigService->getConfig($class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|