use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
use Wallabag\CoreBundle\Entity\InternalSetting;
class InstallCommand extends ContainerAwareCommand
// cleanup before insert new stuff
$em->createQuery('DELETE FROM WallabagCoreBundle:InternalSetting')->execute();
+ $em->createQuery('DELETE FROM WallabagCoreBundle:IgnoreOriginInstanceRule')->execute();
foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) {
$newSetting = new InternalSetting();
$em->persist($newSetting);
}
+ foreach ($this->getContainer()->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) {
+ $newIgnoreOriginInstanceRule = new IgnoreOriginInstanceRule();
+ $newIgnoreOriginInstanceRule->setRule($ignore_origin_instance_rule['rule']);
+ $em->persist($newIgnoreOriginInstanceRule);
+ }
+
$em->flush();
$this->io->text('<info>Config successfully setup.</info>');
if (0 !== $exitCode) {
$this->getApplication()->setAutoExit(true);
- throw new \RuntimeException(
- 'The command "' . $command . "\" generates some errors: \n\n"
- . $output->fetch());
+ throw new \RuntimeException('The command "' . $command . "\" generates some errors: \n\n" . $output->fetch());
}
return $this;