aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/InstallCommand.php
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2020-04-26 15:39:57 +0200
committerGitHub <noreply@github.com>2020-04-26 15:39:57 +0200
commit0e8a0f77d0b643a884e6687bd9c463267852a970 (patch)
tree88c6761b4215637bba34b263015e87750c92a187 /src/Wallabag/CoreBundle/Command/InstallCommand.php
parent8a8a78a64c116caf81aaa4339906298bdc0e32e0 (diff)
parent71f7e58fbd84e1d15c7a405a3c5872adb937dc37 (diff)
downloadwallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.gz
wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.zst
wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.zip
Merge pull request #4026 from wallabag/3760-ignorelist-db
Move Ignore Origin rules to database
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/InstallCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 3aa332f1..8d08187a 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -12,6 +12,7 @@ use Symfony\Component\Console\Output\BufferedOutput;
12use Symfony\Component\Console\Output\OutputInterface; 12use Symfony\Component\Console\Output\OutputInterface;
13use Symfony\Component\Console\Question\Question; 13use Symfony\Component\Console\Question\Question;
14use Symfony\Component\Console\Style\SymfonyStyle; 14use Symfony\Component\Console\Style\SymfonyStyle;
15use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
15use Wallabag\CoreBundle\Entity\InternalSetting; 16use Wallabag\CoreBundle\Entity\InternalSetting;
16 17
17class InstallCommand extends ContainerAwareCommand 18class InstallCommand extends ContainerAwareCommand
@@ -277,6 +278,7 @@ class InstallCommand extends ContainerAwareCommand
277 278
278 // cleanup before insert new stuff 279 // cleanup before insert new stuff
279 $em->createQuery('DELETE FROM WallabagCoreBundle:InternalSetting')->execute(); 280 $em->createQuery('DELETE FROM WallabagCoreBundle:InternalSetting')->execute();
281 $em->createQuery('DELETE FROM WallabagCoreBundle:IgnoreOriginInstanceRule')->execute();
280 282
281 foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) { 283 foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) {
282 $newSetting = new InternalSetting(); 284 $newSetting = new InternalSetting();
@@ -286,6 +288,12 @@ class InstallCommand extends ContainerAwareCommand
286 $em->persist($newSetting); 288 $em->persist($newSetting);
287 } 289 }
288 290
291 foreach ($this->getContainer()->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) {
292 $newIgnoreOriginInstanceRule = new IgnoreOriginInstanceRule();
293 $newIgnoreOriginInstanceRule->setRule($ignore_origin_instance_rule['rule']);
294 $em->persist($newIgnoreOriginInstanceRule);
295 }
296
289 $em->flush(); 297 $em->flush();
290 298
291 $this->io->text('<info>Config successfully setup.</info>'); 299 $this->io->text('<info>Config successfully setup.</info>');