aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/InstallCommand.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-02-04 15:59:57 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2016-02-04 15:59:57 +0100
commite008c037f53324b931f027483f9f1053171109c5 (patch)
tree441c54eb946ffb53a161cad8f686ce7aff875abd /src/Wallabag/CoreBundle/Command/InstallCommand.php
parent74f39b0952440fa0c55e5e8a2e1a8d2bbd3acfd7 (diff)
parent79b9e49d9464e9a67f6ee66fbf6f6c541b1a29f4 (diff)
downloadwallabag-e008c037f53324b931f027483f9f1053171109c5.tar.gz
wallabag-e008c037f53324b931f027483f9f1053171109c5.tar.zst
wallabag-e008c037f53324b931f027483f9f1053171109c5.zip
Merge pull request #1612 from wallabag/v2-settings-page
Settings page
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/InstallCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php118
1 files changed, 114 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 63032dbb..e6a06eea 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -12,6 +12,7 @@ use Symfony\Component\Console\Output\OutputInterface;
12use Symfony\Component\Console\Question\ConfirmationQuestion; 12use Symfony\Component\Console\Question\ConfirmationQuestion;
13use Symfony\Component\Console\Question\Question; 13use Symfony\Component\Console\Question\Question;
14use Wallabag\CoreBundle\Entity\Config; 14use Wallabag\CoreBundle\Entity\Config;
15use Craue\ConfigBundle\Entity\Setting;
15 16
16class InstallCommand extends ContainerAwareCommand 17class InstallCommand extends ContainerAwareCommand
17{ 18{
@@ -204,13 +205,122 @@ class InstallCommand extends ContainerAwareCommand
204 $em->persist($user); 205 $em->persist($user);
205 206
206 $config = new Config($user); 207 $config = new Config($user);
207 $config->setTheme($this->getContainer()->getParameter('theme')); 208 $config->setTheme($this->getContainer()->getParameter('wallabag_core.theme'));
208 $config->setItemsPerPage($this->getContainer()->getParameter('items_on_page')); 209 $config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page'));
209 $config->setRssLimit($this->getContainer()->getParameter('rss_limit')); 210 $config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit'));
210 $config->setLanguage($this->getContainer()->getParameter('language')); 211 $config->setLanguage($this->getContainer()->getParameter('wallabag_core.language'));
211 212
212 $em->persist($config); 213 $em->persist($config);
213 214
215 // cleanup before insert new stuff
216 $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute();
217
218 $settings = [
219 [
220 'name' => 'download_pictures',
221 'value' => '1',
222 'section' => 'entry',
223 ],
224 [
225 'name' => 'carrot',
226 'value' => '1',
227 'section' => 'entry',
228 ],
229 [
230 'name' => 'share_diaspora',
231 'value' => '1',
232 'section' => 'entry',
233 ],
234 [
235 'name' => 'diaspora_url',
236 'value' => 'http://diasporapod.com',
237 'section' => 'entry',
238 ],
239 [
240 'name' => 'share_shaarli',
241 'value' => '1',
242 'section' => 'entry',
243 ],
244 [
245 'name' => 'shaarli_url',
246 'value' => 'http://myshaarli.com',
247 'section' => 'entry',
248 ],
249 [
250 'name' => 'share_mail',
251 'value' => '1',
252 'section' => 'entry',
253 ],
254 [
255 'name' => 'share_twitter',
256 'value' => '1',
257 'section' => 'entry',
258 ],
259 [
260 'name' => 'export_epub',
261 'value' => '1',
262 'section' => 'export',
263 ],
264 [
265 'name' => 'export_mobi',
266 'value' => '1',
267 'section' => 'export',
268 ],
269 [
270 'name' => 'export_pdf',
271 'value' => '1',
272 'section' => 'export',
273 ],
274 [
275 'name' => 'export_csv',
276 'value' => '1',
277 'section' => 'export',
278 ],
279 [
280 'name' => 'export_json',
281 'value' => '1',
282 'section' => 'export',
283 ],
284 [
285 'name' => 'export_txt',
286 'value' => '1',
287 'section' => 'export',
288 ],
289 [
290 'name' => 'export_xml',
291 'value' => '1',
292 'section' => 'export',
293 ],
294 [
295 'name' => 'pocket_consumer_key',
296 'value' => null,
297 'section' => 'import',
298 ],
299 [
300 'name' => 'show_printlink',
301 'value' => '1',
302 'section' => 'entry',
303 ],
304 [
305 'name' => 'wallabag_support_url',
306 'value' => 'https://www.wallabag.org/pages/support.html',
307 'section' => 'misc',
308 ],
309 [
310 'name' => 'wallabag_url',
311 'value' => 'http://v2.wallabag.org',
312 'section' => 'misc',
313 ],
314 ];
315
316 foreach ($settings as $setting) {
317 $newSetting = new Setting();
318 $newSetting->setName($setting['name']);
319 $newSetting->setValue($setting['value']);
320 $newSetting->setSection($setting['section']);
321 $em->persist($newSetting);
322 }
323
214 $em->flush(); 324 $em->flush();
215 325
216 $this->defaultOutput->writeln(''); 326 $this->defaultOutput->writeln('');