]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #3173 from wallabag/domain-name-param
authorJérémy Benoist <j0k3r@users.noreply.github.com>
Sat, 10 Jun 2017 09:36:03 +0000 (11:36 +0200)
committerGitHub <noreply@github.com>
Sat, 10 Jun 2017 09:36:03 +0000 (11:36 +0200)
remove craueconfig domain name setting and add a proper one in parame…

18 files changed:
app/DoctrineMigrations/Version20170606155640.php [new file with mode: 0644]
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml
app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml
app/config/parameters.yml.dist
app/config/wallabag.yml
src/Wallabag/CoreBundle/Controller/ConfigController.php
src/Wallabag/CoreBundle/Resources/config/services.yml
src/Wallabag/UserBundle/Resources/config/services.yml
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php

diff --git a/app/DoctrineMigrations/Version20170606155640.php b/app/DoctrineMigrations/Version20170606155640.php
new file mode 100644 (file)
index 0000000..e9b5042
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Remove wallabag_url from craue_config_setting.
+ * It has been moved into the parameters.yml
+ */
+class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface
+{
+    /**
+     * @var ContainerInterface
+     */
+    private $container;
+
+    public function setContainer(ContainerInterface $container = null)
+    {
+        $this->container = $container;
+    }
+
+    private function getTable($tableName)
+    {
+        return $this->container->getParameter('database_table_prefix').$tableName;
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function up(Schema $schema)
+    {
+        $apiUserRegistration = $this->container
+            ->get('doctrine.orm.default_entity_manager')
+            ->getConnection()
+            ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'wallabag_url'");
+
+        $this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.');
+
+        $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'wallabag_url'");
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function down(Schema $schema)
+    {
+        $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
+    }
+}
index 20e938f5a007c90a3f45599aaaa6a779fb4d4716..5475e571e94ff317c2de2664e14b4c5d29ffa615 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Aktiver deling gennem Twitter
 share_unmark: Aktiver deling gennem Unmark.it
 show_printlink: Vis et link til print-indhold
 wallabag_support_url: Support-URL for wallabag
-wallabag_url: URL for *sin* wallabag-installation
 entry: "artikel"
 export: "eksport"
 import: "import"
index 526d41bc59dbd6492aed550913231b6d2fc8aafd..f57db3032d976d68f58398923deb321dffd59d0f 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Teilen zu Twitter aktiveren
 share_unmark: Teilen zu Unmark.it aktiveren
 show_printlink: Link anzeigen, um den Inhalt auszudrucken
 wallabag_support_url: Support-URL für wallabag
-wallabag_url: URL von *deiner* wallabag-Instanz
 entry: "Artikel"
 export: "Export"
 import: "Import"
index 3c0037f38d749558af8280f6a953a60f3bd1c624..1e4f46688ccf21d2f43d392067e064db2855286b 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Enable share to Twitter
 share_unmark: Enable share to Unmark.it
 show_printlink: Display a link to print content
 wallabag_support_url: Support URL for wallabag
-wallabag_url: URL of *your* wallabag instance
 entry: "article"
 export: "export"
 import: "import"
index 9986966906486ba11d6dcdda59a95a755411c96f..46ed40406be823142eb322f0021ac2b804dce218 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Activar compartir con Twitter
 share_unmark: Activar compartir con Unmark.it
 show_printlink: Mostrar un enlace para imprimir contenido
 wallabag_support_url: URL de soporte de wallabag
-wallabag_url: URL de *tu* instancia de wallabag
 entry: "artículo"
 export: "exportar"
 import: "importar"
index 2e1307e58886b75b14c95da4658f2a5b4755565d..f8da4acff629803ea32533181ab401fe5d6e163e 100644 (file)
@@ -20,7 +20,6 @@ share_twitter:  فعال‌سازی هم‌رسانی به Twitter
 share_unmark:  فعال‌سازی هم‌رسانی به Unmark.it
 show_printlink: نمایش پیوندی برای چاپ مطلب
 wallabag_support_url: نشانی صفحهٔ پشتیبانی wallabag
-wallabag_url: نشانی صفحهٔ wallabag *شما*
 entry: "مقاله"
 export: "برون‌سپاری"
 import: "درون‌ریزی"
index 454053ad2352db23038e7d3ed7b2690205c961c8..a79409b428fffab7f6ce412f6ddc2dc326df2a21 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Activer le partage vers Twitter
 share_unmark: Activer le partage vers Unmark.it
 show_printlink: Afficher un lien pour imprimer
 wallabag_support_url: URL de support de wallabag
-wallabag_url: URL de *votre* instance de wallabag
 entry: "article"
 export: "export"
 import: "import"
index 4dbd2ff8e195ed1366a885af61ebbf6eb3d9a94c..dd4def4bffbb9246889e8a6496fbaee630b60f3f 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Abilita la condivisione con Twitter
 share_unmark: Abilita la condivisione con Unmark.it
 show_printlink: Mostra un collegamento per stampare il contenuto
 wallabag_support_url: URL di supporto per wallabag
-wallabag_url: URL della *tua* installazione di wallabag
 entry: "contenuto"
 export: "esporta"
 import: "importa"
index 00c06638da81afb097aec8fe5b37dce39fee8a5c..66d9ae266f8f7ebdf4dec58395fb2b7d1494125a 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Activar lo partatge cap a Twitter
 share_unmark: Activar lo partatge cap a Unmark.it
 show_printlink: Afichar un ligam per imprimir
 wallabag_support_url: URL d'assisténcia de wallabag
-wallabag_url: URL de *vòstra* instància de wallabag
 entry: "article"
 export: "expòrt"
 import: "impòrt"
index ada11b3aa7585d9245f6b909539980e27d154997..04ad4fd3c58ffb893f8462ec9cbe0b8310ba3989 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Włącz udostępnianie dla Twitter
 share_unmark: Włącz udostępnianie dla Unmark.it
 show_printlink: Pokaż link do wydrukowania zawartości
 wallabag_support_url: Adres URL wsparcia dla wallabag
-wallabag_url: Adres *twojej* instacji wallabag
 entry: "artykuł"
 export: "eksport"
 import: "import"
index 59af9610539b772c7f57745e9f940eedd85e9f65..77e22b375464d5939ad4e77b34d918cbd4319336 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Habilitar compartilhamento para o Twitter
 share_unmark: Habilitar compartilhamento para o Unmark.it
 show_printlink: Mostrar um link para imprimir o conteúdo
 wallabag_support_url: URL de Suporte do wallabag
-wallabag_url: URL de *sua* instância do wallabag
 entry: "artigo"
 export: "exportar"
 import: "importar"
index 104e37c6ade9654d27384705f3e939c0981a21fb..1b4bfb5bcc5550ffb1a7e2486b75c73d750fda9d 100644 (file)
@@ -20,7 +20,6 @@ share_twitter: Permite share către Twitter
 share_unmark: Permite share către Unmark.it
 show_printlink: Afișează un link pentru a printa content-ul
 wallabag_support_url: URL-ul de suport pentru wallabag
-wallabag_url: URL-ul instanței tale wallabag
 entry: "alticol"
 export: "exportă"
 import: "importă"
index afcee0399006a400030573bc9c5cf6d0e270c988..914fb1efcba94fdec85a66d0d2b33b4d83f63673 100644 (file)
@@ -23,6 +23,8 @@ parameters:
     # with PostgreSQL and SQLite, you must set "utf8"
     database_charset: utf8mb4
 
+    domain_name: https://your-wallabag-url-instance.com
+
     mailer_transport: smtp
     mailer_host: 127.0.0.1
     mailer_user: ~
index d8c593c6741cec0dd09c392a551b608e657fa214..51b7e4e3034fcb9bf344d9e378ad2b6e5e284db1 100644 (file)
@@ -147,10 +147,6 @@ wallabag_core:
             name: wallabag_support_url
             value: https://www.wallabag.org/pages/support.html
             section: misc
-        -
-            name: wallabag_url
-            value: http://v2.wallabag.org
-            section: misc
         -
             name: api_user_registration
             value: 0
index 0e61c642039a98c4ced84493130a6ab4e61c4148..89d27425c65b822bcfbf201450189f7d95b25a25 100644 (file)
@@ -151,7 +151,7 @@ class ConfigController extends Controller
                 'token' => $config->getRssToken(),
             ],
             'twofactor_auth' => $this->getParameter('twofactor_auth'),
-            'wallabag_url' => $this->get('craue_config')->get('wallabag_url'),
+            'wallabag_url' => $this->getParameter('domain_name'),
             'enabled_users' => $this->getDoctrine()
                 ->getRepository('WallabagUserBundle:User')
                 ->getSumEnabledUsers(),
index 2ae5d27f2fbd2166ab9d5913b5e7a79163e8250e..4be7954702cba1a26f46bd06ce32404583129f30 100644 (file)
@@ -123,7 +123,7 @@ services:
     wallabag_core.helper.entries_export:
         class: Wallabag\CoreBundle\Helper\EntriesExport
         arguments:
-            - '@=service(''craue_config'').get(''wallabag_url'')'
+            - '%domain_name%'
             - src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png
 
     wallabag.operator.array.matches:
@@ -196,7 +196,7 @@ services:
         arguments:
             - "@wallabag_core.entry.download_images.client"
             - "%kernel.root_dir%/../web/assets/images"
-            - '@=service(''craue_config'').get(''wallabag_url'')'
+            - '%domain_name%'
             - "@logger"
 
     wallabag_core.entry.download_images.client:
index f2cd6e015e7f7d8cee29a28ed0806f7921fa0b0f..d3925de3b1f8991ea9bd9029a73418088bd2be4c 100644 (file)
@@ -7,7 +7,7 @@ services:
             - "%scheb_two_factor.email.sender_email%"
             - "%scheb_two_factor.email.sender_name%"
             - '@=service(''craue_config'').get(''wallabag_support_url'')'
-            - '@=service(''craue_config'').get(''wallabag_url'')'
+            - '%domain_name%'
 
     wallabag_user.password_resetting:
         class: Wallabag\UserBundle\EventListener\PasswordResettingListener
index 3babbaca0654dfecf6bb1c06422af0a5a7738f93..8f5c372d83bc92356b2ab8e9daec60fb371a3640 100644 (file)
@@ -989,7 +989,7 @@ class EntryControllerTest extends WallabagCoreTestCase
         $this->assertEquals($url, $entry->getUrl());
         $this->assertContains('Perpignan', $entry->getTitle());
         // instead of checking for the filename (which might change) check that the image is now local
-        $this->assertContains('http://v2.wallabag.org/assets/images/', $entry->getContent());
+        $this->assertContains('https://your-wallabag-url-instance.com/assets/images/', $entry->getContent());
 
         $client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
     }