diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Command/InstallCommand.php | 6 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php (renamed from src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php) | 6 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Config.php | 1 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/InternalSetting.php | 36 |
4 files changed, 42 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 50e19f0c..f73e0696 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php | |||
@@ -2,7 +2,6 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Command; | 3 | namespace Wallabag\CoreBundle\Command; |
4 | 4 | ||
5 | use Craue\ConfigBundle\Entity\Setting; | ||
6 | use FOS\UserBundle\Event\UserEvent; | 5 | use FOS\UserBundle\Event\UserEvent; |
7 | use FOS\UserBundle\FOSUserEvents; | 6 | use FOS\UserBundle\FOSUserEvents; |
8 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | 7 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
@@ -13,6 +12,7 @@ use Symfony\Component\Console\Output\BufferedOutput; | |||
13 | use Symfony\Component\Console\Output\OutputInterface; | 12 | use Symfony\Component\Console\Output\OutputInterface; |
14 | use Symfony\Component\Console\Question\Question; | 13 | use Symfony\Component\Console\Question\Question; |
15 | use Symfony\Component\Console\Style\SymfonyStyle; | 14 | use Symfony\Component\Console\Style\SymfonyStyle; |
15 | use Wallabag\CoreBundle\Entity\InternalSetting; | ||
16 | 16 | ||
17 | class InstallCommand extends ContainerAwareCommand | 17 | class InstallCommand extends ContainerAwareCommand |
18 | { | 18 | { |
@@ -276,10 +276,10 @@ class InstallCommand extends ContainerAwareCommand | |||
276 | $em = $this->getContainer()->get('doctrine.orm.entity_manager'); | 276 | $em = $this->getContainer()->get('doctrine.orm.entity_manager'); |
277 | 277 | ||
278 | // cleanup before insert new stuff | 278 | // cleanup before insert new stuff |
279 | $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute(); | 279 | $em->createQuery('DELETE FROM WallabagCoreBundle:InternalSetting')->execute(); |
280 | 280 | ||
281 | foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) { | 281 | foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) { |
282 | $newSetting = new Setting(); | 282 | $newSetting = new InternalSetting(); |
283 | $newSetting->setName($setting['name']); | 283 | $newSetting->setName($setting['name']); |
284 | $newSetting->setValue($setting['value']); | 284 | $newSetting->setValue($setting['value']); |
285 | $newSetting->setSection($setting['section']); | 285 | $newSetting->setSection($setting['section']); |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php index cc7d1f59..b052d1d5 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php | |||
@@ -2,13 +2,13 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Craue\ConfigBundle\Entity\Setting; | ||
6 | use Doctrine\Bundle\FixturesBundle\Fixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 6 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
9 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | use Wallabag\CoreBundle\Entity\InternalSetting; | ||
10 | 10 | ||
11 | class SettingFixtures extends Fixture implements ContainerAwareInterface | 11 | class InternalSettingFixtures extends Fixture implements ContainerAwareInterface |
12 | { | 12 | { |
13 | /** | 13 | /** |
14 | * @var ContainerInterface | 14 | * @var ContainerInterface |
@@ -26,7 +26,7 @@ class SettingFixtures extends Fixture implements ContainerAwareInterface | |||
26 | public function load(ObjectManager $manager) | 26 | public function load(ObjectManager $manager) |
27 | { | 27 | { |
28 | foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { | 28 | foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { |
29 | $newSetting = new Setting(); | 29 | $newSetting = new InternalSetting(); |
30 | $newSetting->setName($setting['name']); | 30 | $newSetting->setName($setting['name']); |
31 | $newSetting->setValue($setting['value']); | 31 | $newSetting->setValue($setting['value']); |
32 | $newSetting->setSection($setting['section']); | 32 | $newSetting->setSection($setting['section']); |
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 5181d91d..35be9655 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php | |||
@@ -17,7 +17,6 @@ use Wallabag\UserBundle\Entity\User; | |||
17 | * @ORM\Index(name="config_feed_token", columns={"feed_token"}, options={"lengths"={255}}), | 17 | * @ORM\Index(name="config_feed_token", columns={"feed_token"}, options={"lengths"={255}}), |
18 | * } | 18 | * } |
19 | * ) | 19 | * ) |
20 | * @ORM\Entity | ||
21 | */ | 20 | */ |
22 | class Config | 21 | class Config |
23 | { | 22 | { |
diff --git a/src/Wallabag/CoreBundle/Entity/InternalSetting.php b/src/Wallabag/CoreBundle/Entity/InternalSetting.php new file mode 100644 index 00000000..df8bd3be --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/InternalSetting.php | |||
@@ -0,0 +1,36 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Entity; | ||
4 | |||
5 | use Craue\ConfigBundle\Entity\BaseSetting; | ||
6 | use Doctrine\ORM\Mapping as ORM; | ||
7 | |||
8 | /** | ||
9 | * InternalSetting. | ||
10 | * | ||
11 | * Re-define setting so we can override length attribute to fix utf8mb4 issue. | ||
12 | * | ||
13 | * @ORM\Entity(repositoryClass="Craue\ConfigBundle\Repository\SettingRepository") | ||
14 | * @ORM\Table(name="`internal_setting`") | ||
15 | * @ORM\AttributeOverrides({ | ||
16 | * @ORM\AttributeOverride(name="name", | ||
17 | * column=@ORM\Column( | ||
18 | * length = 191 | ||
19 | * ) | ||
20 | * ), | ||
21 | * @ORM\AttributeOverride(name="section", | ||
22 | * column=@ORM\Column( | ||
23 | * length = 191 | ||
24 | * ) | ||
25 | * ) | ||
26 | * }) | ||
27 | */ | ||
28 | class InternalSetting extends BaseSetting | ||
29 | { | ||
30 | /** | ||
31 | * @var string|null | ||
32 | * | ||
33 | * @ORM\Column(name="value", type="string", nullable=true, length=191) | ||
34 | */ | ||
35 | protected $value; | ||
36 | } | ||