aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-10-01 15:51:37 +0200
committerGitHub <noreply@github.com>2016-10-01 15:51:37 +0200
commitdb5541e7a1e7131d62b4df23fa6eadd0c542b256 (patch)
treec5c71df873a9aa9350660e225f046a448274868f /src/Wallabag/CoreBundle/Command
parent114c55c0a6eade2ba6c53fe25f61cc58cca91620 (diff)
parentfb7354c4a430f4f4916a1247aa1b1bf564ead0da (diff)
downloadwallabag-db5541e7a1e7131d62b4df23fa6eadd0c542b256.tar.gz
wallabag-db5541e7a1e7131d62b4df23fa6eadd0c542b256.tar.zst
wallabag-db5541e7a1e7131d62b4df23fa6eadd0c542b256.zip
Merge pull request #2320 from wallabag/user-config
Create user config in one place.
Diffstat (limited to 'src/Wallabag/CoreBundle/Command')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 3873d2d3..cc7c2c94 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -2,6 +2,8 @@
2 2
3namespace Wallabag\CoreBundle\Command; 3namespace Wallabag\CoreBundle\Command;
4 4
5use FOS\UserBundle\Event\UserEvent;
6use FOS\UserBundle\FOSUserEvents;
5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; 7use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6use Symfony\Component\Console\Helper\Table; 8use Symfony\Component\Console\Helper\Table;
7use Symfony\Component\Console\Input\ArrayInput; 9use Symfony\Component\Console\Input\ArrayInput;
@@ -236,14 +238,9 @@ class InstallCommand extends ContainerAwareCommand
236 238
237 $em->persist($user); 239 $em->persist($user);
238 240
239 $config = new Config($user); 241 // dispatch a created event so the associated config will be created
240 $config->setTheme($this->getContainer()->getParameter('wallabag_core.theme')); 242 $event = new UserEvent($user);
241 $config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page')); 243 $this->getContainer()->get('event_dispatcher')->dispatch(FOSUserEvents::USER_CREATED, $event);
242 $config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit'));
243 $config->setReadingSpeed($this->getContainer()->getParameter('wallabag_core.reading_speed'));
244 $config->setLanguage($this->getContainer()->getParameter('wallabag_core.language'));
245
246 $em->persist($config);
247 244
248 $this->defaultOutput->writeln(''); 245 $this->defaultOutput->writeln('');
249 246