aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php164
1 files changed, 14 insertions, 150 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
index a723656e..a52288e6 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
@@ -6,163 +6,27 @@ use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface; 6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager; 7use Doctrine\Common\Persistence\ObjectManager;
8use Craue\ConfigBundle\Entity\Setting; 8use Craue\ConfigBundle\Entity\Setting;
9use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10use Symfony\Component\DependencyInjection\ContainerInterface;
9 11
10class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface 12class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
11{ 13{
12 /** 14 /**
15 * @var ContainerInterface
16 */
17 private $container;
18
19 public function setContainer(ContainerInterface $container = null)
20 {
21 $this->container = $container;
22 }
23
24 /**
13 * {@inheritdoc} 25 * {@inheritdoc}
14 */ 26 */
15 public function load(ObjectManager $manager) 27 public function load(ObjectManager $manager)
16 { 28 {
17 $settings = [ 29 foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) {
18 [
19 'name' => 'share_public',
20 'value' => '1',
21 'section' => 'entry',
22 ],
23 [
24 'name' => 'carrot',
25 'value' => '1',
26 'section' => 'entry',
27 ],
28 [
29 'name' => 'share_diaspora',
30 'value' => '1',
31 'section' => 'entry',
32 ],
33 [
34 'name' => 'diaspora_url',
35 'value' => 'http://diasporapod.com',
36 'section' => 'entry',
37 ],
38 [
39 'name' => 'share_unmark',
40 'value' => '1',
41 'section' => 'entry',
42 ],
43 [
44 'name' => 'unmark_url',
45 'value' => 'https://unmark.it',
46 'section' => 'entry',
47 ],
48 [
49 'name' => 'share_shaarli',
50 'value' => '1',
51 'section' => 'entry',
52 ],
53 [
54 'name' => 'shaarli_url',
55 'value' => 'http://myshaarli.com',
56 'section' => 'entry',
57 ],
58 [
59 'name' => 'share_mail',
60 'value' => '1',
61 'section' => 'entry',
62 ],
63 [
64 'name' => 'share_twitter',
65 'value' => '1',
66 'section' => 'entry',
67 ],
68 [
69 'name' => 'export_epub',
70 'value' => '1',
71 'section' => 'export',
72 ],
73 [
74 'name' => 'export_mobi',
75 'value' => '1',
76 'section' => 'export',
77 ],
78 [
79 'name' => 'export_pdf',
80 'value' => '1',
81 'section' => 'export',
82 ],
83 [
84 'name' => 'export_csv',
85 'value' => '1',
86 'section' => 'export',
87 ],
88 [
89 'name' => 'export_json',
90 'value' => '1',
91 'section' => 'export',
92 ],
93 [
94 'name' => 'export_txt',
95 'value' => '1',
96 'section' => 'export',
97 ],
98 [
99 'name' => 'export_xml',
100 'value' => '1',
101 'section' => 'export',
102 ],
103 [
104 'name' => 'import_with_redis',
105 'value' => '0',
106 'section' => 'import',
107 ],
108 [
109 'name' => 'import_with_rabbitmq',
110 'value' => '0',
111 'section' => 'import',
112 ],
113 [
114 'name' => 'show_printlink',
115 'value' => '1',
116 'section' => 'entry',
117 ],
118 [
119 'name' => 'wallabag_support_url',
120 'value' => 'https://www.wallabag.org/pages/support.html',
121 'section' => 'misc',
122 ],
123 [
124 'name' => 'wallabag_url',
125 'value' => 'http://v2.wallabag.org',
126 'section' => 'misc',
127 ],
128 [
129 'name' => 'piwik_enabled',
130 'value' => '0',
131 'section' => 'analytics',
132 ],
133 [
134 'name' => 'piwik_host',
135 'value' => 'v2.wallabag.org',
136 'section' => 'analytics',
137 ],
138 [
139 'name' => 'piwik_site_id',
140 'value' => '1',
141 'section' => 'analytics',
142 ],
143 [
144 'name' => 'demo_mode_enabled',
145 'value' => '0',
146 'section' => 'misc',
147 ],
148 [
149 'name' => 'demo_mode_username',
150 'value' => 'wallabag',
151 'section' => 'misc',
152 ],
153 [
154 'name' => 'download_images_enabled',
155 'value' => '0',
156 'section' => 'misc',
157 ],
158 [
159 'name' => 'restricted_access',
160 'value' => '0',
161 'section' => 'entry',
162 ],
163 ];
164
165 foreach ($settings as $setting) {
166 $newSetting = new Setting(); 30 $newSetting = new Setting();
167 $newSetting->setName($setting['name']); 31 $newSetting->setName($setting['name']);
168 $newSetting->setValue($setting['value']); 32 $newSetting->setValue($setting['value']);