aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2017-11-20 17:39:14 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2017-11-20 18:47:48 +0100
commit8a21985474c2daae9f84ac52463fe7d297aae3ae (patch)
tree278b3c516222f3a1f6286f7c62a0852bb61fcb65
parente585dde46c4ed9e0223925968f1634e81c15c67f (diff)
downloadwallabag-8a21985474c2daae9f84ac52463fe7d297aae3ae.tar.gz
wallabag-8a21985474c2daae9f84ac52463fe7d297aae3ae.tar.zst
wallabag-8a21985474c2daae9f84ac52463fe7d297aae3ae.zip
Added internal setting to enable/disable headers storage
-rw-r--r--app/DoctrineMigrations/Version20171120163128.php52
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml2
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml4
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml3
-rw-r--r--app/config/wallabag.yml4
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php6
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml1
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php3
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php26
19 files changed, 116 insertions, 15 deletions
diff --git a/app/DoctrineMigrations/Version20171120163128.php b/app/DoctrineMigrations/Version20171120163128.php
new file mode 100644
index 00000000..fc3d4c37
--- /dev/null
+++ b/app/DoctrineMigrations/Version20171120163128.php
@@ -0,0 +1,52 @@
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema;
7use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8use Symfony\Component\DependencyInjection\ContainerInterface;
9
10/**
11 * Add store_article_headers in craue_config_setting.
12 */
13class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface
14{
15 /**
16 * @var ContainerInterface
17 */
18 private $container;
19
20 public function setContainer(ContainerInterface $container = null)
21 {
22 $this->container = $container;
23 }
24
25 /**
26 * @param Schema $schema
27 */
28 public function up(Schema $schema)
29 {
30 $storeArticleHeaders = $this->container
31 ->get('doctrine.orm.default_entity_manager')
32 ->getConnection()
33 ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'");
34
35 $this->skipIf(false !== $storeArticleHeaders, 'It seems that you already played this migration.');
36
37 $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('store_article_headers', '0', 'entry')");
38 }
39
40 /**
41 * @param Schema $schema
42 */
43 public function down(Schema $schema)
44 {
45 $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
46 }
47
48 private function getTable($tableName)
49 {
50 return $this->container->getParameter('database_table_prefix') . $tableName;
51 }
52}
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml
index 5475e571..c3fd843f 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml
@@ -12,6 +12,8 @@ export_xml: Aktiver eksport til XML
12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13# import_with_redis: Enable Redis to import data asynchronously 13# import_with_redis: Enable Redis to import data asynchronously
14shaarli_url: Shaarli-URL, hvis tjenesten er aktiv 14shaarli_url: Shaarli-URL, hvis tjenesten er aktiv
15scuttle_url: Scuttle-URL, hvis tjenesten er aktiv
16unmark_url: Unmark-URL, hvis tjenesten er aktiv
15share_diaspora: Aktiver deling til Diaspora 17share_diaspora: Aktiver deling til Diaspora
16share_mail: Aktiver deling med email 18share_mail: Aktiver deling med email
17share_shaarli: Aktiver deling gennem Shaarli 19share_shaarli: Aktiver deling gennem Shaarli
@@ -34,3 +36,4 @@ demo_mode_username: "Demobruger"
34# download_images_enabled: Download images locally 36# download_images_enabled: Download images locally
35# restricted_access: Enable authentication for websites with paywall 37# restricted_access: Enable authentication for websites with paywall
36# api_user_registration: Enable user to be registered using the API 38# api_user_registration: Enable user to be registered using the API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml
index a066c8e3..37da383e 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml
@@ -12,6 +12,8 @@ export_xml: 'XML-Export aktivieren'
12import_with_rabbitmq: 'Aktiviere RabbitMQ, um Artikel asynchron zu importieren' 12import_with_rabbitmq: 'Aktiviere RabbitMQ, um Artikel asynchron zu importieren'
13import_with_redis: 'Aktiviere Redis, um Artikel asynchron zu importieren' 13import_with_redis: 'Aktiviere Redis, um Artikel asynchron zu importieren'
14shaarli_url: 'Shaarli-URL, sofern der Service aktiviert ist' 14shaarli_url: 'Shaarli-URL, sofern der Service aktiviert ist'
15scuttle_url: 'Scuttle-URL, sofern der Service aktiviert ist'
16unmark_url: 'Unmark-URL, sofern der Service aktiviert ist'
15share_diaspora: 'Teilen zu Diaspora aktiveren' 17share_diaspora: 'Teilen zu Diaspora aktiveren'
16share_mail: 'Teilen via E-Mail aktiveren' 18share_mail: 'Teilen via E-Mail aktiveren'
17share_shaarli: 'Teilen zu Shaarli aktiveren' 19share_shaarli: 'Teilen zu Shaarli aktiveren'
@@ -34,3 +36,4 @@ share_public: 'Erlaube eine öffentliche URL für Einträge'
34download_images_enabled: 'Bilder lokal herunterladen' 36download_images_enabled: 'Bilder lokal herunterladen'
35restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren' 37restricted_access: 'Authentifizierung für Webseiten mit Paywall aktivieren'
36api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen' 38api_user_registration: 'Registrierung eines Benutzers über die API ermöglichen'
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
index b53066b1..0a89ce2c 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
@@ -12,6 +12,8 @@ export_xml: Enable XML export
12import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13import_with_redis: Enable Redis to import data asynchronously 13import_with_redis: Enable Redis to import data asynchronously
14shaarli_url: Shaarli URL, if the service is enabled 14shaarli_url: Shaarli URL, if the service is enabled
15scuttle_url: Scuttle URL, if the service is enabled
16unmark_url: Unmark URL, if the service is enabled
15share_diaspora: Enable share to diaspora* 17share_diaspora: Enable share to diaspora*
16share_mail: Enable share by e-mail 18share_mail: Enable share by e-mail
17share_shaarli: Enable sharing to Shaarli 19share_shaarli: Enable sharing to Shaarli
@@ -34,3 +36,4 @@ share_public: Allow public URL for entries
34download_images_enabled: Download images locally 36download_images_enabled: Download images locally
35restricted_access: Enable authentication for paywalled websites 37restricted_access: Enable authentication for paywalled websites
36api_user_registration: Enable user to be registered using the API 38api_user_registration: Enable user to be registered using the API
39store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml
index 46ed4040..db5858d6 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml
@@ -12,6 +12,8 @@ export_xml: Activar exportación a XML
12import_with_rabbitmq: Activar RabbitMQ para importar datos de forma asíncrona 12import_with_rabbitmq: Activar RabbitMQ para importar datos de forma asíncrona
13import_with_redis: Activar Redis para importar datos de forma asíncrona 13import_with_redis: Activar Redis para importar datos de forma asíncrona
14shaarli_url: URL de Shaarli, si el servicio está activado 14shaarli_url: URL de Shaarli, si el servicio está activado
15scuttle_url: URL de Scuttle, si el servicio está activado
16unmark_url: URL de Unmark, si el servicio está activado
15share_diaspora: Activar compartir con Diaspora 17share_diaspora: Activar compartir con Diaspora
16share_mail: Activar compartir con Email 18share_mail: Activar compartir con Email
17share_shaarli: Activar compartir con Shaarli 19share_shaarli: Activar compartir con Shaarli
@@ -34,3 +36,4 @@ share_public: Permitir URL pública para los artículos
34download_images_enabled: Descargar imágenes localmente 36download_images_enabled: Descargar imágenes localmente
35restricted_access: Activar autenticación para websites con paywall 37restricted_access: Activar autenticación para websites con paywall
36# api_user_registration: Enable user to be registered using the API 38# api_user_registration: Enable user to be registered using the API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml
index f8da4acf..11cc601b 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml
@@ -12,6 +12,8 @@ export_xml: فعال‌سازی برون‌سپاری به XML
12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13# import_with_redis: Enable Redis to import data asynchronously 13# import_with_redis: Enable Redis to import data asynchronously
14shaarli_url: نشانی Shaarli، اگر فعال بود 14shaarli_url: نشانی Shaarli، اگر فعال بود
15scuttle_url: نشانی Scuttle، اگر فعال بود
16unmark_url: نشانی Unmark، اگر فعال بود
15share_diaspora: فعال‌سازی هم‌رسانی به Diaspora 17share_diaspora: فعال‌سازی هم‌رسانی به Diaspora
16share_mail: فعال‌سازی هم‌رسانی با ایمیل 18share_mail: فعال‌سازی هم‌رسانی با ایمیل
17share_shaarli: فعال‌سازی هم‌رسانی به Shaarli 19share_shaarli: فعال‌سازی هم‌رسانی به Shaarli
@@ -34,3 +36,4 @@ modify_settings: "اعمال"
34# download_images_enabled: Download images locally 36# download_images_enabled: Download images locally
35# restricted_access: Enable authentication for websites with paywall 37# restricted_access: Enable authentication for websites with paywall
36# api_user_registration: Enable user to be registered using the API 38# api_user_registration: Enable user to be registered using the API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
index a79409b4..f23b5bf9 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
@@ -12,6 +12,8 @@ export_xml: Activer l'export XML
12import_with_rabbitmq: Activer RabbitMQ pour gérer les imports de façon asynchrone 12import_with_rabbitmq: Activer RabbitMQ pour gérer les imports de façon asynchrone
13import_with_redis: Activer Redis pour gérer les imports de façon asynchrone 13import_with_redis: Activer Redis pour gérer les imports de façon asynchrone
14shaarli_url: URL de Shaarli, si le service Shaarli est activé 14shaarli_url: URL de Shaarli, si le service Shaarli est activé
15scuttle_url: URL de Scuttle, si le service Scuttle est activé
16unmark_url: URL de Unmark, si le service Unmark est activé
15share_diaspora: Activer le partage vers Diaspora 17share_diaspora: Activer le partage vers Diaspora
16share_mail: Activer le partage par email 18share_mail: Activer le partage par email
17share_shaarli: Activer le partage vers Shaarli 19share_shaarli: Activer le partage vers Shaarli
@@ -34,3 +36,4 @@ share_public: Autoriser une URL publique pour les articles
34download_images_enabled: Télécharger les images en local 36download_images_enabled: Télécharger les images en local
35restricted_access: Activer l'authentification pour les articles derrière un paywall 37restricted_access: Activer l'authentification pour les articles derrière un paywall
36api_user_registration: Activer la création de compte depuis l'API 38api_user_registration: Activer la création de compte depuis l'API
39store_article_headers: Activer le stockage des en-têtes HTTP de chaque article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml
index dd4def4b..ade6f7da 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml
@@ -12,6 +12,8 @@ export_xml: Abilita esportazione XML
12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13# import_with_redis: Enable Redis to import data asynchronously 13# import_with_redis: Enable Redis to import data asynchronously
14shaarli_url: Shaarli URL, se il servizio è abilitato 14shaarli_url: Shaarli URL, se il servizio è abilitato
15scuttle_url: Scuttle URL, se il servizio è abilitato
16unmark_url: Unmark URL, se il servizio è abilitato
15share_diaspora: Abilita la condivisione con Diaspora 17share_diaspora: Abilita la condivisione con Diaspora
16share_mail: Abilita la condivisione per email 18share_mail: Abilita la condivisione per email
17share_shaarli: Abilita la condivisione con Shaarli 19share_shaarli: Abilita la condivisione con Shaarli
@@ -34,3 +36,4 @@ demo_mode_username: "Utente Demo"
34# download_images_enabled: Download images locally 36# download_images_enabled: Download images locally
35# restricted_access: Enable authentication for websites with paywall 37# restricted_access: Enable authentication for websites with paywall
36api_user_registration: Abilita la registrazione dell'utente attraverso l'API 38api_user_registration: Abilita la registrazione dell'utente attraverso l'API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml
index fb163ce7..99986642 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml
@@ -12,6 +12,8 @@ export_xml: Activar l'expòrt XML
12import_with_rabbitmq: Activar RabbitMQ per importar de donadas de manièra asincròna 12import_with_rabbitmq: Activar RabbitMQ per importar de donadas de manièra asincròna
13import_with_redis: Activar Redis per importar de donadas de manièra asincròna 13import_with_redis: Activar Redis per importar de donadas de manièra asincròna
14shaarli_url: URL de Shaarli, se lo servici Shaarli es activat 14shaarli_url: URL de Shaarli, se lo servici Shaarli es activat
15scuttle_url: URL de Scuttle, se lo servici Scuttle es activat
16unmark_url: URL de Unmark, se lo servici Scuttle es activat
15share_diaspora: Activar lo partatge cap a Diaspora* 17share_diaspora: Activar lo partatge cap a Diaspora*
16share_mail: Activar lo partatge per corrièl 18share_mail: Activar lo partatge per corrièl
17share_shaarli: Activar lo partatge cap a Shaarli 19share_shaarli: Activar lo partatge cap a Shaarli
@@ -34,3 +36,4 @@ share_public: Autorizar una URL publica pels articles
34download_images_enabled: Telecargar los imatges en local 36download_images_enabled: Telecargar los imatges en local
35restricted_access: Activar l'autenticacion pels sites amb peatge 37restricted_access: Activar l'autenticacion pels sites amb peatge
36api_user_registration: Autorizar los utilizaires a se marcar amb l'API 38api_user_registration: Autorizar los utilizaires a se marcar amb l'API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml
index 04ad4fd3..8b8f2ebd 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml
@@ -12,6 +12,7 @@ export_xml: Włącz eksport do XML
12import_with_rabbitmq: Włącz RabbitMQ dla asynchronicznego importu danych 12import_with_rabbitmq: Włącz RabbitMQ dla asynchronicznego importu danych
13import_with_redis: Włącz Redis dla asynchronicznego importu danych 13import_with_redis: Włącz Redis dla asynchronicznego importu danych
14shaarli_url: Adress URL Shaarli, jeżeli usługa jest włączona 14shaarli_url: Adress URL Shaarli, jeżeli usługa jest włączona
15scuttle_url: Adress URL Scuttle, jeżeli usługa jest włączona
15share_diaspora: Włącz udostępnianie dla Diaspora 16share_diaspora: Włącz udostępnianie dla Diaspora
16share_mail: Włącz udostępnianie przez email 17share_mail: Włącz udostępnianie przez email
17share_shaarli: Włącz udostępnianie dla Shaarli 18share_shaarli: Włącz udostępnianie dla Shaarli
@@ -34,3 +35,4 @@ share_public: Zezwalaj na publiczny adres url dla wpisow
34download_images_enabled: Pobierz obrazy lokalnie 35download_images_enabled: Pobierz obrazy lokalnie
35restricted_access: Włącz autoryzację dla stron z paywallem 36restricted_access: Włącz autoryzację dla stron z paywallem
36api_user_registration: Włącz rejestrację użytkownika przy użyciu API 37api_user_registration: Włącz rejestrację użytkownika przy użyciu API
38# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml
index 77e22b37..76cb0174 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml
@@ -12,6 +12,8 @@ export_xml: Habilita exportação para XML
12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13# import_with_redis: Enable Redis to import data asynchronously 13# import_with_redis: Enable Redis to import data asynchronously
14shaarli_url: URL Shaarli, se o serviço está habilitado 14shaarli_url: URL Shaarli, se o serviço está habilitado
15scuttle_url: URL Scuttle, se o serviço está habilitado
16unmark_url: URL Unmark, se o serviço está habilitado
15share_diaspora: Habilitar compartilhamento para o Diaspora 17share_diaspora: Habilitar compartilhamento para o Diaspora
16share_mail: Habilitar compartilhamento por e-mail 18share_mail: Habilitar compartilhamento por e-mail
17share_shaarli: Habilitar compartilhamento para o Shaarli 19share_shaarli: Habilitar compartilhamento para o Shaarli
@@ -34,3 +36,4 @@ demo_mode_username: "Usuário demo"
34# download_images_enabled: Download images locally 36# download_images_enabled: Download images locally
35# restricted_access: Enable authentication for websites with paywall 37# restricted_access: Enable authentication for websites with paywall
36# api_user_registration: Enable user to be registered using the API 38# api_user_registration: Enable user to be registered using the API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml
index 1b4bfb5b..8300cec8 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml
@@ -12,6 +12,8 @@ export_xml: Permite exportare XML
12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13# import_with_redis: Enable Redis to import data asynchronously 13# import_with_redis: Enable Redis to import data asynchronously
14shaarli_url: Shaarli URL, dacă serviciul este permis 14shaarli_url: Shaarli URL, dacă serviciul este permis
15scuttle_url: Scuttle URL, dacă serviciul este permis
16unmark_url: Unmark URL, dacă serviciul este permis
15share_diaspora: Permite share către Diaspora 17share_diaspora: Permite share către Diaspora
16share_mail: Permite share prin email 18share_mail: Permite share prin email
17share_shaarli: Permite share către Shaarli 19share_shaarli: Permite share către Shaarli
@@ -34,3 +36,4 @@ modify_settings: "aplică"
34# download_images_enabled: Download images locally 36# download_images_enabled: Download images locally
35# restricted_access: Enable authentication for websites with paywall 37# restricted_access: Enable authentication for websites with paywall
36# api_user_registration: Enable user to be registered using the API 38# api_user_registration: Enable user to be registered using the API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml
index 37b4bbfd..8fed84ae 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ru.yml
@@ -12,6 +12,8 @@ export_xml: "Включить XML экспорт"
12import_with_rabbitmq: "Включить RabbitMQ для импорта данных(асинхронно)" 12import_with_rabbitmq: "Включить RabbitMQ для импорта данных(асинхронно)"
13import_with_redis: "Включить Redis для импорта данных(асинхронно)" 13import_with_redis: "Включить Redis для импорта данных(асинхронно)"
14shaarli_url: "Shaarli URL, если сервис включен" 14shaarli_url: "Shaarli URL, если сервис включен"
15scuttle_url: "Scuttle URL, если сервис включен"
16unmark_url: "Unmark URL, если сервис включен"
15share_diaspora: "Включить возможность поделиться в соц.сети Diaspora" 17share_diaspora: "Включить возможность поделиться в соц.сети Diaspora"
16share_mail: "Включить возможность поделиться по email" 18share_mail: "Включить возможность поделиться по email"
17share_shaarli: "Включить возможность поделиться в Shaarli" 19share_shaarli: "Включить возможность поделиться в Shaarli"
@@ -33,3 +35,5 @@ demo_mode_username: "Демо пользователь"
33share_public: "Разрешить публичные ссылки на записи" 35share_public: "Разрешить публичные ссылки на записи"
34download_images_enabled: "Скачивать изображения локально" 36download_images_enabled: "Скачивать изображения локально"
35restricted_access: "Включить авторизацию на сайте с помощью paywall" 37restricted_access: "Включить авторизацию на сайте с помощью paywall"
38# api_user_registration: Enable user to be registered using the API
39# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml
index 1579366d..b992ccc2 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml
@@ -12,6 +12,8 @@
12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously 12# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
13# import_with_redis: Enable Redis to import data asynchronously 13# import_with_redis: Enable Redis to import data asynchronously
14# shaarli_url: Shaarli URL, if the service is enabled 14# shaarli_url: Shaarli URL, if the service is enabled
15# scuttle_url: Scuttle URL, if the service is enabled
16# unmark_url: Unmark URL, if the service is enabled
15# share_diaspora: Enable share to Diaspora 17# share_diaspora: Enable share to Diaspora
16# share_mail: Enable share by email 18# share_mail: Enable share by email
17# share_shaarli: Enable share to Shaarli 19# share_shaarli: Enable share to Shaarli
@@ -35,3 +37,4 @@
35# download_images_enabled: Download images locally 37# download_images_enabled: Download images locally
36# restricted_access: Enable authentication for websites with paywall 38# restricted_access: Enable authentication for websites with paywall
37# api_user_registration: Enable user to be registered using the API 39# api_user_registration: Enable user to be registered using the API
40# store_article_headers: Enable if wallabag stores HTTP headers for each article
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml
index bbc587b0..7795bae6 100644
--- a/app/config/wallabag.yml
+++ b/app/config/wallabag.yml
@@ -153,6 +153,10 @@ wallabag_core:
153 name: api_user_registration 153 name: api_user_registration
154 value: 0 154 value: 0
155 section: api 155 section: api
156 -
157 name: store_article_headers
158 value: 0
159 section: entry
156 160
157wallabag_user: 161wallabag_user:
158 registration_enabled: "%fosuser_registration%" 162 registration_enabled: "%fosuser_registration%"
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 854acb6a..3f5e4760 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -24,8 +24,9 @@ class ContentProxy
24 protected $mimeGuesser; 24 protected $mimeGuesser;
25 protected $fetchingErrorMessage; 25 protected $fetchingErrorMessage;
26 protected $eventDispatcher; 26 protected $eventDispatcher;
27 protected $storeArticleHeaders;
27 28
28 public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage) 29 public function __construct(Graby $graby, RuleBasedTagger $tagger, ValidatorInterface $validator, LoggerInterface $logger, $fetchingErrorMessage, $storeArticleHeaders)
29 { 30 {
30 $this->graby = $graby; 31 $this->graby = $graby;
31 $this->tagger = $tagger; 32 $this->tagger = $tagger;
@@ -33,6 +34,7 @@ class ContentProxy
33 $this->logger = $logger; 34 $this->logger = $logger;
34 $this->mimeGuesser = new MimeTypeExtensionGuesser(); 35 $this->mimeGuesser = new MimeTypeExtensionGuesser();
35 $this->fetchingErrorMessage = $fetchingErrorMessage; 36 $this->fetchingErrorMessage = $fetchingErrorMessage;
37 $this->storeArticleHeaders = $storeArticleHeaders;
36 } 38 }
37 39
38 /** 40 /**
@@ -185,7 +187,7 @@ class ContentProxy
185 $entry->setPublishedBy($content['authors']); 187 $entry->setPublishedBy($content['authors']);
186 } 188 }
187 189
188 if (!empty($content['all_headers'])) { 190 if (!empty($content['all_headers']) && $this->storeArticleHeaders) {
189 $entry->setHeaders($content['all_headers']); 191 $entry->setHeaders($content['all_headers']);
190 } 192 }
191 193
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 31b16739..85306276 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -94,6 +94,7 @@ services:
94 - "@validator" 94 - "@validator"
95 - "@logger" 95 - "@logger"
96 - '%wallabag_core.fetching_error_message%' 96 - '%wallabag_core.fetching_error_message%'
97 - '@=service(''craue_config'').get(''store_article_headers'')'
97 98
98 wallabag_core.tags_assigner: 99 wallabag_core.tags_assigner:
99 class: Wallabag\CoreBundle\Helper\TagsAssigner 100 class: Wallabag\CoreBundle\Helper\TagsAssigner
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index 6e806553..2a2fd1a4 100644
--- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
@@ -137,6 +137,8 @@ class EntryControllerTest extends WallabagCoreTestCase
137 $this->logInAs('admin'); 137 $this->logInAs('admin');
138 $client = $this->getClient(); 138 $client = $this->getClient();
139 139
140 $client->getContainer()->get('craue_config')->set('store_article_headers', 1);
141
140 $crawler = $client->request('GET', '/new'); 142 $crawler = $client->request('GET', '/new');
141 143
142 $this->assertSame(200, $client->getResponse()->getStatusCode()); 144 $this->assertSame(200, $client->getResponse()->getStatusCode());
@@ -165,6 +167,7 @@ class EntryControllerTest extends WallabagCoreTestCase
165 $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s')); 167 $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s'));
166 $this->assertSame('Morgane Tual', $author[0]); 168 $this->assertSame('Morgane Tual', $author[0]);
167 $this->assertArrayHasKey('x-varnish1', $content->getHeaders()); 169 $this->assertArrayHasKey('x-varnish1', $content->getHeaders());
170 $client->getContainer()->get('craue_config')->set('store_article_headers', 0);
168 } 171 }
169 172
170 public function testPostWithMultipleAuthors() 173 public function testPostWithMultipleAuthors()
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index f94c2137..2aac8c07 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -40,7 +40,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
40 'language' => '', 40 'language' => '',
41 ]); 41 ]);
42 42
43 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 43 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
44 $entry = new Entry(new User()); 44 $entry = new Entry(new User());
45 $proxy->updateEntry($entry, 'http://user@:80'); 45 $proxy->updateEntry($entry, 'http://user@:80');
46 46
@@ -75,7 +75,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
75 'language' => '', 75 'language' => '',
76 ]); 76 ]);
77 77
78 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 78 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
79 $entry = new Entry(new User()); 79 $entry = new Entry(new User());
80 $proxy->updateEntry($entry, 'http://0.0.0.0'); 80 $proxy->updateEntry($entry, 'http://0.0.0.0');
81 81
@@ -115,7 +115,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
115 ], 115 ],
116 ]); 116 ]);
117 117
118 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 118 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
119 $entry = new Entry(new User()); 119 $entry = new Entry(new User());
120 $proxy->updateEntry($entry, 'http://domain.io'); 120 $proxy->updateEntry($entry, 'http://domain.io');
121 121
@@ -157,7 +157,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
157 ], 157 ],
158 ]); 158 ]);
159 159
160 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 160 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
161 $entry = new Entry(new User()); 161 $entry = new Entry(new User());
162 $proxy->updateEntry($entry, 'http://0.0.0.0'); 162 $proxy->updateEntry($entry, 'http://0.0.0.0');
163 163
@@ -199,7 +199,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
199 ], 199 ],
200 ]); 200 ]);
201 201
202 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 202 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
203 $entry = new Entry(new User()); 203 $entry = new Entry(new User());
204 $proxy->updateEntry($entry, 'http://0.0.0.0'); 204 $proxy->updateEntry($entry, 'http://0.0.0.0');
205 205
@@ -241,7 +241,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
241 'status' => '200', 241 'status' => '200',
242 ]); 242 ]);
243 243
244 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); 244 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage, false);
245 $entry = new Entry(new User()); 245 $entry = new Entry(new User());
246 $proxy->updateEntry($entry, 'http://0.0.0.0'); 246 $proxy->updateEntry($entry, 'http://0.0.0.0');
247 247
@@ -290,7 +290,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
290 ], 290 ],
291 ]); 291 ]);
292 292
293 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); 293 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage, false);
294 $entry = new Entry(new User()); 294 $entry = new Entry(new User());
295 $proxy->updateEntry($entry, 'http://0.0.0.0'); 295 $proxy->updateEntry($entry, 'http://0.0.0.0');
296 296
@@ -311,7 +311,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
311 $tagger->expects($this->once()) 311 $tagger->expects($this->once())
312 ->method('tag'); 312 ->method('tag');
313 313
314 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 314 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
315 $entry = new Entry(new User()); 315 $entry = new Entry(new User());
316 $proxy->updateEntry( 316 $proxy->updateEntry(
317 $entry, 317 $entry,
@@ -353,7 +353,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
353 $logHandler = new TestHandler(); 353 $logHandler = new TestHandler();
354 $logger = new Logger('test', [$logHandler]); 354 $logger = new Logger('test', [$logHandler]);
355 355
356 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage); 356 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage, false);
357 $entry = new Entry(new User()); 357 $entry = new Entry(new User());
358 $proxy->updateEntry( 358 $proxy->updateEntry(
359 $entry, 359 $entry,
@@ -388,7 +388,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
388 $handler = new TestHandler(); 388 $handler = new TestHandler();
389 $logger->pushHandler($handler); 389 $logger->pushHandler($handler);
390 390
391 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage); 391 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage, false);
392 $entry = new Entry(new User()); 392 $entry = new Entry(new User());
393 $proxy->updateEntry( 393 $proxy->updateEntry(
394 $entry, 394 $entry,
@@ -425,7 +425,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
425 ->method('tag') 425 ->method('tag')
426 ->will($this->throwException(new \Exception())); 426 ->will($this->throwException(new \Exception()));
427 427
428 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 428 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
429 $entry = new Entry(new User()); 429 $entry = new Entry(new User());
430 $proxy->updateEntry( 430 $proxy->updateEntry(
431 $entry, 431 $entry,
@@ -465,7 +465,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
465 $tagger->expects($this->once()) 465 $tagger->expects($this->once())
466 ->method('tag'); 466 ->method('tag');
467 467
468 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 468 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
469 $entry = new Entry(new User()); 469 $entry = new Entry(new User());
470 $proxy->updateEntry( 470 $proxy->updateEntry(
471 $entry, 471 $entry,
@@ -517,7 +517,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
517 'open_graph' => [], 517 'open_graph' => [],
518 ]); 518 ]);
519 519
520 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 520 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
521 $entry = new Entry(new User()); 521 $entry = new Entry(new User());
522 $proxy->updateEntry($entry, 'http://0.0.0.0'); 522 $proxy->updateEntry($entry, 'http://0.0.0.0');
523 523