aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.travis.yml8
-rw-r--r--Capfile15
-rw-r--r--Gemfile6
-rw-r--r--Gemfile.lock37
-rw-r--r--app/config/capistrano/deploy.rb19
-rw-r--r--app/config/capistrano/deploy/production.rb0
-rw-r--r--app/config/capistrano/deploy/staging.rb2
-rw-r--r--composer.lock141
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php12
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig19
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig19
-rw-r--r--tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php63
12 files changed, 176 insertions, 165 deletions
diff --git a/.travis.yml b/.travis.yml
index 229e3e0e..c09bcd22 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,12 +16,15 @@ cache:
16 - $HOME/.npm 16 - $HOME/.npm
17 - $HOME/.yarn-cache 17 - $HOME/.yarn-cache
18 18
19if: |
20 type = pull_request OR \
21 branch = master
22
19php: 23php:
20 - 7.1 24 - 7.1
21 - 7.2 25 - 7.2
22 - 7.3 26 - 7.3
23 - 7.4 27 - 7.4
24 - nightly
25 28
26node_js: 29node_js:
27 - "5" 30 - "5"
@@ -34,11 +37,10 @@ env:
34matrix: 37matrix:
35 fast_finish: true 38 fast_finish: true
36 include: 39 include:
37 - php: 7.2 40 - php: 7.3
38 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite 41 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite
39 allow_failures: 42 allow_failures:
40 - php: 7.4 43 - php: 7.4
41 - php: nightly
42 44
43# exclude v1 branches 45# exclude v1 branches
44branches: 46branches:
diff --git a/Capfile b/Capfile
deleted file mode 100644
index cc807112..00000000
--- a/Capfile
+++ /dev/null
@@ -1,15 +0,0 @@
1set :deploy_config_path, 'app/config/capistrano/deploy.rb'
2set :stage_config_path, 'app/config/capistrano/deploy'
3
4# Load DSL and set up stages
5require 'capistrano/setup'
6
7# Include default deployment tasks
8require 'capistrano/deploy'
9
10require 'capistrano/composer'
11require 'capistrano/file-permissions'
12require 'capistrano/symfony'
13
14# Load custom tasks from `lib/capistrano/tasks` if you have any defined
15Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
diff --git a/Gemfile b/Gemfile
deleted file mode 100644
index 233be899..00000000
--- a/Gemfile
+++ /dev/null
@@ -1,6 +0,0 @@
1source "https://rubygems.org"
2
3gem 'capistrano', '~> 3.4'
4gem 'capistrano-composer'
5gem 'capistrano-symfony', '~> 1.0.0.rc1'
6gem 'capistrano-file-permissions'
diff --git a/Gemfile.lock b/Gemfile.lock
deleted file mode 100644
index 7b13b399..00000000
--- a/Gemfile.lock
+++ /dev/null
@@ -1,37 +0,0 @@
1GEM
2 remote: https://rubygems.org/
3 specs:
4 capistrano (3.4.0)
5 i18n
6 rake (>= 10.0.0)
7 sshkit (~> 1.3)
8 capistrano-composer (0.0.6)
9 capistrano (>= 3.0.0.pre)
10 capistrano-file-permissions (1.0.0)
11 capistrano (~> 3.0)
12 capistrano-symfony (1.0.0.rc1)
13 capistrano (~> 3.1)
14 capistrano-composer (~> 0.0.3)
15 capistrano-file-permissions (~> 1.0)
16 colorize (0.7.7)
17 i18n (0.7.0)
18 net-scp (1.2.1)
19 net-ssh (>= 2.6.5)
20 net-ssh (2.9.2)
21 rake (10.4.2)
22 sshkit (1.7.1)
23 colorize (>= 0.7.0)
24 net-scp (>= 1.1.2)
25 net-ssh (>= 2.8.0)
26
27PLATFORMS
28 ruby
29
30DEPENDENCIES
31 capistrano (~> 3.4)
32 capistrano-composer
33 capistrano-file-permissions
34 capistrano-symfony (~> 1.0.0.rc1)
35
36BUNDLED WITH
37 1.13.5
diff --git a/app/config/capistrano/deploy.rb b/app/config/capistrano/deploy.rb
deleted file mode 100644
index fee04620..00000000
--- a/app/config/capistrano/deploy.rb
+++ /dev/null
@@ -1,19 +0,0 @@
1# config valid only for current version of Capistrano
2
3set :application, 'wallabag'
4set :repo_url, 'git@github.com:wallabag/wallabag.git'
5
6set :ssh_user, 'framasoft_bag'
7server '78.46.248.87', user: fetch(:ssh_user), roles: %w{web app db}
8
9set :format, :pretty
10set :log_level, :info
11# set :log_level, :debug
12
13set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --optimize-autoloader'
14
15set :linked_files, %w{app/config/parameters.yml}
16set :linked_dirs, [fetch(:log_path), "var/sessions", "web/uploads", "data"]
17set :keep_releases, 3
18
19after 'deploy:updated', 'symfony:cache:clear'
diff --git a/app/config/capistrano/deploy/production.rb b/app/config/capistrano/deploy/production.rb
deleted file mode 100644
index e69de29b..00000000
--- a/app/config/capistrano/deploy/production.rb
+++ /dev/null
diff --git a/app/config/capistrano/deploy/staging.rb b/app/config/capistrano/deploy/staging.rb
deleted file mode 100644
index ad899a85..00000000
--- a/app/config/capistrano/deploy/staging.rb
+++ /dev/null
@@ -1,2 +0,0 @@
1set :branch, 'master'
2set :deploy_to, '/var/www/v2.wallabag.org/web/'
diff --git a/composer.lock b/composer.lock
index 243d4ad5..e0231ac8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1918,24 +1918,24 @@
1918 }, 1918 },
1919 { 1919 {
1920 "name": "friendsofsymfony/oauth2-php", 1920 "name": "friendsofsymfony/oauth2-php",
1921 "version": "1.2.3", 1921 "version": "1.3.0",
1922 "source": { 1922 "source": {
1923 "type": "git", 1923 "type": "git",
1924 "url": "https://github.com/FriendsOfSymfony/oauth2-php.git", 1924 "url": "https://github.com/FriendsOfSymfony/oauth2-php.git",
1925 "reference": "a41fef63f81ef2ef632350a6c7dc66d15baa9240" 1925 "reference": "606b8ea1c3c927c272ac1409116332ad5a2ed94c"
1926 }, 1926 },
1927 "dist": { 1927 "dist": {
1928 "type": "zip", 1928 "type": "zip",
1929 "url": "https://api.github.com/repos/FriendsOfSymfony/oauth2-php/zipball/a41fef63f81ef2ef632350a6c7dc66d15baa9240", 1929 "url": "https://api.github.com/repos/FriendsOfSymfony/oauth2-php/zipball/606b8ea1c3c927c272ac1409116332ad5a2ed94c",
1930 "reference": "a41fef63f81ef2ef632350a6c7dc66d15baa9240", 1930 "reference": "606b8ea1c3c927c272ac1409116332ad5a2ed94c",
1931 "shasum": "" 1931 "shasum": ""
1932 }, 1932 },
1933 "require": { 1933 "require": {
1934 "php": "^5.5.9|>=7.0.8", 1934 "php": "^5.5.9|^7.0.8|^7.1.3|^7.2.5",
1935 "symfony/http-foundation": "~3.0|~4.0" 1935 "symfony/http-foundation": "~3.0|~4.0|~5.0"
1936 }, 1936 },
1937 "require-dev": { 1937 "require-dev": {
1938 "phpunit/phpunit": "~4.0" 1938 "phpunit/phpunit": "^4.8 || ^5.0"
1939 }, 1939 },
1940 "type": "library", 1940 "type": "library",
1941 "extra": { 1941 "extra": {
@@ -1946,7 +1946,10 @@
1946 "autoload": { 1946 "autoload": {
1947 "psr-4": { 1947 "psr-4": {
1948 "OAuth2\\": "lib/" 1948 "OAuth2\\": "lib/"
1949 } 1949 },
1950 "exclude-from-classmap": [
1951 "/tests/"
1952 ]
1950 }, 1953 },
1951 "notification-url": "https://packagist.org/downloads/", 1954 "notification-url": "https://packagist.org/downloads/",
1952 "license": [ 1955 "license": [
@@ -1968,7 +1971,7 @@
1968 "oauth", 1971 "oauth",
1969 "oauth2" 1972 "oauth2"
1970 ], 1973 ],
1971 "time": "2018-01-30T19:58:25+00:00" 1974 "time": "2020-03-03T22:14:46+00:00"
1972 }, 1975 },
1973 { 1976 {
1974 "name": "friendsofsymfony/rest-bundle", 1977 "name": "friendsofsymfony/rest-bundle",
@@ -3692,26 +3695,26 @@
3692 }, 3695 },
3693 { 3696 {
3694 "name": "incenteev/composer-parameter-handler", 3697 "name": "incenteev/composer-parameter-handler",
3695 "version": "v2.1.3", 3698 "version": "v2.1.4",
3696 "source": { 3699 "source": {
3697 "type": "git", 3700 "type": "git",
3698 "url": "https://github.com/Incenteev/ParameterHandler.git", 3701 "url": "https://github.com/Incenteev/ParameterHandler.git",
3699 "reference": "933c45a34814f27f2345c11c37d46b3ca7303550" 3702 "reference": "084befb11ec21faeadcddefb88b66132775ff59b"
3700 }, 3703 },
3701 "dist": { 3704 "dist": {
3702 "type": "zip", 3705 "type": "zip",
3703 "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/933c45a34814f27f2345c11c37d46b3ca7303550", 3706 "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/084befb11ec21faeadcddefb88b66132775ff59b",
3704 "reference": "933c45a34814f27f2345c11c37d46b3ca7303550", 3707 "reference": "084befb11ec21faeadcddefb88b66132775ff59b",
3705 "shasum": "" 3708 "shasum": ""
3706 }, 3709 },
3707 "require": { 3710 "require": {
3708 "php": ">=5.3.3", 3711 "php": ">=5.3.3",
3709 "symfony/yaml": "^2.3 || ^3.0 || ^4.0" 3712 "symfony/yaml": "^2.3 || ^3.0 || ^4.0 || ^5.0"
3710 }, 3713 },
3711 "require-dev": { 3714 "require-dev": {
3712 "composer/composer": "^1.0@dev", 3715 "composer/composer": "^1.0@dev",
3713 "symfony/filesystem": "^2.3 || ^3 || ^4", 3716 "symfony/filesystem": "^2.3 || ^3 || ^4 || ^5",
3714 "symfony/phpunit-bridge": "^4.0" 3717 "symfony/phpunit-bridge": "^4.0 || ^5.0"
3715 }, 3718 },
3716 "type": "library", 3719 "type": "library",
3717 "extra": { 3720 "extra": {
@@ -3739,7 +3742,7 @@
3739 "keywords": [ 3742 "keywords": [
3740 "parameters management" 3743 "parameters management"
3741 ], 3744 ],
3742 "time": "2018-02-13T18:05:56+00:00" 3745 "time": "2020-03-17T21:10:00+00:00"
3743 }, 3746 },
3744 { 3747 {
3745 "name": "j0k3r/graby", 3748 "name": "j0k3r/graby",
@@ -8314,16 +8317,16 @@
8314 }, 8317 },
8315 { 8318 {
8316 "name": "symfony/polyfill-apcu", 8319 "name": "symfony/polyfill-apcu",
8317 "version": "v1.13.1", 8320 "version": "v1.14.0",
8318 "source": { 8321 "source": {
8319 "type": "git", 8322 "type": "git",
8320 "url": "https://github.com/symfony/polyfill-apcu.git", 8323 "url": "https://github.com/symfony/polyfill-apcu.git",
8321 "reference": "a8e961c841b9ec52927a87914f8820a1ad8f8116" 8324 "reference": "f5a6efd9d9f68790120734f80f8fda972981edab"
8322 }, 8325 },
8323 "dist": { 8326 "dist": {
8324 "type": "zip", 8327 "type": "zip",
8325 "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/a8e961c841b9ec52927a87914f8820a1ad8f8116", 8328 "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/f5a6efd9d9f68790120734f80f8fda972981edab",
8326 "reference": "a8e961c841b9ec52927a87914f8820a1ad8f8116", 8329 "reference": "f5a6efd9d9f68790120734f80f8fda972981edab",
8327 "shasum": "" 8330 "shasum": ""
8328 }, 8331 },
8329 "require": { 8332 "require": {
@@ -8332,7 +8335,7 @@
8332 "type": "library", 8335 "type": "library",
8333 "extra": { 8336 "extra": {
8334 "branch-alias": { 8337 "branch-alias": {
8335 "dev-master": "1.13-dev" 8338 "dev-master": "1.14-dev"
8336 } 8339 }
8337 }, 8340 },
8338 "autoload": { 8341 "autoload": {
@@ -8366,20 +8369,20 @@
8366 "portable", 8369 "portable",
8367 "shim" 8370 "shim"
8368 ], 8371 ],
8369 "time": "2019-11-27T13:56:44+00:00" 8372 "time": "2020-01-13T11:15:53+00:00"
8370 }, 8373 },
8371 { 8374 {
8372 "name": "symfony/polyfill-ctype", 8375 "name": "symfony/polyfill-ctype",
8373 "version": "v1.13.1", 8376 "version": "v1.14.0",
8374 "source": { 8377 "source": {
8375 "type": "git", 8378 "type": "git",
8376 "url": "https://github.com/symfony/polyfill-ctype.git", 8379 "url": "https://github.com/symfony/polyfill-ctype.git",
8377 "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" 8380 "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38"
8378 }, 8381 },
8379 "dist": { 8382 "dist": {
8380 "type": "zip", 8383 "type": "zip",
8381 "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", 8384 "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38",
8382 "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", 8385 "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38",
8383 "shasum": "" 8386 "shasum": ""
8384 }, 8387 },
8385 "require": { 8388 "require": {
@@ -8391,7 +8394,7 @@
8391 "type": "library", 8394 "type": "library",
8392 "extra": { 8395 "extra": {
8393 "branch-alias": { 8396 "branch-alias": {
8394 "dev-master": "1.13-dev" 8397 "dev-master": "1.14-dev"
8395 } 8398 }
8396 }, 8399 },
8397 "autoload": { 8400 "autoload": {
@@ -8424,7 +8427,7 @@
8424 "polyfill", 8427 "polyfill",
8425 "portable" 8428 "portable"
8426 ], 8429 ],
8427 "time": "2019-11-27T13:56:44+00:00" 8430 "time": "2020-01-13T11:15:53+00:00"
8428 }, 8431 },
8429 { 8432 {
8430 "name": "symfony/polyfill-iconv", 8433 "name": "symfony/polyfill-iconv",
@@ -8487,16 +8490,16 @@
8487 }, 8490 },
8488 { 8491 {
8489 "name": "symfony/polyfill-intl-icu", 8492 "name": "symfony/polyfill-intl-icu",
8490 "version": "v1.13.1", 8493 "version": "v1.14.0",
8491 "source": { 8494 "source": {
8492 "type": "git", 8495 "type": "git",
8493 "url": "https://github.com/symfony/polyfill-intl-icu.git", 8496 "url": "https://github.com/symfony/polyfill-intl-icu.git",
8494 "reference": "b3dffd68afa61ca70f2327f2dd9bbeb6aa53d70b" 8497 "reference": "727b3bb5bfa7ca9eeb86416784cf1c08a6289b86"
8495 }, 8498 },
8496 "dist": { 8499 "dist": {
8497 "type": "zip", 8500 "type": "zip",
8498 "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/b3dffd68afa61ca70f2327f2dd9bbeb6aa53d70b", 8501 "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/727b3bb5bfa7ca9eeb86416784cf1c08a6289b86",
8499 "reference": "b3dffd68afa61ca70f2327f2dd9bbeb6aa53d70b", 8502 "reference": "727b3bb5bfa7ca9eeb86416784cf1c08a6289b86",
8500 "shasum": "" 8503 "shasum": ""
8501 }, 8504 },
8502 "require": { 8505 "require": {
@@ -8509,7 +8512,7 @@
8509 "type": "library", 8512 "type": "library",
8510 "extra": { 8513 "extra": {
8511 "branch-alias": { 8514 "branch-alias": {
8512 "dev-master": "1.13-dev" 8515 "dev-master": "1.14-dev"
8513 } 8516 }
8514 }, 8517 },
8515 "autoload": { 8518 "autoload": {
@@ -8541,7 +8544,7 @@
8541 "portable", 8544 "portable",
8542 "shim" 8545 "shim"
8543 ], 8546 ],
8544 "time": "2019-11-27T13:56:44+00:00" 8547 "time": "2020-01-13T11:15:53+00:00"
8545 }, 8548 },
8546 { 8549 {
8547 "name": "symfony/polyfill-intl-idn", 8550 "name": "symfony/polyfill-intl-idn",
@@ -8607,16 +8610,16 @@
8607 }, 8610 },
8608 { 8611 {
8609 "name": "symfony/polyfill-mbstring", 8612 "name": "symfony/polyfill-mbstring",
8610 "version": "v1.13.1", 8613 "version": "v1.14.0",
8611 "source": { 8614 "source": {
8612 "type": "git", 8615 "type": "git",
8613 "url": "https://github.com/symfony/polyfill-mbstring.git", 8616 "url": "https://github.com/symfony/polyfill-mbstring.git",
8614 "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" 8617 "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2"
8615 }, 8618 },
8616 "dist": { 8619 "dist": {
8617 "type": "zip", 8620 "type": "zip",
8618 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", 8621 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2",
8619 "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", 8622 "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2",
8620 "shasum": "" 8623 "shasum": ""
8621 }, 8624 },
8622 "require": { 8625 "require": {
@@ -8628,7 +8631,7 @@
8628 "type": "library", 8631 "type": "library",
8629 "extra": { 8632 "extra": {
8630 "branch-alias": { 8633 "branch-alias": {
8631 "dev-master": "1.13-dev" 8634 "dev-master": "1.14-dev"
8632 } 8635 }
8633 }, 8636 },
8634 "autoload": { 8637 "autoload": {
@@ -8662,20 +8665,20 @@
8662 "portable", 8665 "portable",
8663 "shim" 8666 "shim"
8664 ], 8667 ],
8665 "time": "2019-11-27T14:18:11+00:00" 8668 "time": "2020-01-13T11:15:53+00:00"
8666 }, 8669 },
8667 { 8670 {
8668 "name": "symfony/polyfill-php56", 8671 "name": "symfony/polyfill-php56",
8669 "version": "v1.13.1", 8672 "version": "v1.14.0",
8670 "source": { 8673 "source": {
8671 "type": "git", 8674 "type": "git",
8672 "url": "https://github.com/symfony/polyfill-php56.git", 8675 "url": "https://github.com/symfony/polyfill-php56.git",
8673 "reference": "53dd1cdf3cb986893ccf2b96665b25b3abb384f4" 8676 "reference": "16ec91cb06998b609501b55b7177b7d7c02badb3"
8674 }, 8677 },
8675 "dist": { 8678 "dist": {
8676 "type": "zip", 8679 "type": "zip",
8677 "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/53dd1cdf3cb986893ccf2b96665b25b3abb384f4", 8680 "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/16ec91cb06998b609501b55b7177b7d7c02badb3",
8678 "reference": "53dd1cdf3cb986893ccf2b96665b25b3abb384f4", 8681 "reference": "16ec91cb06998b609501b55b7177b7d7c02badb3",
8679 "shasum": "" 8682 "shasum": ""
8680 }, 8683 },
8681 "require": { 8684 "require": {
@@ -8685,7 +8688,7 @@
8685 "type": "library", 8688 "type": "library",
8686 "extra": { 8689 "extra": {
8687 "branch-alias": { 8690 "branch-alias": {
8688 "dev-master": "1.13-dev" 8691 "dev-master": "1.14-dev"
8689 } 8692 }
8690 }, 8693 },
8691 "autoload": { 8694 "autoload": {
@@ -8718,20 +8721,20 @@
8718 "portable", 8721 "portable",
8719 "shim" 8722 "shim"
8720 ], 8723 ],
8721 "time": "2019-11-27T13:56:44+00:00" 8724 "time": "2020-01-13T11:15:53+00:00"
8722 }, 8725 },
8723 { 8726 {
8724 "name": "symfony/polyfill-php70", 8727 "name": "symfony/polyfill-php70",
8725 "version": "v1.13.1", 8728 "version": "v1.14.0",
8726 "source": { 8729 "source": {
8727 "type": "git", 8730 "type": "git",
8728 "url": "https://github.com/symfony/polyfill-php70.git", 8731 "url": "https://github.com/symfony/polyfill-php70.git",
8729 "reference": "af23c7bb26a73b850840823662dda371484926c4" 8732 "reference": "419c4940024c30ccc033650373a1fe13890d3255"
8730 }, 8733 },
8731 "dist": { 8734 "dist": {
8732 "type": "zip", 8735 "type": "zip",
8733 "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4", 8736 "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/419c4940024c30ccc033650373a1fe13890d3255",
8734 "reference": "af23c7bb26a73b850840823662dda371484926c4", 8737 "reference": "419c4940024c30ccc033650373a1fe13890d3255",
8735 "shasum": "" 8738 "shasum": ""
8736 }, 8739 },
8737 "require": { 8740 "require": {
@@ -8741,7 +8744,7 @@
8741 "type": "library", 8744 "type": "library",
8742 "extra": { 8745 "extra": {
8743 "branch-alias": { 8746 "branch-alias": {
8744 "dev-master": "1.13-dev" 8747 "dev-master": "1.14-dev"
8745 } 8748 }
8746 }, 8749 },
8747 "autoload": { 8750 "autoload": {
@@ -8777,7 +8780,7 @@
8777 "portable", 8780 "portable",
8778 "shim" 8781 "shim"
8779 ], 8782 ],
8780 "time": "2019-11-27T13:56:44+00:00" 8783 "time": "2020-01-13T11:15:53+00:00"
8781 }, 8784 },
8782 { 8785 {
8783 "name": "symfony/polyfill-php72", 8786 "name": "symfony/polyfill-php72",
@@ -8894,16 +8897,16 @@
8894 }, 8897 },
8895 { 8898 {
8896 "name": "symfony/polyfill-util", 8899 "name": "symfony/polyfill-util",
8897 "version": "v1.13.1", 8900 "version": "v1.14.0",
8898 "source": { 8901 "source": {
8899 "type": "git", 8902 "type": "git",
8900 "url": "https://github.com/symfony/polyfill-util.git", 8903 "url": "https://github.com/symfony/polyfill-util.git",
8901 "reference": "964a67f293b66b95883a5ed918a65354fcd2258f" 8904 "reference": "ba3cfcea6d0192cae46c62041f61cbb704b526d3"
8902 }, 8905 },
8903 "dist": { 8906 "dist": {
8904 "type": "zip", 8907 "type": "zip",
8905 "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/964a67f293b66b95883a5ed918a65354fcd2258f", 8908 "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ba3cfcea6d0192cae46c62041f61cbb704b526d3",
8906 "reference": "964a67f293b66b95883a5ed918a65354fcd2258f", 8909 "reference": "ba3cfcea6d0192cae46c62041f61cbb704b526d3",
8907 "shasum": "" 8910 "shasum": ""
8908 }, 8911 },
8909 "require": { 8912 "require": {
@@ -8912,7 +8915,7 @@
8912 "type": "library", 8915 "type": "library",
8913 "extra": { 8916 "extra": {
8914 "branch-alias": { 8917 "branch-alias": {
8915 "dev-master": "1.13-dev" 8918 "dev-master": "1.14-dev"
8916 } 8919 }
8917 }, 8920 },
8918 "autoload": { 8921 "autoload": {
@@ -8942,7 +8945,7 @@
8942 "polyfill", 8945 "polyfill",
8943 "shim" 8946 "shim"
8944 ], 8947 ],
8945 "time": "2019-11-27T13:56:44+00:00" 8948 "time": "2020-01-13T11:15:53+00:00"
8946 }, 8949 },
8947 { 8950 {
8948 "name": "symfony/service-contracts", 8951 "name": "symfony/service-contracts",
@@ -9069,16 +9072,16 @@
9069 }, 9072 },
9070 { 9073 {
9071 "name": "symfony/symfony", 9074 "name": "symfony/symfony",
9072 "version": "v3.4.37", 9075 "version": "v3.4.38",
9073 "source": { 9076 "source": {
9074 "type": "git", 9077 "type": "git",
9075 "url": "https://github.com/symfony/symfony.git", 9078 "url": "https://github.com/symfony/symfony.git",
9076 "reference": "1bd873459b36cf505c7b515ba6e0e2ee40890b8a" 9079 "reference": "c5a882db43e7163114edffdf3ee2f988328fa6c4"
9077 }, 9080 },
9078 "dist": { 9081 "dist": {
9079 "type": "zip", 9082 "type": "zip",
9080 "url": "https://api.github.com/repos/symfony/symfony/zipball/1bd873459b36cf505c7b515ba6e0e2ee40890b8a", 9083 "url": "https://api.github.com/repos/symfony/symfony/zipball/c5a882db43e7163114edffdf3ee2f988328fa6c4",
9081 "reference": "1bd873459b36cf505c7b515ba6e0e2ee40890b8a", 9084 "reference": "c5a882db43e7163114edffdf3ee2f988328fa6c4",
9082 "shasum": "" 9085 "shasum": ""
9083 }, 9086 },
9084 "require": { 9087 "require": {
@@ -9221,7 +9224,7 @@
9221 "keywords": [ 9224 "keywords": [
9222 "framework" 9225 "framework"
9223 ], 9226 ],
9224 "time": "2020-01-21T12:30:09+00:00" 9227 "time": "2020-02-29T10:21:57+00:00"
9225 }, 9228 },
9226 { 9229 {
9227 "name": "true/punycode", 9230 "name": "true/punycode",
@@ -9326,16 +9329,16 @@
9326 }, 9329 },
9327 { 9330 {
9328 "name": "twig/twig", 9331 "name": "twig/twig",
9329 "version": "v2.12.3", 9332 "version": "v2.12.5",
9330 "source": { 9333 "source": {
9331 "type": "git", 9334 "type": "git",
9332 "url": "https://github.com/twigphp/Twig.git", 9335 "url": "https://github.com/twigphp/Twig.git",
9333 "reference": "97b6311585cae66a26833b14b33785f5797f7d39" 9336 "reference": "18772e0190734944277ee97a02a9a6c6555fcd94"
9334 }, 9337 },
9335 "dist": { 9338 "dist": {
9336 "type": "zip", 9339 "type": "zip",
9337 "url": "https://api.github.com/repos/twigphp/Twig/zipball/97b6311585cae66a26833b14b33785f5797f7d39", 9340 "url": "https://api.github.com/repos/twigphp/Twig/zipball/18772e0190734944277ee97a02a9a6c6555fcd94",
9338 "reference": "97b6311585cae66a26833b14b33785f5797f7d39", 9341 "reference": "18772e0190734944277ee97a02a9a6c6555fcd94",
9339 "shasum": "" 9342 "shasum": ""
9340 }, 9343 },
9341 "require": { 9344 "require": {
@@ -9387,7 +9390,7 @@
9387 "keywords": [ 9390 "keywords": [
9388 "templating" 9391 "templating"
9389 ], 9392 ],
9390 "time": "2019-12-28T07:12:03+00:00" 9393 "time": "2020-02-11T15:31:23+00:00"
9391 }, 9394 },
9392 { 9395 {
9393 "name": "wallabag/php-mobi", 9396 "name": "wallabag/php-mobi",
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index 282fd733..cec8d499 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -68,6 +68,18 @@ class ExportController extends Controller
68 ); 68 );
69 69
70 $title = 'Tag ' . $tag->getLabel(); 70 $title = 'Tag ' . $tag->getLabel();
71 } elseif ('search' === $category) {
72 $searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : '');
73 $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
74
75 $entries = $repository->getBuilderForSearchByUser(
76 $this->getUser()->getId(),
77 $searchTerm,
78 $currentRoute
79 )->getQuery()
80 ->getResult();
81
82 $title = 'Search ' . $searchTerm;
71 } else { 83 } else {
72 $entries = $repository 84 $entries = $repository
73 ->$methodBuilder($this->getUser()->getId()) 85 ->$methodBuilder($this->getUser()->getId())
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
index b747ed84..4182628f 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
@@ -96,16 +96,21 @@
96 {% if tag is defined %} 96 {% if tag is defined %}
97 {% set currentTag = tag %} 97 {% set currentTag = tag %}
98 {% endif %} 98 {% endif %}
99 {% set exportSearchTerm = null %}
100 {% if searchTerm is defined %}
101 {% set exportSearchTerm = searchTerm %}
102 {% endif %}
103 {% set previousRoute = app.request.attributes.get('currentRoute') %}
99 <h2>{{ 'entry.list.export_title'|trans }}</h2> 104 <h2>{{ 'entry.list.export_title'|trans }}</h2>
100 <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">&times;</a> 105 <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">&times;</a>
101 <ul> 106 <ul>
102 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %} 107 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">EPUB</a></li>{% endif %}
103 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag }) }}">MOBI</a></li>{% endif %} 108 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">MOBI</a></li>{% endif %}
104 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag }) }}">PDF</a></li>{% endif %} 109 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">PDF</a></li>{% endif %}
105 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag }) }}">JSON</a></li>{% endif %} 110 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">JSON</a></li>{% endif %}
106 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag }) }}">CSV</a></li>{% endif %} 111 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">CSV</a></li>{% endif %}
107 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag }) }}">TXT</a></li>{% endif %} 112 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">TXT</a></li>{% endif %}
108 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag }) }}">XML</a></li>{% endif %} 113 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">XML</a></li>{% endif %}
109 </ul> 114 </ul>
110 </aside> 115 </aside>
111 116
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index 540381b6..0cd00cfd 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -63,15 +63,20 @@
63 {% if tag is defined %} 63 {% if tag is defined %}
64 {% set currentTag = tag.slug %} 64 {% set currentTag = tag.slug %}
65 {% endif %} 65 {% endif %}
66 {% set exportSearchTerm = null %}
67 {% if searchTerm is defined %}
68 {% set exportSearchTerm = searchTerm %}
69 {% endif %}
70 {% set previousRoute = app.request.attributes.get('currentRoute') %}
66 <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4> 71 <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4>
67 <ul> 72 <ul>
68 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %} 73 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">EPUB</a></li>{% endif %}
69 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag }) }}">MOBI</a></li>{% endif %} 74 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">MOBI</a></li>{% endif %}
70 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag }) }}">PDF</a></li>{% endif %} 75 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">PDF</a></li>{% endif %}
71 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag }) }}">JSON</a></li>{% endif %} 76 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">JSON</a></li>{% endif %}
72 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag }) }}">CSV</a></li>{% endif %} 77 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">CSV</a></li>{% endif %}
73 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag }) }}">TXT</a></li>{% endif %} 78 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">TXT</a></li>{% endif %}
74 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag }) }}">XML</a></li>{% endif %} 79 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">XML</a></li>{% endif %}
75 </ul> 80 </ul>
76 </div> 81 </div>
77 82
diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php
index d7ce7c45..36822ab3 100644
--- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php
@@ -3,9 +3,13 @@
3namespace Tests\Wallabag\CoreBundle\Controller; 3namespace Tests\Wallabag\CoreBundle\Controller;
4 4
5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; 5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
6use Wallabag\CoreBundle\Entity\Entry;
6 7
7class ExportControllerTest extends WallabagCoreTestCase 8class ExportControllerTest extends WallabagCoreTestCase
8{ 9{
10 private $adminEntry;
11 private $bobEntry;
12
9 public function testLogin() 13 public function testLogin()
10 { 14 {
11 $client = $this->getClient(); 15 $client = $this->getClient();
@@ -243,6 +247,30 @@ class ExportControllerTest extends WallabagCoreTestCase
243 $this->assertContains('foo', $content[0]['tags']); 247 $this->assertContains('foo', $content[0]['tags']);
244 } 248 }
245 249
250 public function testJsonExportFromSearch()
251 {
252 $this->setUpForJsonExportFromSearch();
253
254 $this->logInAs('admin');
255 $client = $this->getClient();
256
257 ob_start();
258 $crawler = $client->request('GET', '/export/search.json?search_entry[term]=entry+search&currentRoute=homepage');
259 ob_end_clean();
260
261 $this->assertSame(200, $client->getResponse()->getStatusCode());
262
263 $headers = $client->getResponse()->headers;
264 $this->assertSame('application/json', $headers->get('content-type'));
265 $this->assertSame('attachment; filename="Search entry search articles.json"', $headers->get('content-disposition'));
266 $this->assertSame('UTF-8', $headers->get('content-transfer-encoding'));
267
268 $content = json_decode($client->getResponse()->getContent(), true);
269 $this->assertCount(1, $content);
270
271 $this->tearDownForJsonExportFromSearch();
272 }
273
246 public function testXmlExport() 274 public function testXmlExport()
247 { 275 {
248 $this->logInAs('admin'); 276 $this->logInAs('admin');
@@ -282,6 +310,41 @@ class ExportControllerTest extends WallabagCoreTestCase
282 $this->assertNotEmpty('updated_at', (string) $content->entry[0]->updated_at); 310 $this->assertNotEmpty('updated_at', (string) $content->entry[0]->updated_at);
283 } 311 }
284 312
313 private function setUpForJsonExportFromSearch()
314 {
315 $client = $this->getClient();
316 $em = $this->getEntityManager();
317
318 $userRepository = $client->getContainer()
319 ->get('wallabag_user.user_repository.test');
320
321 $user = $userRepository->findOneByUserName('admin');
322 $this->adminEntry = new Entry($user);
323 $this->adminEntry->setUrl('http://0.0.0.0/entry-search-admin');
324 $this->adminEntry->setTitle('test title entry search admin');
325 $this->adminEntry->setContent('this is my content /o/');
326 $em->persist($this->adminEntry);
327
328 $user = $userRepository->findOneByUserName('bob');
329 $this->bobEntry = new Entry($user);
330 $this->bobEntry->setUrl('http://0.0.0.0/entry-search-bob');
331 $this->bobEntry->setTitle('test title entry search bob');
332 $this->bobEntry->setContent('this is my content /o/');
333 $em->persist($this->bobEntry);
334
335 $em->flush();
336 }
337
338 private function tearDownForJsonExportFromSearch()
339 {
340 $em = $this->getEntityManager();
341
342 $em->remove($this->adminEntry);
343 $em->remove($this->bobEntry);
344
345 $em->flush();
346 }
347
285 private function getSanitizedFilename($title) 348 private function getSanitizedFilename($title)
286 { 349 {
287 return preg_replace('/[^A-Za-z0-9\- \']/', '', iconv('utf-8', 'us-ascii//TRANSLIT', $title)); 350 return preg_replace('/[^A-Za-z0-9\- \']/', '', iconv('utf-8', 'us-ascii//TRANSLIT', $title));