Compare commits

..

2 Commits
2.0.3 ... 2.0.1

Author SHA1 Message Date
7189067d38 Change Travis configuration 2016-04-11 20:23:11 +02:00
de286dc3cd Release wallabag 2.0.1 2016-04-11 20:23:11 +02:00
109 changed files with 868 additions and 1326 deletions

View File

@ -41,7 +41,8 @@ matrix:
# exclude v1 branches # exclude v1 branches
branches: branches:
except: except:
- legacy - master
- dev
before_script: before_script:
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi; - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;

View File

@ -2,38 +2,6 @@
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
## [2.0.3] - 2016-04-22
### Added
- [#1962](https://github.com/wallabag/wallabag/pull/1962) cURL examples in documentation about API (Dirk Deimeke)
### Fixed
- Forgot `composer.lock` file in 2.0.2 release so some users may encounter `Fatal error: Out of memory` error during installation
## [2.0.2] - 2016-04-21
### Added
- [#1945](https://github.com/wallabag/wallabag/pull/1945) cURL examples in documentation about API (Dirk Deimeke)
- [#1911](https://github.com/wallabag/wallabag/pull/1911) Add title hover on entry titles (Thomas Citharel)
### Changed
- [#1944](https://github.com/wallabag/wallabag/pull/1944), [#1953](https://github.com/wallabag/wallabag/pull/1953), [#1954](https://github.com/wallabag/wallabag/pull/1954) Due to branches renaming, update documentation and configuration (maxi62330, Nicolas Lœuillet)
- [#1942](https://github.com/wallabag/wallabag/pull/1942) Optimize import (Nicolas Lœuillet)
- [#1935](https://github.com/wallabag/wallabag/pull/1935) Update spanish translation (jami7)
- [#1929](https://github.com/wallabag/wallabag/pull/1929) Change guid and link in RSS feeds to give original entry URL (Nicolas Lœuillet)
- [#1918](https://github.com/wallabag/wallabag/pull/1918) Improve pagination when user has lot of entries (Nicolas Lœuillet)
- [#1916](https://github.com/wallabag/wallabag/pull/1916) Change PHP arrays and move test parameters in a separated file (Jeremy Benoist)
### Fixed
- [#1957](https://github.com/wallabag/wallabag/pull/1957) Fix translation for `Go to your account` button (Nicolas Lœuillet)
- [#1925](https://github.com/wallabag/wallabag/pull/1925) Redirect to homepage if refered is null (Nicolas Lœuillet)
- [#1912](https://github.com/wallabag/wallabag/pull/1912) Fix 500 Internal Server Error -> "Setting piwik_enabled couldn't be found" (Jeremy Benoist)
## [2.0.1] - 2016-04-11 ## [2.0.1] - 2016-04-11
### Added ### Added

View File

@ -16,7 +16,7 @@ Then you can install wallabag by executing the following commands:
``` ```
git clone https://github.com/wallabag/wallabag.git git clone https://github.com/wallabag/wallabag.git
cd wallabag cd wallabag
git checkout 2.0.3 git checkout 2.0.1
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod php bin/console wallabag:install --env=prod
php bin/console server:run --env=prod php bin/console server:run --env=prod

View File

@ -22,22 +22,19 @@ class AppKernel extends Kernel
new Nelmio\ApiDocBundle\NelmioApiDocBundle(), new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(), new Nelmio\CorsBundle\NelmioCorsBundle(),
new Liip\ThemeBundle\LiipThemeBundle(), new Liip\ThemeBundle\LiipThemeBundle(),
new Wallabag\CoreBundle\WallabagCoreBundle(),
new Wallabag\ApiBundle\WallabagApiBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(), new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(), new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(), new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(), new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
new KPhoen\RulerZBundle\KPhoenRulerZBundle(), new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Craue\ConfigBundle\CraueConfigBundle(), new Craue\ConfigBundle\CraueConfigBundle(),
new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(), new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
// wallabag bundles
new Wallabag\CoreBundle\WallabagCoreBundle(),
new Wallabag\ApiBundle\WallabagApiBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
]; ];

View File

@ -1,2 +1,2 @@
set :branch, 'master' set :branch, 'v2'
set :deploy_to, '/var/www/v2.wallabag.org/web/' set :deploy_to, '/var/www/v2.wallabag.org/web/'

View File

@ -28,7 +28,7 @@ framework:
assets: ~ assets: ~
wallabag_core: wallabag_core:
version: 2.0.3 version: 2.0.1
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages: languages:
en: 'English' en: 'English'

View File

@ -1,6 +1,5 @@
imports: imports:
- { resource: config_dev.yml } - { resource: config_dev.yml }
- { resource: parameters_test.yml }
framework: framework:
test: ~ test: ~

View File

@ -19,6 +19,14 @@ parameters:
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_ database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: 127.0.0.1
test_database_port: ~
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp mailer_transport: smtp
mailer_host: 127.0.0.1 mailer_host: 127.0.0.1
mailer_user: ~ mailer_user: ~

View File

@ -1,8 +0,0 @@
parameters:
test_database_driver: pdo_sqlite
test_database_host: 127.0.0.1
test_database_port: null
test_database_name: null
test_database_user: null
test_database_password: null
test_database_path: '%kernel.root_dir%/../data/db/wallabag_testYO.sqlite'

View File

@ -6,7 +6,7 @@ services:
filesystem_cache: filesystem_cache:
class: Doctrine\Common\Cache\FilesystemCache class: Doctrine\Common\Cache\FilesystemCache
arguments: arguments:
- "%kernel.cache_dir%/doctrine/metadata" - %kernel.cache_dir%/doctrine/metadata
twig.extension.text: twig.extension.text:
class: Twig_Extensions_Extension_Text class: Twig_Extensions_Extension_Text

View File

@ -0,0 +1,37 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag_test
test_database_user: root
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_confirmation: true
from_email: no-reply@wallabag.org

View File

@ -0,0 +1,37 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_pgsql
test_database_host: localhost
test_database_port:
test_database_name: wallabag_test
test_database_user: travis
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_confirmation: true
from_email: no-reply@wallabag.org

View File

@ -0,0 +1,37 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_confirmation: true
from_email: no-reply@wallabag.org

View File

@ -1,8 +0,0 @@
parameters:
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag_test
test_database_user: root
test_database_password: ~
test_database_path: ~

View File

@ -1,8 +0,0 @@
parameters:
test_database_driver: pdo_pgsql
test_database_host: localhost
test_database_port:
test_database_name: wallabag_test
test_database_user: travis
test_database_password: ~
test_database_path: ~

View File

@ -1,8 +0,0 @@
parameters:
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_testHU.sqlite"

View File

@ -42,8 +42,8 @@
<target name="db_mysql" description="Run test for MySQL"> <target name="db_mysql" description="Run test for MySQL">
<delete dir="${basedir}/app/config/parameters.yml"/> <delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp"> <exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/> <arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
<arg value="${basedir}/app/config/parameters_test.yml"/> <arg value="${basedir}/app/config/parameters.yml"/>
</exec> </exec>
<exec executable="php"> <exec executable="php">
@ -56,8 +56,8 @@
<target name="db_sqlite" description="Run test for SQLite"> <target name="db_sqlite" description="Run test for SQLite">
<delete dir="${basedir}/app/config/parameters.yml"/> <delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp"> <exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/> <arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
<arg value="${basedir}/app/config/parameters_test.yml"/> <arg value="${basedir}/app/config/parameters.yml"/>
</exec> </exec>
<exec executable="php"> <exec executable="php">
@ -70,8 +70,8 @@
<target name="db_pgsql" description="Run test for PostgreSQL"> <target name="db_pgsql" description="Run test for PostgreSQL">
<delete dir="${basedir}/app/config/parameters.yml"/> <delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp"> <exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/> <arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
<arg value="${basedir}/app/config/parameters_test.yml"/> <arg value="${basedir}/app/config/parameters.yml"/>
</exec> </exec>
<exec executable="php"> <exec executable="php">

View File

@ -58,6 +58,7 @@
"friendsofsymfony/rest-bundle": "~1.4", "friendsofsymfony/rest-bundle": "~1.4",
"jms/serializer-bundle": "~1.0", "jms/serializer-bundle": "~1.0",
"nelmio/api-doc-bundle": "~2.7", "nelmio/api-doc-bundle": "~2.7",
"ezyang/htmlpurifier": "~4.6",
"mgargano/simplehtmldom": "~1.5", "mgargano/simplehtmldom": "~1.5",
"tecnickcom/tcpdf": "~6.2", "tecnickcom/tcpdf": "~6.2",
"simplepie/simplepie": "~1.3.1", "simplepie/simplepie": "~1.3.1",
@ -80,8 +81,7 @@
"craue/config-bundle": "~1.4", "craue/config-bundle": "~1.4",
"mnapoli/piwik-twig-extension": "^1.0", "mnapoli/piwik-twig-extension": "^1.0",
"lexik/maintenance-bundle": "~2.1", "lexik/maintenance-bundle": "~2.1",
"ocramius/proxy-manager": "1.*", "ocramius/proxy-manager": "1.*"
"white-october/pagerfanta-bundle": "^1.0"
}, },
"require-dev": { "require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2", "doctrine/doctrine-fixtures-bundle": "~2.2",

136
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "13098bd7c43a673e99a14d6ed8148962", "hash": "ba30b73585f433f82b458cbc382ad137",
"content-hash": "ed86235df64938684b50427919c0aea7", "content-hash": "241710c2b913269e8e7dff9edb379cef",
"packages": [ "packages": [
{ {
"name": "behat/transliterator", "name": "behat/transliterator",
@ -1004,6 +1004,50 @@
], ],
"time": "2016-01-05 21:34:58" "time": "2016-01-05 21:34:58"
}, },
{
"name": "ezyang/htmlpurifier",
"version": "v4.7.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "ae1828d955112356f7677c465f94f7deb7d27a40"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/ae1828d955112356f7677c465f94f7deb7d27a40",
"reference": "ae1828d955112356f7677c465f94f7deb7d27a40",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2015-08-05 01:03:42"
},
{ {
"name": "friendsofsymfony/oauth-server-bundle", "name": "friendsofsymfony/oauth-server-bundle",
"version": "1.5.2", "version": "1.5.2",
@ -1078,16 +1122,16 @@
}, },
{ {
"name": "friendsofsymfony/oauth2-php", "name": "friendsofsymfony/oauth2-php",
"version": "1.2.1", "version": "1.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/FriendsOfSymfony/oauth2-php.git", "url": "https://github.com/FriendsOfSymfony/oauth2-php.git",
"reference": "fa2aecb1fca2a03fd5f9aca19fe9adb9dfff928c" "reference": "4ae0a2aa85566146ef6f0f7169854c49e0c9243a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/FriendsOfSymfony/oauth2-php/zipball/fa2aecb1fca2a03fd5f9aca19fe9adb9dfff928c", "url": "https://api.github.com/repos/FriendsOfSymfony/oauth2-php/zipball/4ae0a2aa85566146ef6f0f7169854c49e0c9243a",
"reference": "fa2aecb1fca2a03fd5f9aca19fe9adb9dfff928c", "reference": "4ae0a2aa85566146ef6f0f7169854c49e0c9243a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1100,7 +1144,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.2.x-dev" "dev-master": "1.1.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -1128,7 +1172,7 @@
"oauth", "oauth",
"oauth2" "oauth2"
], ],
"time": "2016-03-31 14:24:17" "time": "2015-12-21 11:32:17"
}, },
{ {
"name": "friendsofsymfony/rest-bundle", "name": "friendsofsymfony/rest-bundle",
@ -3693,16 +3737,16 @@
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "1.19.0", "version": "1.18.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Seldaek/monolog.git", "url": "https://github.com/Seldaek/monolog.git",
"reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" "reference": "064b38c16790249488e7a8b987acf1c9d7383c09"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", "url": "https://api.github.com/repos/Seldaek/monolog/zipball/064b38c16790249488e7a8b987acf1c9d7383c09",
"reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", "reference": "064b38c16790249488e7a8b987acf1c9d7383c09",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3767,7 +3811,7 @@
"logging", "logging",
"psr-3" "psr-3"
], ],
"time": "2016-04-12 18:29:35" "time": "2016-04-02 13:12:58"
}, },
{ {
"name": "neitanod/forceutf8", "name": "neitanod/forceutf8",
@ -4908,20 +4952,20 @@
}, },
{ {
"name": "symfony/monolog-bundle", "name": "symfony/monolog-bundle",
"version": "2.11.1", "version": "v2.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/monolog-bundle.git", "url": "https://github.com/symfony/monolog-bundle.git",
"reference": "e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00" "reference": "82fd8f36e2cccbe94faf237403c48052d4d4b77e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00", "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/82fd8f36e2cccbe94faf237403c48052d4d4b77e",
"reference": "e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00", "reference": "82fd8f36e2cccbe94faf237403c48052d4d4b77e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"monolog/monolog": "~1.18", "monolog/monolog": "~1.12",
"php": ">=5.3.2", "php": ">=5.3.2",
"symfony/config": "~2.3|~3.0", "symfony/config": "~2.3|~3.0",
"symfony/dependency-injection": "~2.3|~3.0", "symfony/dependency-injection": "~2.3|~3.0",
@ -4936,7 +4980,7 @@
"type": "symfony-bundle", "type": "symfony-bundle",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.x-dev" "dev-master": "2.9.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -4964,7 +5008,7 @@
"log", "log",
"logging" "logging"
], ],
"time": "2016-04-13 16:21:01" "time": "2016-03-13 15:55:56"
}, },
{ {
"name": "symfony/polyfill-intl-icu", "name": "symfony/polyfill-intl-icu",
@ -5655,58 +5699,6 @@
"homepage": "https://github.com/wallabag/phpMobi", "homepage": "https://github.com/wallabag/phpMobi",
"time": "2015-10-16 08:42:42" "time": "2015-10-16 08:42:42"
}, },
{
"name": "white-october/pagerfanta-bundle",
"version": "v1.0.6",
"source": {
"type": "git",
"url": "https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git",
"reference": "ada62843d9ba0d3aa61d0dcc7becdb25a2e2f545"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/whiteoctober/WhiteOctoberPagerfantaBundle/zipball/ada62843d9ba0d3aa61d0dcc7becdb25a2e2f545",
"reference": "ada62843d9ba0d3aa61d0dcc7becdb25a2e2f545",
"shasum": ""
},
"require": {
"pagerfanta/pagerfanta": "1.0.*",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/property-access": "~2.3|~3.0",
"symfony/twig-bundle": "~2.3|~3.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"symfony/symfony": "~2.3|~3.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"WhiteOctober\\PagerfantaBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Pablo Díez",
"email": "pablodip@gmail.com"
}
],
"description": "Bundle to use Pagerfanta with Symfony2",
"keywords": [
"page",
"paging"
],
"time": "2016-03-16 19:24:56"
},
{ {
"name": "willdurand/hateoas", "name": "willdurand/hateoas",
"version": "2.9.1", "version": "2.9.1",

View File

@ -69,12 +69,6 @@ You'll have this in return:
We'll work with the ``access_token`` value in our next calls. We'll work with the ``access_token`` value in our next calls.
cURL example:
::
curl -s "https://localhost:8000/oauth/v2/token?grant_type=password&client_id=1_3o53gl30vhgk0c8ks4cocww08o84448osgo40wgw4gwkoo8skc&client_secret=636ocbqo978ckw0gsw4gcwwocg8044sco0w8w84cws48ggogs4&username=wallabag&password=wallabag"
Getting existing entries Getting existing entries
------------------------ ------------------------
@ -126,12 +120,6 @@ returns:
The ``items`` array is empty. The ``items`` array is empty.
cURL example:
::
curl --get "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Adding your first entry Adding your first entry
----------------------- -----------------------
@ -186,12 +174,6 @@ returns
Now, if you execute the previous command (see **Get existing entries**), you'll have data. Now, if you execute the previous command (see **Get existing entries**), you'll have data.
cURL example:
::
curl "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA&url=http://www.numerama.com/tech/160115-le-pocket-libre-wallabag-fait-le-plein-de-fonctionnalites.html"
Deleting an entry Deleting an entry
----------------- -----------------
@ -245,12 +227,6 @@ returns
And if you want to list the existing entries (see **Get existing entries**), the array is empty. And if you want to list the existing entries (see **Get existing entries**), the array is empty.
cURL example:
::
curl --request DELETE "https://localhost:8000/api/entries/1.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Other methods Other methods
------------- -------------

View File

@ -12,15 +12,15 @@ Translation files
As wallabag is mainly developed by a French team, please consider that french As wallabag is mainly developed by a French team, please consider that french
translation is the most updated one and please copy it to create your own translation. translation is the most updated one and please copy it to create your own translation.
You can find translation files here: https://github.com/wallabag/wallabag/tree/master/src/Wallabag/CoreBundle/Resources/translations. You can find translation files here: https://github.com/wallabag/wallabag/tree/v2/src/Wallabag/CoreBundle/Resources/translations.
You have to create ``messages.CODE.yml``, where CODE You have to create ``messages.CODE.yml``, where CODE
is the ISO 639-1 code of your language (`see wikipedia <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__). is the ISO 639-1 code of your language (`see wikipedia <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__).
Other files to translate: Other files to translate:
- https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations. - https://github.com/wallabag/wallabag/tree/v2/app/Resources/CraueConfigBundle/translations.
- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations. - https://github.com/wallabag/wallabag/tree/v2/app/Resources/FOSUserBundle/translations.
You have to create ``THE_TRANSLATION_FILE.CODE.yml`` files. You have to create ``THE_TRANSLATION_FILE.CODE.yml`` files.
@ -28,7 +28,7 @@ Configuration file
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
You have to edit `app/config/config.yml You have to edit `app/config/config.yml
<https://github.com/wallabag/wallabag/blob/master/app/config/config.yml>`__ to display <https://github.com/wallabag/wallabag/blob/v2/app/config/config.yml>`__ to display
your language on Configuration page of wallabag (to allow users to switch to this new translation). your language on Configuration page of wallabag (to allow users to switch to this new translation).
Under the ``wallabag_core.languages`` section, you have to add a new line with Under the ``wallabag_core.languages`` section, you have to add a new line with
@ -55,6 +55,6 @@ wallabag documentation
Contrary to the web application, the main language for documentation is english. Contrary to the web application, the main language for documentation is english.
Documentation files are stored here: https://github.com/wallabag/wallabag/tree/master/docs Documentation files are stored here: https://github.com/wallabag/wallabag/tree/v2/docs
You need to respect the ``en`` folder structure when you create your own translation. You need to respect the ``en`` folder structure when you create your own translation.

View File

@ -12,9 +12,9 @@ There may be several reasons:
How can I help to fix that? How can I help to fix that?
--------------------------- ---------------------------
- `by sending us an email with the article's URL <mailto:hello\@wallabag.org>`_ - `by sending us an email with the article's URL <mailto:hello@wallabag.org>`_
- by trying to fix this article by yourself :) by creating a file for the article. - by trying to fix this article by yourself :) by creating a file for the article.
You can use `this tool <http://siteconfig.fivefilters.org/>`__. You can use this tool http://siteconfig.fivefilters.org/.
How can I try to re-fetch this article? How can I try to re-fetch this article?
--------------------------------------- ---------------------------------------

View File

@ -42,7 +42,7 @@ Install Composer:
curl -s http://getcomposer.org/installer | php curl -s http://getcomposer.org/installer | php
You can find specific instructions `here <https://getcomposer.org/doc/00-intro.md>`__: You can find specific instructions here : __ https://getcomposer.org/doc/00-intro.md
To install wallabag itself, you must run these two commands: To install wallabag itself, you must run these two commands:
@ -50,7 +50,7 @@ To install wallabag itself, you must run these two commands:
git clone https://github.com/wallabag/wallabag.git git clone https://github.com/wallabag/wallabag.git
cd wallabag cd wallabag
git checkout 2.0.3 git checkout 2.0.1
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod php bin/console wallabag:install --env=prod
@ -64,7 +64,8 @@ And access wallabag at http://yourserverip:8000
.. note:: .. note::
To define parameters with environment variables, you have to set these variables with ``SYMFONY__`` prefix. For example, ``SYMFONY__DATABASE_DRIVER``. You can have a look to the `Symfony documentation <http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__. To define parameters with environment variables, you have to set these variables with ``SYMFONY__`` prefix. For example, ``SYMFONY__DATABASE_DRIVER``. You can have a look to the `Symfony documentation
<http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__.
Installing on Apache Installing on Apache
-------------------- --------------------

View File

@ -69,12 +69,6 @@ Vous obtiendrez :
Nous allons utiliser la valeur de ``access_token`` dans nos prochains appels. Nous allons utiliser la valeur de ``access_token`` dans nos prochains appels.
Exemple cURL :
::
curl -s "https://localhost:8000/oauth/v2/token?grant_type=password&client_id=1_3o53gl30vhgk0c8ks4cocww08o84448osgo40wgw4gwkoo8skc&client_secret=636ocbqo978ckw0gsw4gcwwocg8044sco0w8w84cws48ggogs4&username=wallabag&password=wallabag"
Récupérer les articles existants Récupérer les articles existants
-------------------------------- --------------------------------
@ -126,12 +120,6 @@ retournera :
Le tableau ``items`` est vide. Le tableau ``items`` est vide.
Exemple cURL :
::
curl --get "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Créer votre premier article Créer votre premier article
--------------------------- ---------------------------
@ -186,12 +174,6 @@ retournera :
Maintenant, si vous exécutez la précédente commande (voir **Récupérer les articles existants**), vous obtiendrez quelque chose. Maintenant, si vous exécutez la précédente commande (voir **Récupérer les articles existants**), vous obtiendrez quelque chose.
Exemple cURL :
::
curl "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA&url=http://www.numerama.com/tech/160115-le-pocket-libre-wallabag-fait-le-plein-de-fonctionnalites.html"
Supprimer un article Supprimer un article
-------------------- --------------------
@ -245,12 +227,6 @@ retournera :
Et si vous voulez voir la liste des articles existants (voir **Récupérer les articles existants**), le tableau sera vide. Et si vous voulez voir la liste des articles existants (voir **Récupérer les articles existants**), le tableau sera vide.
Exemple cURL :
::
curl --request DELETE "https://localhost:8000/api/entries/1.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Autres méthodes Autres méthodes
--------------- ---------------

View File

@ -13,15 +13,15 @@ Fichiers de traductions
cette traduction qui est considérée comme la plus récente. Merci de vous baser cette traduction qui est considérée comme la plus récente. Merci de vous baser
sur celle-ci pour créer votre traduction. sur celle-ci pour créer votre traduction.
Les principaux fichiers de traduction se trouvent ici : https://github.com/wallabag/wallabag/tree/master/src/Wallabag/CoreBundle/Resources/translations. Les principaux fichiers de traduction se trouvent ici : https://github.com/wallabag/wallabag/tree/v2/src/Wallabag/CoreBundle/Resources/translations.
Vous devez créer le fichier ``messages.CODE.yml``, Vous devez créer le fichier ``messages.CODE.yml``,
où CODE est le code ISO 639-1 de votre langue (`cf wikipedia <https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1>`__). où CODE est le code ISO 639-1 de votre langue (`cf wikipedia <https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1>`__).
Autres fichiers à traduire : Autres fichiers à traduire :
- https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations. - https://github.com/wallabag/wallabag/tree/v2/app/Resources/CraueConfigBundle/translations.
- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations. - https://github.com/wallabag/wallabag/tree/v2/app/Resources/FOSUserBundle/translations.
Vous devez créer les fichiers ``LE_FICHIER_DE_TRADUCTION.CODE.yml``. Vous devez créer les fichiers ``LE_FICHIER_DE_TRADUCTION.CODE.yml``.
@ -29,7 +29,7 @@ Fichier de configuration
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
Vous devez éditer `app/config/config.yml Vous devez éditer `app/config/config.yml
<https://github.com/wallabag/wallabag/blob/master/app/config/config.yml>`__ pour <https://github.com/wallabag/wallabag/blob/v2/app/config/config.yml>`__ pour
afficher votre langue dans la page Configuration de wallabag (pour permettre aux afficher votre langue dans la page Configuration de wallabag (pour permettre aux
utilisateurs de choisir cette nouvelle traduction). utilisateurs de choisir cette nouvelle traduction).
@ -57,6 +57,6 @@ Documentation de wallabag
Contrairement à l'application, la langue principale de la documentation est l'anglais Contrairement à l'application, la langue principale de la documentation est l'anglais
Les fichiers de documentation se trouvent ici : https://github.com/wallabag/wallabag/tree/master/docs Les fichiers de documentation se trouvent ici : https://github.com/wallabag/wallabag/tree/v2/docs
Vous devez respecter la structure du dossier ``en`` quand vous crééz votre traduction. Vous devez respecter la structure du dossier ``en`` quand vous crééz votre traduction.

View File

@ -12,9 +12,9 @@ Il peut y avoir plusieurs raisons :
Comment puis-je aider pour réparer ça ? Comment puis-je aider pour réparer ça ?
--------------------------------------- ---------------------------------------
- `en nous envoyant un email avec l'URL de l'article <mailto:hello\@wallabag.org>`_ - `en nous envoyant un email avec l'URL de l'article <mailto:hello@wallabag.org>`_
- en essayant de réparer cet article par vous-même :) en créant un fichier pour l'article. - en essayant de réparer cet article par vous-même :) en créant un fichier pour l'article.
Vous pouvez utiliser `cet outil <http://siteconfig.fivefilters.org/>`__. Vous pouvez utiliser cet outil http://siteconfig.fivefilters.org/.
Comment puis-je réessayer de récupérer le contenu ? Comment puis-je réessayer de récupérer le contenu ?
--------------------------------------------------- ---------------------------------------------------

View File

@ -40,7 +40,7 @@ Installation de Composer :
curl -s http://getcomposer.org/installer | php curl -s http://getcomposer.org/installer | php
Vous pouvez trouver des instructions spécifiques `ici (en anglais) <https://getcomposer.org/doc/00-intro.md>`__ : Vous pouvez trouver des instructions spécifiques ici (en anglais) : __ https://getcomposer.org/doc/00-intro.md
Pour installer wallabag, vous devez exécuter ces deux commandes : Pour installer wallabag, vous devez exécuter ces deux commandes :
@ -48,7 +48,7 @@ Pour installer wallabag, vous devez exécuter ces deux commandes :
git clone https://github.com/wallabag/wallabag.git git clone https://github.com/wallabag/wallabag.git
cd wallabag cd wallabag
git checkout 2.0.3 git checkout 2.0.1
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod php bin/console wallabag:install --env=prod
@ -61,7 +61,9 @@ Pour démarrer le serveur interne à php et vérifier que tout s'est installé c
Et accéder wallabag à l'adresse http://lipdevotreserveur:8000 Et accéder wallabag à l'adresse http://lipdevotreserveur:8000
.. note:: .. note::
Pour définir des paramètres via des variables d'environnement, vous pouvez les spécifier avec le préfixe ``SYMFONY__``. Par exemple, ``SYMFONY__DATABASE_DRIVER``. Vous pouvez lire `documentation Symfony <http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__ pour en savoir plus.
Pour définir des paramètres via des variables d'environnement, vous pouvez les spécifier avec le préfixe ``SYMFONY__``. Par exemple, ``SYMFONY__DATABASE_DRIVER``. Vous pouvez lire `documentation Symfony
<http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__ pour en savoir plus.
Installation avec Apache Installation avec Apache
------------------------ ------------------------

View File

@ -30,7 +30,7 @@ class WallabagAnnotationController extends FOSRestController
->getRepository('WallabagAnnotationBundle:Annotation') ->getRepository('WallabagAnnotationBundle:Annotation')
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId()); ->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
$total = count($annotationRows); $total = count($annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows]; $annotations = array('total' => $total, 'rows' => $annotationRows);
$json = $this->get('serializer')->serialize($annotations, 'json'); $json = $this->get('serializer')->serialize($annotations, 'json');
@ -141,6 +141,6 @@ class WallabagAnnotationController extends FOSRestController
*/ */
private function renderJsonResponse($json, $code = 200) private function renderJsonResponse($json, $code = 200)
{ {
return new Response($json, $code, ['application/json']); return new Response($json, $code, array('application/json'));
} }
} }

View File

@ -35,13 +35,13 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
->getRepository('WallabagCoreBundle:Entry') ->getRepository('WallabagCoreBundle:Entry')
->findOneByUsernameAndNotArchived('admin'); ->findOneByUsernameAndNotArchived('admin');
$headers = ['CONTENT_TYPE' => 'application/json']; $headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode([ $content = json_encode(array(
'text' => 'my annotation', 'text' => 'my annotation',
'quote' => 'my quote', 'quote' => 'my quote',
'ranges' => ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31], 'ranges' => array('start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31),
]); ));
$crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', [], [], $headers, $content); $crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', array(), array(), $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -69,11 +69,11 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$this->logInAs('admin'); $this->logInAs('admin');
$headers = ['CONTENT_TYPE' => 'application/json']; $headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode([ $content = json_encode(array(
'text' => 'a modified annotation', 'text' => 'a modified annotation',
]); ));
$crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content); $crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);
@ -99,11 +99,11 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$this->logInAs('admin'); $this->logInAs('admin');
$headers = ['CONTENT_TYPE' => 'application/json']; $headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode([ $content = json_encode(array(
'text' => 'a modified annotation', 'text' => 'a modified annotation',
]); ));
$crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content); $crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true); $content = json_decode($this->client->getResponse()->getContent(), true);

View File

@ -26,10 +26,10 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
{ {
$crawler = $this->client->request('GET', '/login'); $crawler = $this->client->request('GET', '/login');
$form = $crawler->filter('button[type=submit]')->form(); $form = $crawler->filter('button[type=submit]')->form();
$data = [ $data = array(
'_username' => $username, '_username' => $username,
'_password' => 'mypassword', '_password' => 'mypassword',
]; );
$this->client->submit($form, $data); $this->client->submit($form, $data);
} }
@ -48,7 +48,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
$loginManager = $container->get('fos_user.security.login_manager'); $loginManager = $container->get('fos_user.security.login_manager');
$firewallName = $container->getParameter('fos_user.firewall_name'); $firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(['username' => 'admin']); $this->user = $userManager->findUserBy(array('username' => 'admin'));
$loginManager->loginUser($firewallName, $this->user); $loginManager->loginUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie // save the login token into the session and put it in a cookie

View File

@ -384,6 +384,6 @@ class WallabagRestController extends FOSRestController
*/ */
private function renderJsonResponse($json) private function renderJsonResponse($json)
{ {
return new Response($json, 200, ['application/json']); return new Response($json, 200, array('application/json'));
} }
} }

View File

@ -13,7 +13,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$entry = $this->client->getContainer() $entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry') ->getRepository('WallabagCoreBundle:Entry')
->findOneBy(['user' => 1, 'isArchived' => false]); ->findOneBy(array('user' => 1, 'isArchived' => false));
if (!$entry) { if (!$entry) {
$this->markTestSkipped('No content found in db.'); $this->markTestSkipped('No content found in db.');
@ -44,7 +44,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$entry = $this->client->getContainer() $entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry') ->getRepository('WallabagCoreBundle:Entry')
->findOneBy(['user' => 2, 'isArchived' => false]); ->findOneBy(array('user' => 2, 'isArchived' => false));
if (!$entry) { if (!$entry) {
$this->markTestSkipped('No content found in db.'); $this->markTestSkipped('No content found in db.');
@ -79,7 +79,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testGetStarredEntries() public function testGetStarredEntries()
{ {
$this->client->request('GET', '/api/entries', ['star' => 1, 'sort' => 'updated']); $this->client->request('GET', '/api/entries', array('star' => 1, 'sort' => 'updated'));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -101,7 +101,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testGetArchiveEntries() public function testGetArchiveEntries()
{ {
$this->client->request('GET', '/api/entries', ['archive' => 1]); $this->client->request('GET', '/api/entries', array('archive' => 1));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -149,10 +149,10 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostEntry() public function testPostEntry()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', array(
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'tags' => 'google', 'tags' => 'google',
]); ));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -168,11 +168,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostSameEntry() public function testPostSameEntry()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', array(
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'archive' => '1', 'archive' => '1',
'tags' => 'google, apple', 'tags' => 'google, apple',
]); ));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -187,11 +187,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostArchivedAndStarredEntry() public function testPostArchivedAndStarredEntry()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', array(
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
'archive' => '1', 'archive' => '1',
'starred' => '1', 'starred' => '1',
]); ));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -206,11 +206,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostArchivedAndStarredEntryWithoutQuotes() public function testPostArchivedAndStarredEntryWithoutQuotes()
{ {
$this->client->request('POST', '/api/entries.json', [ $this->client->request('POST', '/api/entries.json', array(
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
'archive' => 0, 'archive' => 0,
'starred' => 1, 'starred' => 1,
]); ));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -236,12 +236,12 @@ class WallabagRestControllerTest extends WallabagApiTestCase
// hydrate the tags relations // hydrate the tags relations
$nbTags = count($entry->getTags()); $nbTags = count($entry->getTags());
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [ $this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
'title' => 'New awesome title', 'title' => 'New awesome title',
'tags' => 'new tag '.uniqid(), 'tags' => 'new tag '.uniqid(),
'starred' => '1', 'starred' => '1',
'archive' => '0', 'archive' => '0',
]); ));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -268,12 +268,12 @@ class WallabagRestControllerTest extends WallabagApiTestCase
// hydrate the tags relations // hydrate the tags relations
$nbTags = count($entry->getTags()); $nbTags = count($entry->getTags());
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [ $this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
'title' => 'New awesome title', 'title' => 'New awesome title',
'tags' => 'new tag '.uniqid(), 'tags' => 'new tag '.uniqid(),
'starred' => 1, 'starred' => 1,
'archive' => 0, 'archive' => 0,
]); ));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -298,9 +298,9 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$this->markTestSkipped('No content found in db.'); $this->markTestSkipped('No content found in db.');
} }
$tags = []; $tags = array();
foreach ($entry->getTags() as $tag) { foreach ($entry->getTags() as $tag) {
$tags[] = ['id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug()]; $tags[] = array('id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug());
} }
$this->client->request('GET', '/api/entries/'.$entry->getId().'/tags'); $this->client->request('GET', '/api/entries/'.$entry->getId().'/tags');
@ -323,7 +323,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$newTags = 'tag1,tag2,tag3'; $newTags = 'tag1,tag2,tag3';
$this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', ['tags' => $newTags]); $this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', array('tags' => $newTags));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode()); $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -337,7 +337,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
->getRepository('WallabagCoreBundle:Entry') ->getRepository('WallabagCoreBundle:Entry')
->find($entry->getId()); ->find($entry->getId());
$tagsInDB = []; $tagsInDB = array();
foreach ($entryDB->getTags()->toArray() as $tag) { foreach ($entryDB->getTags()->toArray() as $tag) {
$tagsInDB[$tag->getId()] = $tag->getLabel(); $tagsInDB[$tag->getId()] = $tag->getLabel();
} }

View File

@ -36,7 +36,7 @@ abstract class WallabagApiTestCase extends WebTestCase
$loginManager = $container->get('fos_user.security.login_manager'); $loginManager = $container->get('fos_user.security.login_manager');
$firewallName = $container->getParameter('fos_user.firewall_name'); $firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(['username' => 'admin']); $this->user = $userManager->findUserBy(array('username' => 'admin'));
$loginManager->loginUser($firewallName, $this->user); $loginManager->loginUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie // save the login token into the session and put it in a cookie

View File

@ -468,7 +468,7 @@ class InstallCommand extends ContainerAwareCommand
try { try {
return in_array($databaseName, $schemaManager->listDatabases()); return in_array($databaseName, $schemaManager->listDatabases());
} catch (\Doctrine\DBAL\Exception\DriverException $e) { } catch (\Doctrine\DBAL\Exception\ConnectionException $e) {
// it means we weren't able to get database list, assume the database doesn't exist // it means we weren't able to get database list, assume the database doesn't exist
return false; return false;

View File

@ -32,7 +32,7 @@ class ConfigController extends Controller
$user = $this->getUser(); $user = $this->getUser();
// handle basic config detail (this form is defined as a service) // handle basic config detail (this form is defined as a service)
$configForm = $this->createForm(ConfigType::class, $config, ['action' => $this->generateUrl('config')]); $configForm = $this->createForm(ConfigType::class, $config, array('action' => $this->generateUrl('config')));
$configForm->handleRequest($request); $configForm->handleRequest($request);
if ($configForm->isValid()) { if ($configForm->isValid()) {
@ -52,7 +52,7 @@ class ConfigController extends Controller
} }
// handle changing password // handle changing password
$pwdForm = $this->createForm(ChangePasswordType::class, null, ['action' => $this->generateUrl('config').'#set4']); $pwdForm = $this->createForm(ChangePasswordType::class, null, array('action' => $this->generateUrl('config').'#set4'));
$pwdForm->handleRequest($request); $pwdForm->handleRequest($request);
if ($pwdForm->isValid()) { if ($pwdForm->isValid()) {
@ -71,10 +71,10 @@ class ConfigController extends Controller
} }
// handle changing user information // handle changing user information
$userForm = $this->createForm(UserInformationType::class, $user, [ $userForm = $this->createForm(UserInformationType::class, $user, array(
'validation_groups' => ['Profile'], 'validation_groups' => array('Profile'),
'action' => $this->generateUrl('config').'#set3', 'action' => $this->generateUrl('config').'#set3',
]); ));
$userForm->handleRequest($request); $userForm->handleRequest($request);
if ($userForm->isValid()) { if ($userForm->isValid()) {
@ -89,7 +89,7 @@ class ConfigController extends Controller
} }
// handle rss information // handle rss information
$rssForm = $this->createForm(RssType::class, $config, ['action' => $this->generateUrl('config').'#set2']); $rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2'));
$rssForm->handleRequest($request); $rssForm->handleRequest($request);
if ($rssForm->isValid()) { if ($rssForm->isValid()) {
@ -106,7 +106,7 @@ class ConfigController extends Controller
// handle tagging rule // handle tagging rule
$taggingRule = new TaggingRule(); $taggingRule = new TaggingRule();
$newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, ['action' => $this->generateUrl('config').'#set5']); $newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
$newTaggingRule->handleRequest($request); $newTaggingRule->handleRequest($request);
if ($newTaggingRule->isValid()) { if ($newTaggingRule->isValid()) {
@ -126,10 +126,10 @@ class ConfigController extends Controller
$newUser = $userManager->createUser(); $newUser = $userManager->createUser();
// enable created user by default // enable created user by default
$newUser->setEnabled(true); $newUser->setEnabled(true);
$newUserForm = $this->createForm(NewUserType::class, $newUser, [ $newUserForm = $this->createForm(NewUserType::class, $newUser, array(
'validation_groups' => ['Profile'], 'validation_groups' => array('Profile'),
'action' => $this->generateUrl('config').'#set6', 'action' => $this->generateUrl('config').'#set6',
]); ));
$newUserForm->handleRequest($request); $newUserForm->handleRequest($request);
if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) { if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
@ -147,27 +147,27 @@ class ConfigController extends Controller
$this->get('session')->getFlashBag()->add( $this->get('session')->getFlashBag()->add(
'notice', 'notice',
$this->get('translator')->trans('flashes.config.notice.user_added', ['%username%' => $newUser->getUsername()]) $this->get('translator')->trans('flashes.config.notice.user_added', array('%username%' => $newUser->getUsername()))
); );
return $this->redirect($this->generateUrl('config').'#set6'); return $this->redirect($this->generateUrl('config').'#set6');
} }
return $this->render('WallabagCoreBundle:Config:index.html.twig', [ return $this->render('WallabagCoreBundle:Config:index.html.twig', array(
'form' => [ 'form' => array(
'config' => $configForm->createView(), 'config' => $configForm->createView(),
'rss' => $rssForm->createView(), 'rss' => $rssForm->createView(),
'pwd' => $pwdForm->createView(), 'pwd' => $pwdForm->createView(),
'user' => $userForm->createView(), 'user' => $userForm->createView(),
'new_user' => $newUserForm->createView(), 'new_user' => $newUserForm->createView(),
'new_tagging_rule' => $newTaggingRule->createView(), 'new_tagging_rule' => $newTaggingRule->createView(),
], ),
'rss' => [ 'rss' => array(
'username' => $user->getUsername(), 'username' => $user->getUsername(),
'token' => $config->getRssToken(), 'token' => $config->getRssToken(),
], ),
'twofactor_auth' => $this->getParameter('twofactor_auth'), 'twofactor_auth' => $this->getParameter('twofactor_auth'),
]); ));
} }
/** /**
@ -187,7 +187,7 @@ class ConfigController extends Controller
$em->flush(); $em->flush();
if ($request->isXmlHttpRequest()) { if ($request->isXmlHttpRequest()) {
return new JsonResponse(['token' => $config->getRssToken()]); return new JsonResponse(array('token' => $config->getRssToken()));
} }
$this->get('session')->getFlashBag()->add( $this->get('session')->getFlashBag()->add(
@ -229,7 +229,7 @@ class ConfigController extends Controller
* Retrieve config for the current user. * Retrieve config for the current user.
* If no config were found, create a new one. * If no config were found, create a new one.
* *
* @return Config * @return Wallabag\CoreBundle\Entity\Config
*/ */
private function getConfig() private function getConfig()
{ {

View File

@ -21,9 +21,9 @@ class DeveloperController extends Controller
{ {
$clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findAll(); $clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findAll();
return $this->render('WallabagCoreBundle:Developer:index.html.twig', [ return $this->render('WallabagCoreBundle:Developer:index.html.twig', array(
'clients' => $clients, 'clients' => $clients,
]); ));
} }
/** /**
@ -43,7 +43,7 @@ class DeveloperController extends Controller
$clientForm->handleRequest($request); $clientForm->handleRequest($request);
if ($clientForm->isValid()) { if ($clientForm->isValid()) {
$client->setAllowedGrantTypes(['token', 'authorization_code', 'password', 'refresh_token']); $client->setAllowedGrantTypes(array('token', 'authorization_code', 'password', 'refresh_token'));
$em->persist($client); $em->persist($client);
$em->flush(); $em->flush();
@ -52,15 +52,15 @@ class DeveloperController extends Controller
'flashes.developer.notice.client_created' 'flashes.developer.notice.client_created'
); );
return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', [ return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', array(
'client_id' => $client->getPublicId(), 'client_id' => $client->getPublicId(),
'client_secret' => $client->getSecret(), 'client_secret' => $client->getSecret(),
]); ));
} }
return $this->render('WallabagCoreBundle:Developer:client.html.twig', [ return $this->render('WallabagCoreBundle:Developer:client.html.twig', array(
'form' => $clientForm->createView(), 'form' => $clientForm->createView(),
]); ));
} }
/** /**

View File

@ -54,10 +54,10 @@ class EntryController extends Controller
if (false !== $existingEntry) { if (false !== $existingEntry) {
$this->get('session')->getFlashBag()->add( $this->get('session')->getFlashBag()->add(
'notice', 'notice',
$this->get('translator')->trans('flashes.entry.notice.entry_already_saved', ['%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')]) $this->get('translator')->trans('flashes.entry.notice.entry_already_saved', array('%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')))
); );
return $this->redirect($this->generateUrl('view', ['id' => $existingEntry->getId()])); return $this->redirect($this->generateUrl('view', array('id' => $existingEntry->getId())));
} }
$this->updateEntry($entry); $this->updateEntry($entry);
@ -69,9 +69,9 @@ class EntryController extends Controller
return $this->redirect($this->generateUrl('homepage')); return $this->redirect($this->generateUrl('homepage'));
} }
return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', [ return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', array(
'form' => $form->createView(), 'form' => $form->createView(),
]); ));
} }
/** /**
@ -131,12 +131,12 @@ class EntryController extends Controller
'flashes.entry.notice.entry_updated' 'flashes.entry.notice.entry_updated'
); );
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
} }
return $this->render('WallabagCoreBundle:Entry:edit.html.twig', [ return $this->render('WallabagCoreBundle:Entry:edit.html.twig', array(
'form' => $form->createView(), 'form' => $form->createView(),
]); ));
} }
/** /**
@ -257,17 +257,17 @@ class EntryController extends Controller
$entries->setCurrentPage($page); $entries->setCurrentPage($page);
} catch (OutOfRangeCurrentPageException $e) { } catch (OutOfRangeCurrentPageException $e) {
if ($page > 1) { if ($page > 1) {
return $this->redirect($this->generateUrl($type, ['page' => $entries->getNbPages()]), 302); return $this->redirect($this->generateUrl($type, array('page' => $entries->getNbPages())), 302);
} }
} }
return $this->render( return $this->render(
'WallabagCoreBundle:Entry:entries.html.twig', 'WallabagCoreBundle:Entry:entries.html.twig',
[ array(
'form' => $form->createView(), 'form' => $form->createView(),
'entries' => $entries, 'entries' => $entries,
'currentPage' => $page, 'currentPage' => $page,
] )
); );
} }
@ -286,7 +286,7 @@ class EntryController extends Controller
return $this->render( return $this->render(
'WallabagCoreBundle:Entry:entry.html.twig', 'WallabagCoreBundle:Entry:entry.html.twig',
['entry' => $entry] array('entry' => $entry)
); );
} }
@ -314,7 +314,7 @@ class EntryController extends Controller
$message $message
); );
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
} }
/** /**
@ -344,9 +344,7 @@ class EntryController extends Controller
$message $message
); );
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); return $this->redirect($request->headers->get('referer'));
return $this->redirect($redirectUrl);
} }
/** /**
@ -376,9 +374,7 @@ class EntryController extends Controller
$message $message
); );
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); return $this->redirect($request->headers->get('referer'));
return $this->redirect($redirectUrl);
} }
/** /**
@ -398,7 +394,7 @@ class EntryController extends Controller
// to avoid redirecting to the deleted entry. Ugh. // to avoid redirecting to the deleted entry. Ugh.
$url = $this->generateUrl( $url = $this->generateUrl(
'view', 'view',
['id' => $entry->getId()], array('id' => $entry->getId()),
UrlGeneratorInterface::ABSOLUTE_URL UrlGeneratorInterface::ABSOLUTE_URL
); );
@ -412,11 +408,7 @@ class EntryController extends Controller
); );
// don't redirect user to the deleted entry // don't redirect user to the deleted entry
$to = ($url !== $request->headers->get('referer') ? $request->headers->get('referer') : null); return $this->redirect($url !== $request->headers->get('referer') ? $request->headers->get('referer') : $this->generateUrl('homepage'));
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($to);
return $this->redirect($redirectUrl);
} }
/** /**
@ -434,11 +426,11 @@ class EntryController extends Controller
/** /**
* Check for existing entry, if it exists, redirect to it with a message. * Check for existing entry, if it exists, redirect to it with a message.
* *
* @param Entry $entry * @param $entry
* *
* @return Entry|bool * @return array|bool
*/ */
private function checkIfEntryAlreadyExists(Entry $entry) private function checkIfEntryAlreadyExists($entry)
{ {
return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId()); return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
} }

View File

@ -16,15 +16,12 @@ class ExportController extends Controller
/** /**
* Gets one entry content. * Gets one entry content.
* *
* @param Entry $entry * @param Entry $entry
* @param string $format
* *
* @Route("/export/{id}.{format}", name="export_entry", requirements={ * @Route("/export/{id}.{format}", name="export_entry", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv", * "format": "epub|mobi|pdf|json|xml|txt|csv",
* "id": "\d+" * "id": "\d+"
* }) * })
*
* @return \Symfony\Component\HttpFoundation\Response
*/ */
public function downloadEntryAction(Entry $entry, $format) public function downloadEntryAction(Entry $entry, $format)
{ {
@ -41,15 +38,10 @@ class ExportController extends Controller
/** /**
* Export all entries for current user. * Export all entries for current user.
* *
* @param string $format
* @param string $category
*
* @Route("/export/{category}.{format}", name="export_entries", requirements={ * @Route("/export/{category}.{format}", name="export_entries", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv", * "format": "epub|mobi|pdf|json|xml|txt|csv",
* "category": "all|unread|starred|archive" * "category": "all|unread|starred|archive"
* }) * })
*
* @return \Symfony\Component\HttpFoundation\Response
*/ */
public function downloadEntriesAction($format, $category) public function downloadEntriesAction($format, $category)
{ {

View File

@ -87,9 +87,9 @@ class RssController extends Controller
$perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit'); $perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit');
$entries->setMaxPerPage($perPage); $entries->setMaxPerPage($perPage);
return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', [ return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
'type' => $type, 'type' => $type,
'entries' => $entries, 'entries' => $entries,
]); ));
} }
} }

View File

@ -14,7 +14,7 @@ class StaticController extends Controller
{ {
return $this->render( return $this->render(
'WallabagCoreBundle:Static:howto.html.twig', 'WallabagCoreBundle:Static:howto.html.twig',
[] array()
); );
} }
@ -25,10 +25,10 @@ class StaticController extends Controller
{ {
return $this->render( return $this->render(
'WallabagCoreBundle:Static:about.html.twig', 'WallabagCoreBundle:Static:about.html.twig',
[ array(
'version' => $this->getParameter('wallabag_core.version'), 'version' => $this->getParameter('wallabag_core.version'),
'paypal_url' => $this->getParameter('wallabag_core.paypal_url'), 'paypal_url' => $this->getParameter('wallabag_core.paypal_url'),
] )
); );
} }
@ -39,7 +39,7 @@ class StaticController extends Controller
{ {
return $this->render( return $this->render(
'WallabagCoreBundle:Static:quickstart.html.twig', 'WallabagCoreBundle:Static:quickstart.html.twig',
[] array()
); );
} }
} }

View File

@ -13,7 +13,6 @@ class TagController extends Controller
{ {
/** /**
* @param Request $request * @param Request $request
* @param Entry $entry
* *
* @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag") * @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag")
* *
@ -39,13 +38,13 @@ class TagController extends Controller
'flashes.tag.notice.tag_added' 'flashes.tag.notice.tag_added'
); );
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
} }
return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', [ return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', array(
'form' => $form->createView(), 'form' => $form->createView(),
'entry' => $entry, 'entry' => $entry,
]); ));
} }
/** /**
@ -65,9 +64,7 @@ class TagController extends Controller
} }
$em->flush(); $em->flush();
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer')); return $this->redirect($request->headers->get('referer'));
return $this->redirect($redirectUrl);
} }
/** /**
@ -85,9 +82,9 @@ class TagController extends Controller
return $this->render( return $this->render(
'WallabagCoreBundle:Tag:tags.html.twig', 'WallabagCoreBundle:Tag:tags.html.twig',
[ array(
'tags' => $tags, 'tags' => $tags,
] )
); );
} }
} }

View File

@ -16,14 +16,14 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter
{ {
$tr1 = new TaggingRule(); $tr1 = new TaggingRule();
$tr1->setRule('content matches "spurs"'); $tr1->setRule('content matches "spurs"');
$tr1->setTags(['sport']); $tr1->setTags(array('sport'));
$tr1->setConfig($this->getReference('admin-config')); $tr1->setConfig($this->getReference('admin-config'));
$manager->persist($tr1); $manager->persist($tr1);
$tr2 = new TaggingRule(); $tr2 = new TaggingRule();
$tr2->setRule('content matches "basket"'); $tr2->setRule('content matches "basket"');
$tr2->setTags(['sport']); $tr2->setTags(array('sport'));
$tr2->setConfig($this->getReference('admin-config')); $tr2->setConfig($this->getReference('admin-config'));
$manager->persist($tr2); $manager->persist($tr2);

View File

@ -36,9 +36,9 @@ class LocaleListener implements EventSubscriberInterface
public static function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return [ return array(
// must be registered before the default Locale listener // must be registered before the default Locale listener
KernelEvents::REQUEST => [['onKernelRequest', 17]], KernelEvents::REQUEST => array(array('onKernelRequest', 17)),
]; );
} }
} }

View File

@ -28,9 +28,9 @@ class RegistrationConfirmedListener implements EventSubscriberInterface
public static function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return [ return array(
FOSUserEvents::REGISTRATION_CONFIRMED => 'authenticate', FOSUserEvents::REGISTRATION_CONFIRMED => 'authenticate',
]; );
} }
public function authenticate(FilterUserResponseEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null) public function authenticate(FilterUserResponseEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)

View File

@ -15,28 +15,28 @@ class ChangePasswordType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('old_password', PasswordType::class, [ ->add('old_password', PasswordType::class, array(
'constraints' => new UserPassword(['message' => 'validator.password_wrong_value']), 'constraints' => new UserPassword(array('message' => 'validator.password_wrong_value')),
'label' => 'config.form_password.old_password_label', 'label' => 'config.form_password.old_password_label',
]) ))
->add('new_password', RepeatedType::class, [ ->add('new_password', RepeatedType::class, array(
'type' => PasswordType::class, 'type' => PasswordType::class,
'invalid_message' => 'validator.password_must_match', 'invalid_message' => 'validator.password_must_match',
'required' => true, 'required' => true,
'first_options' => ['label' => 'config.form_password.new_password_label'], 'first_options' => array('label' => 'config.form_password.new_password_label'),
'second_options' => ['label' => 'config.form_password.repeat_new_password_label'], 'second_options' => array('label' => 'config.form_password.repeat_new_password_label'),
'constraints' => [ 'constraints' => array(
new Constraints\Length([ new Constraints\Length(array(
'min' => 8, 'min' => 8,
'minMessage' => 'validator.password_too_short', 'minMessage' => 'validator.password_too_short',
]), )),
new Constraints\NotBlank(), new Constraints\NotBlank(),
], ),
'label' => 'config.form_password.new_password_label', 'label' => 'config.form_password.new_password_label',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'config.form.save', 'label' => 'config.form.save',
]) ))
; ;
} }

View File

@ -14,8 +14,8 @@ class ClientType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('redirect_uris', UrlType::class, ['required' => true, 'label' => 'developer.client.form.redirect_uris_label']) ->add('redirect_uris', UrlType::class, array('required' => true, 'label' => 'developer.client.form.redirect_uris_label'))
->add('save', SubmitType::class, ['label' => 'developer.client.form.save_label']) ->add('save', SubmitType::class, array('label' => 'developer.client.form.save_label'))
; ;
$builder->get('redirect_uris') $builder->get('redirect_uris')
@ -24,7 +24,7 @@ class ClientType extends AbstractType
return $originalUri; return $originalUri;
}, },
function ($submittedUri) { function ($submittedUri) {
return [$submittedUri]; return array($submittedUri);
} }
)) ))
; ;
@ -32,9 +32,9 @@ class ClientType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\ApiBundle\Entity\Client', 'data_class' => 'Wallabag\ApiBundle\Entity\Client',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -10,8 +10,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ConfigType extends AbstractType class ConfigType extends AbstractType
{ {
private $themes = []; private $themes = array();
private $languages = []; private $languages = array();
/** /**
* @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes) * @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
@ -30,39 +30,39 @@ class ConfigType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('theme', ChoiceType::class, [ ->add('theme', ChoiceType::class, array(
'choices' => array_flip($this->themes), 'choices' => array_flip($this->themes),
'choices_as_values' => true, 'choices_as_values' => true,
'label' => 'config.form_settings.theme_label', 'label' => 'config.form_settings.theme_label',
]) ))
->add('items_per_page', null, [ ->add('items_per_page', null, array(
'label' => 'config.form_settings.items_per_page_label', 'label' => 'config.form_settings.items_per_page_label',
]) ))
->add('reading_speed', ChoiceType::class, [ ->add('reading_speed', ChoiceType::class, array(
'label' => 'config.form_settings.reading_speed.label', 'label' => 'config.form_settings.reading_speed.label',
'choices' => [ 'choices' => array(
'config.form_settings.reading_speed.100_word' => '0.5', 'config.form_settings.reading_speed.100_word' => '0.5',
'config.form_settings.reading_speed.200_word' => '1', 'config.form_settings.reading_speed.200_word' => '1',
'config.form_settings.reading_speed.300_word' => '1.5', 'config.form_settings.reading_speed.300_word' => '1.5',
'config.form_settings.reading_speed.400_word' => '2', 'config.form_settings.reading_speed.400_word' => '2',
], ),
]) ))
->add('language', ChoiceType::class, [ ->add('language', ChoiceType::class, array(
'choices' => array_flip($this->languages), 'choices' => array_flip($this->languages),
'choices_as_values' => true, 'choices_as_values' => true,
'label' => 'config.form_settings.language_label', 'label' => 'config.form_settings.language_label',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'config.form.save', 'label' => 'config.form.save',
]) ))
; ;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Config', 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -14,30 +14,30 @@ class EditEntryType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('title', TextType::class, [ ->add('title', TextType::class, array(
'required' => true, 'required' => true,
'label' => 'entry.edit.title_label', 'label' => 'entry.edit.title_label',
]) ))
->add('is_public', CheckboxType::class, [ ->add('is_public', CheckboxType::class, array(
'required' => false, 'required' => false,
'label' => 'entry.edit.is_public_label', 'label' => 'entry.edit.is_public_label',
]) ))
->add('url', TextType::class, [ ->add('url', TextType::class, array(
'disabled' => true, 'disabled' => true,
'required' => false, 'required' => false,
'label' => 'entry.edit.url_label', 'label' => 'entry.edit.url_label',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'entry.edit.save_label', 'label' => 'entry.edit.save_label',
]) ))
; ;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Entry', 'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -34,28 +34,28 @@ class EntryFilterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('readingTime', NumberRangeFilterType::class, [ ->add('readingTime', NumberRangeFilterType::class, array(
'label' => 'entry.filters.reading_time.label', 'label' => 'entry.filters.reading_time.label',
]) ))
->add('createdAt', DateRangeFilterType::class, [ ->add('createdAt', DateRangeFilterType::class, array(
'left_date_options' => [ 'left_date_options' => array(
'attr' => [ 'attr' => array(
'placeholder' => 'dd/mm/yyyy', 'placeholder' => 'dd/mm/yyyy',
], ),
'format' => 'dd/MM/yyyy', 'format' => 'dd/MM/yyyy',
'widget' => 'single_text', 'widget' => 'single_text',
], ),
'right_date_options' => [ 'right_date_options' => array(
'attr' => [ 'attr' => array(
'placeholder' => 'dd/mm/yyyy', 'placeholder' => 'dd/mm/yyyy',
], ),
'format' => 'dd/MM/yyyy', 'format' => 'dd/MM/yyyy',
'widget' => 'single_text', 'widget' => 'single_text',
], ),
'label' => 'entry.filters.created_at.label', 'label' => 'entry.filters.created_at.label',
] )
) )
->add('domainName', TextFilterType::class, [ ->add('domainName', TextFilterType::class, array(
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
$value = $values['value']; $value = $values['value'];
if (strlen($value) <= 2 || empty($value)) { if (strlen($value) <= 2 || empty($value)) {
@ -66,14 +66,14 @@ class EntryFilterType extends AbstractType
return $filterQuery->createCondition($expression); return $filterQuery->createCondition($expression);
}, },
'label' => 'entry.filters.domain_label', 'label' => 'entry.filters.domain_label',
]) ))
->add('isArchived', CheckboxFilterType::class, [ ->add('isArchived', CheckboxFilterType::class, array(
'label' => 'entry.filters.archived_label', 'label' => 'entry.filters.archived_label',
]) ))
->add('isStarred', CheckboxFilterType::class, [ ->add('isStarred', CheckboxFilterType::class, array(
'label' => 'entry.filters.starred_label', 'label' => 'entry.filters.starred_label',
]) ))
->add('previewPicture', CheckboxFilterType::class, [ ->add('previewPicture', CheckboxFilterType::class, array(
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
if (false === $values['value']) { if (false === $values['value']) {
return; return;
@ -84,12 +84,12 @@ class EntryFilterType extends AbstractType
return $filterQuery->createCondition($expression); return $filterQuery->createCondition($expression);
}, },
'label' => 'entry.filters.preview_picture_label', 'label' => 'entry.filters.preview_picture_label',
]) ))
->add('language', ChoiceFilterType::class, [ ->add('language', ChoiceFilterType::class, array(
'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
'choices_as_values' => true, 'choices_as_values' => true,
'label' => 'entry.filters.language_label', 'label' => 'entry.filters.language_label',
]) ))
; ;
} }
@ -100,9 +100,9 @@ class EntryFilterType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'csrf_protection' => false, 'csrf_protection' => false,
'validation_groups' => ['filtering'], 'validation_groups' => array('filtering'),
]); ));
} }
} }

View File

@ -12,18 +12,18 @@ class NewEntryType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('url', UrlType::class, [ ->add('url', UrlType::class, array(
'required' => true, 'required' => true,
'label' => 'entry.new.form_new.url_label', 'label' => 'entry.new.form_new.url_label',
]) ))
; ;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Entry', 'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -12,15 +12,15 @@ class NewTagType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('label', TextType::class, ['required' => true]) ->add('label', TextType::class, array('required' => true))
; ;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Tag', 'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -17,38 +17,38 @@ class NewUserType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('username', TextType::class, [ ->add('username', TextType::class, array(
'required' => true, 'required' => true,
'label' => 'config.form_new_user.username_label', 'label' => 'config.form_new_user.username_label',
]) ))
->add('plainPassword', RepeatedType::class, [ ->add('plainPassword', RepeatedType::class, array(
'type' => PasswordType::class, 'type' => PasswordType::class,
'invalid_message' => 'validator.password_must_match', 'invalid_message' => 'validator.password_must_match',
'first_options' => ['label' => 'config.form_new_user.password_label'], 'first_options' => array('label' => 'config.form_new_user.password_label'),
'second_options' => ['label' => 'config.form_new_user.repeat_new_password_label'], 'second_options' => array('label' => 'config.form_new_user.repeat_new_password_label'),
'constraints' => [ 'constraints' => array(
new Constraints\Length([ new Constraints\Length(array(
'min' => 8, 'min' => 8,
'minMessage' => 'validator.password_too_short', 'minMessage' => 'validator.password_too_short',
]), )),
new Constraints\NotBlank(), new Constraints\NotBlank(),
], ),
'label' => 'config.form_new_user.plain_password_label', 'label' => 'config.form_new_user.plain_password_label',
]) ))
->add('email', EmailType::class, [ ->add('email', EmailType::class, array(
'label' => 'config.form_new_user.email_label', 'label' => 'config.form_new_user.email_label',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'config.form.save', 'label' => 'config.form.save',
]) ))
; ;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\UserBundle\Entity\User', 'data_class' => 'Wallabag\UserBundle\Entity\User',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -12,20 +12,20 @@ class RssType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('rss_limit', null, [ ->add('rss_limit', null, array(
'label' => 'config.form_rss.rss_limit', 'label' => 'config.form_rss.rss_limit',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'config.form.save', 'label' => 'config.form.save',
]) ))
; ;
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\Config', 'data_class' => 'Wallabag\CoreBundle\Entity\Config',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -14,19 +14,19 @@ class TaggingRuleType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('rule', TextType::class, [ ->add('rule', TextType::class, array(
'required' => true, 'required' => true,
'label' => 'config.form_rules.rule_label', 'label' => 'config.form_rules.rule_label',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'config.form.save', 'label' => 'config.form.save',
]) ))
; ;
$tagsField = $builder $tagsField = $builder
->create('tags', TextType::class, [ ->create('tags', TextType::class, array(
'label' => 'config.form_rules.tags_label', 'label' => 'config.form_rules.tags_label',
]) ))
->addModelTransformer(new StringToListTransformer(',')); ->addModelTransformer(new StringToListTransformer(','));
$builder->add($tagsField); $builder->add($tagsField);
@ -34,9 +34,9 @@ class TaggingRuleType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\CoreBundle\Entity\TaggingRule', 'data_class' => 'Wallabag\CoreBundle\Entity\TaggingRule',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -15,19 +15,19 @@ class UserInformationType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('name', TextType::class, [ ->add('name', TextType::class, array(
'label' => 'config.form_user.name_label', 'label' => 'config.form_user.name_label',
]) ))
->add('email', EmailType::class, [ ->add('email', EmailType::class, array(
'label' => 'config.form_user.email_label', 'label' => 'config.form_user.email_label',
]) ))
->add('twoFactorAuthentication', CheckboxType::class, [ ->add('twoFactorAuthentication', CheckboxType::class, array(
'required' => false, 'required' => false,
'label' => 'config.form_user.twoFactorAuthentication_label', 'label' => 'config.form_user.twoFactorAuthentication_label',
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'config.form.save', 'label' => 'config.form.save',
]) ))
->remove('username') ->remove('username')
->remove('plainPassword') ->remove('plainPassword')
; ;
@ -40,9 +40,9 @@ class UserInformationType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults(array(
'data_class' => 'Wallabag\UserBundle\Entity\User', 'data_class' => 'Wallabag\UserBundle\Entity\User',
]); ));
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -82,10 +82,10 @@ class ContentProxy
try { try {
$this->tagger->tag($entry); $this->tagger->tag($entry);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->error('Error while trying to automatically tag an entry.', [ $this->logger->error('Error while trying to automatically tag an entry.', array(
'entry_url' => $url, 'entry_url' => $url,
'error_msg' => $e->getMessage(), 'error_msg' => $e->getMessage(),
]); ));
} }
return $entry; return $entry;

View File

@ -18,10 +18,10 @@ class EntriesExport
private $wallabagUrl; private $wallabagUrl;
private $logoPath; private $logoPath;
private $title = ''; private $title = '';
private $entries = []; private $entries = array();
private $authors = ['wallabag']; private $authors = array('wallabag');
private $language = ''; private $language = '';
private $tags = []; private $tags = array();
private $footerTemplate = '<div style="text-align:center;"> private $footerTemplate = '<div style="text-align:center;">
<p>Produced by wallabag with %EXPORT_METHOD%</p> <p>Produced by wallabag with %EXPORT_METHOD%</p>
<p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p> <p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p>
@ -41,14 +41,12 @@ class EntriesExport
* Define entries. * Define entries.
* *
* @param array|Entry $entries An array of entries or one entry * @param array|Entry $entries An array of entries or one entry
*
* @return EntriesExport
*/ */
public function setEntries($entries) public function setEntries($entries)
{ {
if (!is_array($entries)) { if (!is_array($entries)) {
$this->language = $entries->getLanguage(); $this->language = $entries->getLanguage();
$entries = [$entries]; $entries = array($entries);
} }
$this->entries = $entries; $this->entries = $entries;
@ -64,8 +62,6 @@ class EntriesExport
* Sets the category of which we want to get articles, or just one entry. * Sets the category of which we want to get articles, or just one entry.
* *
* @param string $method Method to get articles * @param string $method Method to get articles
*
* @return EntriesExport
*/ */
public function updateTitle($method) public function updateTitle($method)
{ {
@ -82,8 +78,6 @@ class EntriesExport
* Sets the output format. * Sets the output format.
* *
* @param string $format * @param string $format
*
* @return Response
*/ */
public function exportAs($format) public function exportAs($format)
{ {
@ -97,8 +91,6 @@ class EntriesExport
/** /**
* Use PHPePub to dump a .epub file. * Use PHPePub to dump a .epub file.
*
* @return Response
*/ */
private function produceEpub() private function produceEpub()
{ {
@ -170,19 +162,17 @@ class EntriesExport
return Response::create( return Response::create(
$book->getBook(), $book->getBook(),
200, 200,
[ array(
'Content-Description' => 'File Transfer', 'Content-Description' => 'File Transfer',
'Content-type' => 'application/epub+zip', 'Content-type' => 'application/epub+zip',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.epub"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.epub"',
'Content-Transfer-Encoding' => 'binary', 'Content-Transfer-Encoding' => 'binary',
] )
); );
} }
/** /**
* Use PHPMobi to dump a .mobi file. * Use PHPMobi to dump a .mobi file.
*
* @return Response
*/ */
private function produceMobi() private function produceMobi()
{ {
@ -221,20 +211,18 @@ class EntriesExport
return Response::create( return Response::create(
$mobi->toString(), $mobi->toString(),
200, 200,
[ array(
'Accept-Ranges' => 'bytes', 'Accept-Ranges' => 'bytes',
'Content-Description' => 'File Transfer', 'Content-Description' => 'File Transfer',
'Content-type' => 'application/x-mobipocket-ebook', 'Content-type' => 'application/x-mobipocket-ebook',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.mobi"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.mobi"',
'Content-Transfer-Encoding' => 'binary', 'Content-Transfer-Encoding' => 'binary',
] )
); );
} }
/** /**
* Use TCPDF to dump a .pdf file. * Use TCPDF to dump a .pdf file.
*
* @return Response
*/ */
private function producePdf() private function producePdf()
{ {
@ -278,19 +266,17 @@ class EntriesExport
return Response::create( return Response::create(
$pdf->Output('', 'S'), $pdf->Output('', 'S'),
200, 200,
[ array(
'Content-Description' => 'File Transfer', 'Content-Description' => 'File Transfer',
'Content-type' => 'application/pdf', 'Content-type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.pdf"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.pdf"',
'Content-Transfer-Encoding' => 'binary', 'Content-Transfer-Encoding' => 'binary',
] )
); );
} }
/** /**
* Inspired from CsvFileDumper. * Inspired from CsvFileDumper.
*
* @return Response
*/ */
private function produceCsv() private function produceCsv()
{ {
@ -298,20 +284,20 @@ class EntriesExport
$enclosure = '"'; $enclosure = '"';
$handle = fopen('php://memory', 'rb+'); $handle = fopen('php://memory', 'rb+');
fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'], $delimiter, $enclosure); fputcsv($handle, array('Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'), $delimiter, $enclosure);
foreach ($this->entries as $entry) { foreach ($this->entries as $entry) {
fputcsv( fputcsv(
$handle, $handle,
[ array(
$entry->getTitle(), $entry->getTitle(),
$entry->getURL(), $entry->getURL(),
// remove new line to avoid crazy results // remove new line to avoid crazy results
str_replace(["\r\n", "\r", "\n"], '', $entry->getContent()), str_replace(array("\r\n", "\r", "\n"), '', $entry->getContent()),
implode(', ', $entry->getTags()->toArray()), implode(', ', $entry->getTags()->toArray()),
$entry->getMimetype(), $entry->getMimetype(),
$entry->getLanguage(), $entry->getLanguage(),
], ),
$delimiter, $delimiter,
$enclosure $enclosure
); );
@ -324,55 +310,40 @@ class EntriesExport
return Response::create( return Response::create(
$output, $output,
200, 200,
[ array(
'Content-type' => 'application/csv', 'Content-type' => 'application/csv',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.csv"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.csv"',
'Content-Transfer-Encoding' => 'UTF-8', 'Content-Transfer-Encoding' => 'UTF-8',
] )
); );
} }
/**
* Dump a JSON file.
*
* @return Response
*/
private function produceJson() private function produceJson()
{ {
return Response::create( return Response::create(
$this->prepareSerializingContent('json'), $this->prepareSerializingContent('json'),
200, 200,
[ array(
'Content-type' => 'application/json', 'Content-type' => 'application/json',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.json"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.json"',
'Content-Transfer-Encoding' => 'UTF-8', 'Content-Transfer-Encoding' => 'UTF-8',
] )
); );
} }
/**
* Dump a XML file.
*
* @return Response
*/
private function produceXml() private function produceXml()
{ {
return Response::create( return Response::create(
$this->prepareSerializingContent('xml'), $this->prepareSerializingContent('xml'),
200, 200,
[ array(
'Content-type' => 'application/xml', 'Content-type' => 'application/xml',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.xml"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.xml"',
'Content-Transfer-Encoding' => 'UTF-8', 'Content-Transfer-Encoding' => 'UTF-8',
] )
); );
} }
/**
* Dump a TXT file.
*
* @return Response
*/
private function produceTxt() private function produceTxt()
{ {
$content = ''; $content = '';
@ -385,11 +356,11 @@ class EntriesExport
return Response::create( return Response::create(
$content, $content,
200, 200,
[ array(
'Content-type' => 'text/plain', 'Content-type' => 'text/plain',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.txt"', 'Content-Disposition' => 'attachment; filename="'.$this->title.'.txt"',
'Content-Transfer-Encoding' => 'UTF-8', 'Content-Transfer-Encoding' => 'UTF-8',
] )
); );
} }
@ -407,7 +378,7 @@ class EntriesExport
return $serializer->serialize( return $serializer->serialize(
$this->entries, $this->entries,
$format, $format,
SerializationContext::create()->setGroups(['entries_for_user']) SerializationContext::create()->setGroups(array('entries_for_user'))
); );
} }

View File

@ -1,37 +0,0 @@
<?php
namespace Wallabag\CoreBundle\Helper;
use Symfony\Component\Routing\Router;
/**
* Manage redirections to avoid redirecting to empty routes.
*/
class Redirect
{
private $router;
public function __construct(Router $router)
{
$this->router = $router;
}
/**
* @param string $url URL to redirect
* @param string $fallback Fallback URL if $url is null
*
* @return string
*/
public function to($url, $fallback = '')
{
if (null !== $url) {
return $url;
}
if ('' === $fallback) {
return $this->router->generate('homepage');
}
return $fallback;
}
}

View File

@ -54,7 +54,7 @@ class RuleBasedTagger
public function tagAllForUser(User $user) public function tagAllForUser(User $user)
{ {
$rules = $this->getRulesForUser($user); $rules = $this->getRulesForUser($user);
$entries = []; $entries = array();
foreach ($rules as $rule) { foreach ($rules as $rule) {
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId()); $qb = $this->entryRepository->getBuilderForAllByUser($user->getId());

View File

@ -157,7 +157,7 @@ class EntryRepository extends EntityRepository
->getQuery() ->getQuery()
->getResult(); ->getResult();
$languages = []; $languages = array();
foreach ($results as $result) { foreach ($results as $result) {
$languages[$result['language']] = $result['language']; $languages[$result['language']] = $result['language'];
} }
@ -233,7 +233,7 @@ class EntryRepository extends EntityRepository
* @param $url * @param $url
* @param $userId * @param $userId
* *
* @return Entry|bool * @return array|bool
*/ */
public function findByUrlAndUserId($url, $userId) public function findByUrlAndUserId($url, $userId)
{ {

View File

@ -3,14 +3,14 @@ services:
class: Wallabag\CoreBundle\Helper\DetectActiveTheme class: Wallabag\CoreBundle\Helper\DetectActiveTheme
arguments: arguments:
- "@security.token_storage" - "@security.token_storage"
- "%wallabag_core.theme%" - %wallabag_core.theme%
# custom form type # custom form type
wallabag_core.form.type.config: wallabag_core.form.type.config:
class: Wallabag\CoreBundle\Form\Type\ConfigType class: Wallabag\CoreBundle\Form\Type\ConfigType
arguments: arguments:
- "%liip_theme.themes%" - %liip_theme.themes%
- "%wallabag_core.languages%" - %wallabag_core.languages%
tags: tags:
- { name: form.type } - { name: form.type }
@ -32,7 +32,7 @@ services:
wallabag_core.table_prefix_subscriber: wallabag_core.table_prefix_subscriber:
class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
arguments: arguments:
- "%database_table_prefix%" - %database_table_prefix%
tags: tags:
- { name: doctrine.event_subscriber } - { name: doctrine.event_subscriber }
@ -92,10 +92,10 @@ services:
class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener
arguments: arguments:
- "@doctrine.orm.entity_manager" - "@doctrine.orm.entity_manager"
- "%wallabag_core.theme%" - %wallabag_core.theme%
- "%wallabag_core.items_on_page%" - %wallabag_core.items_on_page%
- "%wallabag_core.rss_limit%" - %wallabag_core.rss_limit%
- "%wallabag_core.language%" - %wallabag_core.language%
tags: tags:
- { name: kernel.event_subscriber } - { name: kernel.event_subscriber }
@ -114,8 +114,3 @@ services:
class: Wallabag\CoreBundle\Operator\Doctrine\Matches class: Wallabag\CoreBundle\Operator\Doctrine\Matches
tags: tags:
- { name: rulerz.operator, executor: rulerz.executor.doctrine, operator: matches, inline: true } - { name: rulerz.operator, executor: rulerz.executor.doctrine, operator: matches, inline: true }
wallabag_core.helper.redirect:
class: Wallabag\CoreBundle\Helper\Redirect
arguments:
- "@router"

View File

@ -512,7 +512,7 @@ img.preview {
width: 50%; width: 50%;
} }
div.pagination ul { .pagination {
text-align: right; text-align: right;
margin-bottom:50px; margin-bottom:50px;
} }
@ -523,25 +523,25 @@ div.pagination ul {
color: #999; color: #999;
} }
div.pagination ul > * { .pagination > * {
display: inline-block; display: inline-block;
margin-left: 0.5em; margin-left: 0.5em;
} }
div.pagination ul a { .pagination a {
color: #999; color: #999;
text-decoration: none; text-decoration: none;
} }
div.pagination ul a:hover, div.pagination ul a:focus { .pagination a:hover, .pagination a:focus {
text-decoration: underline; text-decoration: underline;
} }
div.pagination ul .disabled { .pagination .disabled {
display: none; display: none;
} }
div.pagination ul .current { .pagination .current {
height: 25px; height: 25px;
padding: 4px 8px; padding: 4px 8px;
border: 1px solid #d5d5d5; border: 1px solid #d5d5d5;

View File

@ -80,14 +80,6 @@ main, #content, .valign-wrapper {
margin-bottom: 0; margin-bottom: 0;
} }
.pagination {
float: right;
}
.pagination ul {
margin: 0 !important;
}
.pagination li { .pagination li {
padding: 0; padding: 0;
} }
@ -98,18 +90,6 @@ main, #content, .valign-wrapper {
display: block; display: block;
} }
.pagination li.active span {
padding: 0px 10px;
height: 30px;
display: block;
color: #fff;
}
.pagination .disabled {
margin-right: 10px;
margin-left: 10px;
}
.page-footer .footer-copyright p { .page-footer .footer-copyright p {
display: inline; display: inline;
} }

View File

@ -100,7 +100,7 @@ config:
tagging_rules_definition_title: '¿Qué significa reglas de etiquetado autómaticas?' tagging_rules_definition_title: '¿Qué significa reglas de etiquetado autómaticas?'
tagging_rules_definition_description: 'Son las reglas usadas por Wallabag para etiquetar automáticamente los nuevos artículos.<br />Cada vez que un nuevo artículo sea añadido, todas las reglas de etiquetado automáticas serán usadas para etiquetarlo, ayudándole a clasificar automáticamente los artículos.' tagging_rules_definition_description: 'Son las reglas usadas por Wallabag para etiquetar automáticamente los nuevos artículos.<br />Cada vez que un nuevo artículo sea añadido, todas las reglas de etiquetado automáticas serán usadas para etiquetarlo, ayudándole a clasificar automáticamente los artículos.'
how_to_use_them_title: '¿Cómo se utilizan?' how_to_use_them_title: '¿Cómo se utilizan?'
how_to_use_them_description: 'Supongamos que quiere etiquetar nuevos artículos como « <i>lectura corta</i> » cuando el tiempo de leer sea menos de 3 minutos. <br /> En ese caso, debe poner « tiempo de leer &lt;= 3 » en el <i>Regla</i> campo y « <i>lectura corta</i> » en el <i>Etiquetas</i> campo.<br />Algunas etiquetas se pueden ser añadidas al mismo tiempo por separarlas con una coma: « <i>lectura corta, debe leer</i> »<br />Reglas complejas se pueden ser escritas por usar operadores predefinidos: si « <i>tiempo de leer &gt;= 5 Y nombre del dominio = "github.com"</i> » entonces etiquete como « <i>lectura larga, github </i> »' how_to_use_them_description: 'Supongamos que quiere etiquetar nuevos artículos como « <i>lectura corta</i> » cuando el tiempo de leer sea menos de 3 minutos. <br /> En este caso, debe poner Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »'
variables_available_title: '¿Qué variables y operadores se pueden utilizar para escribir las reglas?' variables_available_title: '¿Qué variables y operadores se pueden utilizar para escribir las reglas?'
variables_available_description: 'Las siguientes variables y operadores se pueden utilizar para crear las reglas de etiquetado automáticas:' variables_available_description: 'Las siguientes variables y operadores se pueden utilizar para crear las reglas de etiquetado automáticas:'
meaning: 'Significado' meaning: 'Significado'
@ -111,7 +111,7 @@ config:
isArchived: 'El artículo está guardado o no' isArchived: 'El artículo está guardado o no'
isStarred: 'Si el artículo es un favorito o no' isStarred: 'Si el artículo es un favorito o no'
content: "El contenido del artículo" content: "El contenido del artículo"
language: "El idioma del artículo" language: "El idoma del artículo"
mimetype: "Tipo MIME del artículo" mimetype: "Tipo MIME del artículo"
readingTime: "El tiempo estimado de lectura del artículo, en minutos" readingTime: "El tiempo estimado de lectura del artículo, en minutos"
domainName: 'El dominio del artículo' domainName: 'El dominio del artículo'
@ -123,9 +123,9 @@ config:
strictly_greater_than: 'Estrictámente mas que…' strictly_greater_than: 'Estrictámente mas que…'
equal_to: 'Egual a…' equal_to: 'Egual a…'
not_equal_to: 'Diferente de…' not_equal_to: 'Diferente de…'
or: 'Una regla U otra' or: 'Una regla O otra'
and: 'Una regla Y la otra' and: 'Una regla Y la otra'
matches: 'Pruebe si un <i>sujeto</i> corresponde a una <i>búsqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>título coincide "football"</code>' matches: 'Prueba si un <i>sujeto</i> corresponde a una <i>busqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>título coincide "football"</code>'
form_new_user: form_new_user:
username_label: 'Nombre de usuario' username_label: 'Nombre de usuario'
password_label: 'Contraseña' password_label: 'Contraseña'
@ -135,18 +135,18 @@ config:
entry: entry:
page_titles: page_titles:
unread: 'Artúclos no leídos' # unread: 'Unread entries'
starred: 'Artículos favoritos' # starred: 'Starred entries'
archived: 'Artículos archivados' # archived: 'Archived entries'
filtered: 'Artículos filtrados' # filtered: 'Filtered entries'
list: list:
number_on_the_page: '{0} No hay artículos.|{1} Hay un artículo.|]1,Inf[ Hay %count% artículos.' number_on_the_page: '{0} No hay artículos.|{1} Hay un artículo.|]1,Inf[ Hay %count% artículos.'
reading_time: 'tiempo estimado de lectura' reading_time: 'tiempo estimado de lectura'
reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min' reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min'
reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur">&lt;</small> 1 min' reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur">&lt;</small> 1 min'
original_article: 'original' original_article: 'original'
toogle_as_read: 'Marcar como leído/ no leído' toogle_as_read: 'Marcar cómo leído/ no leído'
toogle_as_star: 'Marcar como favorito/ no favorito' toogle_as_star: 'Marcar cómo favorito/ no favorito'
delete: 'Suprimir' delete: 'Suprimir'
export_title: 'Exportar' export_title: 'Exportar'
filters: filters:
@ -158,7 +158,7 @@ entry:
preview_picture_help: 'Foto de preview' preview_picture_help: 'Foto de preview'
language_label: 'Idioma' language_label: 'Idioma'
reading_time: reading_time:
label: 'Duración de lectura en minutos' label: 'Duración de lectura en minutos'
from: 'de' from: 'de'
to: 'a' to: 'a'
domain_label: 'Nombre de dominio' domain_label: 'Nombre de dominio'
@ -175,7 +175,7 @@ entry:
back_to_homepage: 'Volver' back_to_homepage: 'Volver'
set_as_read: 'Marcar como leído' set_as_read: 'Marcar como leído'
# set_as_unread: 'Mark as unread' # set_as_unread: 'Mark as unread'
set_as_favorite: 'Marcar como favorito' set_as_favorite: 'Marcar cómo favorito'
view_original_article: 'Artículo original' view_original_article: 'Artículo original'
re_fetch_content: 'Redescargar el contenido' re_fetch_content: 'Redescargar el contenido'
delete: 'Suprimir' delete: 'Suprimir'
@ -205,18 +205,18 @@ entry:
about: about:
page_title: 'Acerca de' page_title: 'Acerca de'
top_menu: top_menu:
who_behind_wallabag: 'Equipo del desarrollo de wallabag' who_behind_wallabag: 'Equipo de desarrollo de wallabag'
getting_help: 'Pedir ayuda' getting_help: 'Conseguir ayuda'
helping: 'Ayudar a wallabag' helping: 'Ayudar a wallabag'
contributors: 'Colaboradores' contributors: 'Contribuidores'
third_party: 'Librerías de terceros' third_party: 'Librerías de terceeros'
who_behind_wallabag: who_behind_wallabag:
developped_by: 'Desarrollado por' developped_by: 'Desarrollado por'
website: 'Sitio web' website: 'Sitio web'
many_contributors: 'Y muchos otros colaboradores ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">en Github</a>' many_contributors: 'Y muchos otros contribuidores ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">en Github</a>'
project_website: 'Sitio web del proyecto' project_website: 'Web del proyecto'
license: 'Licencia' license: 'Licencia'
version: 'Versión' version: 'Version'
getting_help: getting_help:
documentation: 'Documentación' documentation: 'Documentación'
bug_reports: 'Reporte de errores' bug_reports: 'Reporte de errores'
@ -227,7 +227,7 @@ about:
by_contributing_2: 'nuestras necesidades están en un ticket' by_contributing_2: 'nuestras necesidades están en un ticket'
by_paypal: 'via Paypal' by_paypal: 'via Paypal'
contributors: contributors:
description: 'Gradias a los colaboradores de la aplicación web de wallabag' description: 'Gradias a los contribuidores de la aplicación web de wallabag'
third_party: third_party:
description: 'Aquí está la lista de las dependencias utilizadas por wallabag (con sus licencias) :' description: 'Aquí está la lista de las dependencias utilizadas por wallabag (con sus licencias) :'
package: 'Paquete' package: 'Paquete'
@ -235,10 +235,10 @@ about:
howto: howto:
page_title: 'Ayuda' page_title: 'Ayuda'
page_description: 'Hay muchas maneras para guardar un artículo:' # page_description: 'There are several ways to save an article:'
top_menu: top_menu:
browser_addons: 'Extensiones de navigador' browser_addons: 'Extensiones de navigador'
mobile_apps: 'Aplicaciones para smartphone' mobile_apps: 'Applicaciones para smartphone'
bookmarklet: 'Bookmarklet' bookmarklet: 'Bookmarklet'
form: form:
description: 'Gracias a este formulario' description: 'Gracias a este formulario'
@ -249,8 +249,8 @@ howto:
android: android:
via_f_droid: 'via F-Droid' via_f_droid: 'via F-Droid'
via_google_play: 'via Google Play' via_google_play: 'via Google Play'
ios: 'por la tienda de iTunes' # ios: 'on the iTunes Store'
windows: 'por la tienda de Microsoft' # windows: 'on the Microsoft Store'
bookmarklet: bookmarklet:
description: 'Desplazar y soltar este link en la barra de marcadores :' description: 'Desplazar y soltar este link en la barra de marcadores :'

View File

@ -14,7 +14,7 @@
<ul> <ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li> <li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li> <li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li>
</ul> </ul>

View File

@ -6,10 +6,15 @@
{% block pager %} {% block pager %}
<div class="results"> <div class="results">
<div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
<div class="pagination"> <div class="pagination">
<a href="#" id="filter">{{ 'entry.filters.title'|trans }}</a> <a href="#" id="filter">{{ 'entry.filters.title'|trans }}</a>
{% if entries.getNbPages > 1 %} {% if entries is not empty %}
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li>
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
</li>
{% endfor %}
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -17,7 +22,7 @@
{% for entry in entries %} {% for entry in entries %}
<div id="entry-{{ entry.id|e }}" class="entry"> <div id="entry-{{ entry.id|e }}" class="entry">
<h2><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|raw }}</a></h2> <h2><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></h2>
{% set readingTime = entry.readingTime / app.user.config.readingSpeed %} {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
<div class="estimatedTime"> <div class="estimatedTime">

View File

@ -12,8 +12,8 @@
<item> <item>
<title><![CDATA[{{ entry.title }}]]></title> <title><![CDATA[{{ entry.title }}]]></title>
<source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source> <source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source>
<link>{{ entry.url }}</link> <link>{{ url('view', { 'id': entry.id }) }}</link>
<guid>{{ entry.url }}</guid> <guid>{{ url('view', { 'id': entry.id }) }}</guid>
<pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate> <pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate>
<description> <description>
<![CDATA[ <![CDATA[

View File

@ -25,8 +25,8 @@
<dl> <dl>
<dt>{{ 'about.getting_help.documentation'|trans }}</dt> <dt>{{ 'about.getting_help.documentation'|trans }}</dt>
<dd><a href="http://doc.wallabag.org/en/master/">english</a></dd> <dd><a href="http://doc.wallabag.org/en/v2/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/master/">français</a></dd> <dd><a href="http://doc.wallabag.org/fr/v2/">français</a></dd>
<dt>{{ 'about.getting_help.bug_reports'|trans }}</dt> <dt>{{ 'about.getting_help.bug_reports'|trans }}</dt>
<dd>{{ 'about.getting_help.support'|trans|raw }}</dd> <dd>{{ 'about.getting_help.support'|trans|raw }}</dd>
@ -67,6 +67,7 @@
<tr><td>doctrine/lexer</td><td>MIT</td></tr> <tr><td>doctrine/lexer</td><td>MIT</td></tr>
<tr><td>doctrine/migrations</td><td>LGPL-2.1</td></tr> <tr><td>doctrine/migrations</td><td>LGPL-2.1</td></tr>
<tr><td>doctrine/orm</td><td>MIT</td></tr> <tr><td>doctrine/orm</td><td>MIT</td></tr>
<tr><td>ezyang/htmlpurifier</td><td>LGPL</td></tr>
<tr><td>friendsofsymfony/oauth-server-bundle</td><td>MIT</td></tr> <tr><td>friendsofsymfony/oauth-server-bundle</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/oauth2-php</td><td>MIT</td></tr> <tr><td>friendsofsymfony/oauth2-php</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/rest-bundle</td><td>MIT</td></tr> <tr><td>friendsofsymfony/rest-bundle</td><td>MIT</td></tr>

View File

@ -48,10 +48,10 @@
<h4>{{ 'quickstart.docs.title'|trans }}</h4> <h4>{{ 'quickstart.docs.title'|trans }}</h4>
<ul> <ul>
<li><a href="http://doc.wallabag.org/en/master/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li> <li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
</ul> </ul>

View File

@ -14,7 +14,7 @@
<ul> <ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li> <li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li> <li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li>
</ul> </ul>

View File

@ -21,9 +21,13 @@
<div class="nb-results left"> <div class="nb-results left">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
</div> </div>
{% if entries.getNbPages > 1 %} <ul class="pagination right">
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} {% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
{% endif %} <li class="{{ currentPage == p ? 'active':'waves-effect'}}">
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}">{{ p }}</a>
</li>
{% endfor %}
</ul>
</div> </div>
{% endblock %} {% endblock %}
<br /> <br />
@ -44,7 +48,7 @@
<i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i> <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i>
{% endif %} {% endif %}
<span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span> <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span>
<div class="estimatedTime grey-text"> <div class="estimatedTime grey-text">
<span class="tool reading-time"> <span class="tool reading-time">

View File

@ -12,8 +12,8 @@
<item> <item>
<title><![CDATA[{{ entry.title }}]]></title> <title><![CDATA[{{ entry.title }}]]></title>
<source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source> <source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source>
<link>{{ entry.url }}</link> <link>{{ url('view', { 'id': entry.id }) }}</link>
<guid>{{ entry.url }}</guid> <guid>{{ url('view', { 'id': entry.id }) }}</guid>
<pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate> <pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate>
<description> <description>
<![CDATA[ <![CDATA[

View File

@ -34,8 +34,8 @@
<div id="set2" class="col s12"> <div id="set2" class="col s12">
<dl> <dl>
<dt>{{ 'about.getting_help.documentation'|trans }}</dt> <dt>{{ 'about.getting_help.documentation'|trans }}</dt>
<dd><a href="http://doc.wallabag.org/en/master/">english</a></dd> <dd><a href="http://doc.wallabag.org/en/v2/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/master/">français</a></dd> <dd><a href="http://doc.wallabag.org/fr/v2/">français</a></dd>
<dt>{{ 'about.getting_help.bug_reports'|trans }}</dt> <dt>{{ 'about.getting_help.bug_reports'|trans }}</dt>
<dd>{{ 'about.getting_help.support'|trans|raw }}</dd> <dd>{{ 'about.getting_help.support'|trans|raw }}</dd>
@ -76,6 +76,7 @@
<tr><td>doctrine/lexer</td><td>MIT</td></tr> <tr><td>doctrine/lexer</td><td>MIT</td></tr>
<tr><td>doctrine/migrations</td><td>LGPL-2.1</td></tr> <tr><td>doctrine/migrations</td><td>LGPL-2.1</td></tr>
<tr><td>doctrine/orm</td><td>MIT</td></tr> <tr><td>doctrine/orm</td><td>MIT</td></tr>
<tr><td>ezyang/htmlpurifier</td><td>LGPL</td></tr>
<tr><td>friendsofsymfony/oauth-server-bundle</td><td>MIT</td></tr> <tr><td>friendsofsymfony/oauth-server-bundle</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/oauth2-php</td><td>MIT</td></tr> <tr><td>friendsofsymfony/oauth2-php</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/rest-bundle</td><td>MIT</td></tr> <tr><td>friendsofsymfony/rest-bundle</td><td>MIT</td></tr>

View File

@ -53,10 +53,10 @@
<h4>{{ 'quickstart.docs.title'|trans }}</h4> <h4>{{ 'quickstart.docs.title'|trans }}</h4>
<ul> <ul>
<li><a href="http://doc.wallabag.org/en/master/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li> <li><a href="http://doc.wallabag.org/en/v2/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li> <li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
</ul> </ul>

View File

@ -27,7 +27,7 @@ class TablePrefixSubscriber implements EventSubscriber
public function getSubscribedEvents() public function getSubscribedEvents()
{ {
return ['loadClassMetadata']; return array('loadClassMetadata');
} }
public function loadClassMetadata(LoadClassMetadataEventArgs $args) public function loadClassMetadata(LoadClassMetadataEventArgs $args)

View File

@ -37,11 +37,11 @@ class InstallCommandTest extends WallabagCoreTestCase
$application = new Application(static::$kernel); $application = new Application(static::$kernel);
$application->setAutoExit(false); $application->setAutoExit(false);
$code = $application->run(new ArrayInput([ $code = $application->run(new ArrayInput(array(
'command' => 'doctrine:fixtures:load', 'command' => 'doctrine:fixtures:load',
'--no-interaction' => true, '--no-interaction' => true,
'--env' => 'test', '--env' => 'test',
]), new NullOutput()); )), new NullOutput());
} }
public function testRunInstallCommand() public function testRunInstallCommand()
@ -63,9 +63,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question'); $command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
]); ));
$this->assertContains('Checking system requirements.', $tester->getDisplay()); $this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay()); $this->assertContains('Setting up database.', $tester->getDisplay());
@ -93,10 +93,10 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question'); $command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
'--reset' => true, '--reset' => true,
]); ));
$this->assertContains('Checking system requirements.', $tester->getDisplay()); $this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay()); $this->assertContains('Setting up database.', $tester->getDisplay());
@ -116,10 +116,10 @@ class InstallCommandTest extends WallabagCoreTestCase
// drop database first, so the install command won't ask to reset things // drop database first, so the install command won't ask to reset things
$command = $application->find('doctrine:database:drop'); $command = $application->find('doctrine:database:drop');
$command->run(new ArrayInput([ $command->run(new ArrayInput(array(
'command' => 'doctrine:database:drop', 'command' => 'doctrine:database:drop',
'--force' => true, '--force' => true,
]), new NullOutput()); )), new NullOutput());
// start a new application to avoid lagging connexion to pgsql // start a new application to avoid lagging connexion to pgsql
$client = static::createClient(); $client = static::createClient();
@ -140,9 +140,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question'); $command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
]); ));
$this->assertContains('Checking system requirements.', $tester->getDisplay()); $this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay()); $this->assertContains('Setting up database.', $tester->getDisplay());
@ -178,9 +178,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question'); $command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
]); ));
$this->assertContains('Checking system requirements.', $tester->getDisplay()); $this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay()); $this->assertContains('Setting up database.', $tester->getDisplay());
@ -201,19 +201,19 @@ class InstallCommandTest extends WallabagCoreTestCase
// drop database first, so the install command won't ask to reset things // drop database first, so the install command won't ask to reset things
$command = new DropDatabaseDoctrineCommand(); $command = new DropDatabaseDoctrineCommand();
$command->setApplication($application); $command->setApplication($application);
$command->run(new ArrayInput([ $command->run(new ArrayInput(array(
'command' => 'doctrine:database:drop', 'command' => 'doctrine:database:drop',
'--force' => true, '--force' => true,
]), new NullOutput()); )), new NullOutput());
$this->getClient()->getContainer()->get('doctrine')->getConnection()->close(); $this->getClient()->getContainer()->get('doctrine')->getConnection()->close();
$command = new CreateDatabaseDoctrineCommand(); $command = new CreateDatabaseDoctrineCommand();
$command->setApplication($application); $command->setApplication($application);
$command->run(new ArrayInput([ $command->run(new ArrayInput(array(
'command' => 'doctrine:database:create', 'command' => 'doctrine:database:create',
'--env' => 'test', '--env' => 'test',
]), new NullOutput()); )), new NullOutput());
$command = $application->find('wallabag:install'); $command = $application->find('wallabag:install');
@ -233,9 +233,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question'); $command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
]); ));
$this->assertContains('Checking system requirements.', $tester->getDisplay()); $this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay()); $this->assertContains('Setting up database.', $tester->getDisplay());
@ -265,10 +265,10 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question'); $command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
'--no-interaction' => true, '--no-interaction' => true,
]); ));
$this->assertContains('Checking system requirements.', $tester->getDisplay()); $this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay()); $this->assertContains('Setting up database.', $tester->getDisplay());

View File

@ -21,9 +21,9 @@ class TagAllCommandTest extends WallabagCoreTestCase
$command = $application->find('wallabag:tag:all'); $command = $application->find('wallabag:tag:all');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
]); ));
} }
public function testRunTagAllCommandWithBadUsername() public function testRunTagAllCommandWithBadUsername()
@ -34,10 +34,10 @@ class TagAllCommandTest extends WallabagCoreTestCase
$command = $application->find('wallabag:tag:all'); $command = $application->find('wallabag:tag:all');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
'username' => 'unknown', 'username' => 'unknown',
]); ));
$this->assertContains('User "unknown" not found', $tester->getDisplay()); $this->assertContains('User "unknown" not found', $tester->getDisplay());
} }
@ -50,10 +50,10 @@ class TagAllCommandTest extends WallabagCoreTestCase
$command = $application->find('wallabag:tag:all'); $command = $application->find('wallabag:tag:all');
$tester = new CommandTester($command); $tester = new CommandTester($command);
$tester->execute([ $tester->execute(array(
'command' => $command->getName(), 'command' => $command->getName(),
'username' => 'admin', 'username' => 'admin',
]); ));
$this->assertContains('Tagging entries for user « admin »... Done', $tester->getDisplay()); $this->assertContains('Tagging entries for user « admin »... Done', $tester->getDisplay());
} }

View File

@ -43,12 +43,12 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=config_save]')->form(); $form = $crawler->filter('button[id=config_save]')->form();
$data = [ $data = array(
'config[theme]' => 'baggy', 'config[theme]' => 'baggy',
'config[items_per_page]' => '30', 'config[items_per_page]' => '30',
'config[reading_speed]' => '0.5', 'config[reading_speed]' => '0.5',
'config[language]' => 'en', 'config[language]' => 'en',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -56,19 +56,19 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertContains('flashes.config.notice.config_saved', $alert[0]); $this->assertContains('flashes.config.notice.config_saved', $alert[0]);
} }
public function dataForUpdateFailed() public function dataForUpdateFailed()
{ {
return [ return array(
[[ array(array(
'config[theme]' => 'baggy', 'config[theme]' => 'baggy',
'config[items_per_page]' => '', 'config[items_per_page]' => '',
'config[language]' => 'en', 'config[language]' => 'en',
]], )),
]; );
} }
/** /**
@ -89,46 +89,46 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('This value should not be blank', $alert[0]); $this->assertContains('This value should not be blank', $alert[0]);
} }
public function dataForChangePasswordFailed() public function dataForChangePasswordFailed()
{ {
return [ return array(
[ array(
[ array(
'change_passwd[old_password]' => 'material', 'change_passwd[old_password]' => 'material',
'change_passwd[new_password][first]' => '', 'change_passwd[new_password][first]' => '',
'change_passwd[new_password][second]' => '', 'change_passwd[new_password][second]' => '',
], ),
'validator.password_wrong_value', 'validator.password_wrong_value',
], ),
[ array(
[ array(
'change_passwd[old_password]' => 'mypassword', 'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => '', 'change_passwd[new_password][first]' => '',
'change_passwd[new_password][second]' => '', 'change_passwd[new_password][second]' => '',
], ),
'This value should not be blank', 'This value should not be blank',
], ),
[ array(
[ array(
'change_passwd[old_password]' => 'mypassword', 'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'hop', 'change_passwd[new_password][first]' => 'hop',
'change_passwd[new_password][second]' => '', 'change_passwd[new_password][second]' => '',
], ),
'validator.password_must_match', 'validator.password_must_match',
], ),
[ array(
[ array(
'change_passwd[old_password]' => 'mypassword', 'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'hop', 'change_passwd[new_password][first]' => 'hop',
'change_passwd[new_password][second]' => 'hop', 'change_passwd[new_password][second]' => 'hop',
], ),
'validator.password_too_short', 'validator.password_too_short',
], ),
]; );
} }
/** /**
@ -149,7 +149,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertContains($expectedMessage, $alert[0]); $this->assertContains($expectedMessage, $alert[0]);
} }
@ -164,11 +164,11 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=change_passwd_save]')->form(); $form = $crawler->filter('button[id=change_passwd_save]')->form();
$data = [ $data = array(
'change_passwd[old_password]' => 'mypassword', 'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'mypassword', 'change_passwd[new_password][first]' => 'mypassword',
'change_passwd[new_password][second]' => 'mypassword', 'change_passwd[new_password][second]' => 'mypassword',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -176,28 +176,28 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertContains('flashes.config.notice.password_updated', $alert[0]); $this->assertContains('flashes.config.notice.password_updated', $alert[0]);
} }
public function dataForUserFailed() public function dataForUserFailed()
{ {
return [ return array(
[ array(
[ array(
'update_user[name]' => '', 'update_user[name]' => '',
'update_user[email]' => '', 'update_user[email]' => '',
], ),
'fos_user.email.blank', 'fos_user.email.blank',
], ),
[ array(
[ array(
'update_user[name]' => '', 'update_user[name]' => '',
'update_user[email]' => 'test', 'update_user[email]' => 'test',
], ),
'fos_user.email.invalid', 'fos_user.email.invalid',
], ),
]; );
} }
/** /**
@ -218,7 +218,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertContains($expectedMessage, $alert[0]); $this->assertContains($expectedMessage, $alert[0]);
} }
@ -233,10 +233,10 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=update_user_save]')->form(); $form = $crawler->filter('button[id=update_user_save]')->form();
$data = [ $data = array(
'update_user[name]' => 'new name', 'update_user[name]' => 'new name',
'update_user[email]' => 'admin@wallabag.io', 'update_user[email]' => 'admin@wallabag.io',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -244,59 +244,59 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('flashes.config.notice.user_updated', $alert[0]); $this->assertContains('flashes.config.notice.user_updated', $alert[0]);
} }
public function dataForNewUserFailed() public function dataForNewUserFailed()
{ {
return [ return array(
[ array(
[ array(
'new_user[username]' => '', 'new_user[username]' => '',
'new_user[plainPassword][first]' => '', 'new_user[plainPassword][first]' => '',
'new_user[plainPassword][second]' => '', 'new_user[plainPassword][second]' => '',
'new_user[email]' => '', 'new_user[email]' => '',
], ),
'fos_user.username.blank', 'fos_user.username.blank',
], ),
[ array(
[ array(
'new_user[username]' => 'a', 'new_user[username]' => 'a',
'new_user[plainPassword][first]' => 'mypassword', 'new_user[plainPassword][first]' => 'mypassword',
'new_user[plainPassword][second]' => 'mypassword', 'new_user[plainPassword][second]' => 'mypassword',
'new_user[email]' => '', 'new_user[email]' => '',
], ),
'fos_user.username.short', 'fos_user.username.short',
], ),
[ array(
[ array(
'new_user[username]' => 'wallace', 'new_user[username]' => 'wallace',
'new_user[plainPassword][first]' => 'mypassword', 'new_user[plainPassword][first]' => 'mypassword',
'new_user[plainPassword][second]' => 'mypassword', 'new_user[plainPassword][second]' => 'mypassword',
'new_user[email]' => 'test', 'new_user[email]' => 'test',
], ),
'fos_user.email.invalid', 'fos_user.email.invalid',
], ),
[ array(
[ array(
'new_user[username]' => 'admin', 'new_user[username]' => 'admin',
'new_user[plainPassword][first]' => 'wallacewallace', 'new_user[plainPassword][first]' => 'wallacewallace',
'new_user[plainPassword][second]' => 'wallacewallace', 'new_user[plainPassword][second]' => 'wallacewallace',
'new_user[email]' => 'wallace@wallace.me', 'new_user[email]' => 'wallace@wallace.me',
], ),
'fos_user.username.already_used', 'fos_user.username.already_used',
], ),
[ array(
[ array(
'new_user[username]' => 'wallace', 'new_user[username]' => 'wallace',
'new_user[plainPassword][first]' => 'mypassword1', 'new_user[plainPassword][first]' => 'mypassword1',
'new_user[plainPassword][second]' => 'mypassword2', 'new_user[plainPassword][second]' => 'mypassword2',
'new_user[email]' => 'wallace@wallace.me', 'new_user[email]' => 'wallace@wallace.me',
], ),
'validator.password_must_match', 'validator.password_must_match',
], ),
]; );
} }
/** /**
@ -317,7 +317,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertContains($expectedMessage, $alert[0]); $this->assertContains($expectedMessage, $alert[0]);
} }
@ -332,12 +332,12 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=new_user_save]')->form(); $form = $crawler->filter('button[id=new_user_save]')->form();
$data = [ $data = array(
'new_user[username]' => 'wallace', 'new_user[username]' => 'wallace',
'new_user[plainPassword][first]' => 'wallace1', 'new_user[plainPassword][first]' => 'wallace1',
'new_user[plainPassword][second]' => 'wallace1', 'new_user[plainPassword][second]' => 'wallace1',
'new_user[email]' => 'wallace@wallace.me', 'new_user[email]' => 'wallace@wallace.me',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -345,7 +345,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertContains('flashes.config.notice.user_added', $alert[0]); $this->assertContains('flashes.config.notice.user_added', $alert[0]);
$em = $client->getContainer()->get('doctrine.orm.entity_manager'); $em = $client->getContainer()->get('doctrine.orm.entity_manager');
@ -381,7 +381,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('config.form_rss.no_token', $body[0]); $this->assertContains('config.form_rss.no_token', $body[0]);
$client->request('GET', '/generate-token'); $client->request('GET', '/generate-token');
@ -389,7 +389,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertNotContains('config.form_rss.no_token', $body[0]); $this->assertNotContains('config.form_rss.no_token', $body[0]);
} }
@ -401,9 +401,9 @@ class ConfigControllerTest extends WallabagCoreTestCase
$client->request( $client->request(
'GET', 'GET',
'/generate-token', '/generate-token',
[], array(),
[], array(),
['HTTP_X-Requested-With' => 'XMLHttpRequest'] array('HTTP_X-Requested-With' => 'XMLHttpRequest')
); );
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
@ -422,9 +422,9 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=rss_config_save]')->form(); $form = $crawler->filter('button[id=rss_config_save]')->form();
$data = [ $data = array(
'rss_config[rss_limit]' => 12, 'rss_config[rss_limit]' => 12,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -432,26 +432,26 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertContains('flashes.config.notice.rss_updated', $alert[0]); $this->assertContains('flashes.config.notice.rss_updated', $alert[0]);
} }
public function dataForRssFailed() public function dataForRssFailed()
{ {
return [ return array(
[ array(
[ array(
'rss_config[rss_limit]' => 0, 'rss_config[rss_limit]' => 0,
], ),
'This value should be 1 or more.', 'This value should be 1 or more.',
], ),
[ array(
[ array(
'rss_config[rss_limit]' => 1000000000000, 'rss_config[rss_limit]' => 1000000000000,
], ),
'validator.rss_limit_too_hight', 'validator.rss_limit_too_hight',
], ),
]; );
} }
/** /**
@ -472,7 +472,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertContains($expectedMessage, $alert[0]); $this->assertContains($expectedMessage, $alert[0]);
} }
@ -487,10 +487,10 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=tagging_rule_save]')->form(); $form = $crawler->filter('button[id=tagging_rule_save]')->form();
$data = [ $data = array(
'tagging_rule[rule]' => 'readingTime <= 3', 'tagging_rule[rule]' => 'readingTime <= 3',
'tagging_rule[tags]' => 'short reading', 'tagging_rule[tags]' => 'short reading',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -498,7 +498,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertContains('flashes.config.notice.tagging_rules_updated', $alert[0]); $this->assertContains('flashes.config.notice.tagging_rules_updated', $alert[0]);
$deleteLink = $crawler->filter('.delete')->last()->link(); $deleteLink = $crawler->filter('.delete')->last()->link();
@ -507,34 +507,34 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertContains('flashes.config.notice.tagging_rules_deleted', $alert[0]); $this->assertContains('flashes.config.notice.tagging_rules_deleted', $alert[0]);
} }
public function dataForTaggingRuleFailed() public function dataForTaggingRuleFailed()
{ {
return [ return array(
[ array(
[ array(
'tagging_rule[rule]' => 'unknownVar <= 3', 'tagging_rule[rule]' => 'unknownVar <= 3',
'tagging_rule[tags]' => 'cool tag', 'tagging_rule[tags]' => 'cool tag',
], ),
[ array(
'The variable', 'The variable',
'does not exist.', 'does not exist.',
], ),
], ),
[ array(
[ array(
'tagging_rule[rule]' => 'length(domainName) <= 42', 'tagging_rule[rule]' => 'length(domainName) <= 42',
'tagging_rule[tags]' => 'cool tag', 'tagging_rule[tags]' => 'cool tag',
], ),
[ array(
'The operator', 'The operator',
'does not exist.', 'does not exist.',
], ),
], ),
]; );
} }
/** /**
@ -555,7 +555,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
foreach ($messages as $message) { foreach ($messages as $message) {
$this->assertContains($message, $body[0]); $this->assertContains($message, $body[0]);
@ -574,7 +574,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/tagging-rule/delete/'.$rule->getId()); $crawler = $client->request('GET', '/tagging-rule/delete/'.$rule->getId());
$this->assertEquals(403, $client->getResponse()->getStatusCode()); $this->assertEquals(403, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('You can not access this tagging rule', $body[0]); $this->assertContains('You can not access this tagging rule', $body[0]);
} }
@ -593,11 +593,11 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=change_passwd_save]')->form(); $form = $crawler->filter('button[id=change_passwd_save]')->form();
$data = [ $data = array(
'change_passwd[old_password]' => 'mypassword', 'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'mypassword', 'change_passwd[new_password][first]' => 'mypassword',
'change_passwd[new_password][second]' => 'mypassword', 'change_passwd[new_password][second]' => 'mypassword',
]; );
$client->submit($form, $data); $client->submit($form, $data);

View File

@ -28,7 +28,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('quickstart.intro.paragraph_1', $body[0]); $this->assertContains('quickstart.intro.paragraph_1', $body[0]);
// Test if quickstart is disabled when user has 1 entry // Test if quickstart is disabled when user has 1 entry
@ -38,16 +38,16 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form(); $form = $crawler->filter('form[name=entry]')->form();
$data = [ $data = array(
'entry[url]' => $this->url, 'entry[url]' => $this->url,
]; );
$client->submit($form, $data); $client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());
$client->followRedirect(); $client->followRedirect();
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('entry.list.number_on_the_page', $body[0]); $this->assertContains('entry.list.number_on_the_page', $body[0]);
} }
@ -74,7 +74,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertCount(4, $crawler->filter('div[class=entry]')); $this->assertCount(4, $crawler->filter('div[class=entry]'));
// Good URL // Good URL
$client->request('GET', '/bookmarklet', ['url' => $this->url]); $client->request('GET', '/bookmarklet', array('url' => $this->url));
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());
$client->followRedirect(); $client->followRedirect();
$crawler = $client->request('GET', '/'); $crawler = $client->request('GET', '/');
@ -103,7 +103,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->submit($form); $crawler = $client->submit($form);
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(['_text'])); $this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(array('_text')));
$this->assertEquals('This value should not be blank.', $alert[0]); $this->assertEquals('This value should not be blank.', $alert[0]);
} }
@ -121,9 +121,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form(); $form = $crawler->filter('form[name=entry]')->form();
$data = [ $data = array(
'entry[url]' => $this->url, 'entry[url]' => $this->url,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -150,9 +150,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form(); $form = $crawler->filter('form[name=entry]')->form();
$data = [ $data = array(
'entry[url]' => $this->url, 'entry[url]' => $this->url,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -174,9 +174,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form(); $form = $crawler->filter('form[name=entry]')->form();
$data = [ $data = array(
'entry[url]' => $url = 'https://github.com/wallabag/wallabag', 'entry[url]' => $url = 'https://github.com/wallabag/wallabag',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -245,7 +245,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/view/'.$content->getId()); $crawler = $client->request('GET', '/view/'.$content->getId());
$this->assertEquals(200, $client->getResponse()->getStatusCode()); $this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains($content->getTitle(), $body[0]); $this->assertContains($content->getTitle(), $body[0]);
} }
@ -315,9 +315,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[type=submit]')->form(); $form = $crawler->filter('button[type=submit]')->form();
$data = [ $data = array(
'entry[title]' => 'My updated title hehe :)', 'entry[title]' => 'My updated title hehe :)',
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -325,7 +325,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(['_text'])); $this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(array('_text')));
$this->assertContains('My updated title hehe :)', $alert[0]); $this->assertContains('My updated title hehe :)', $alert[0]);
} }
@ -461,10 +461,10 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
$data = [ $data = array(
'entry_filter[readingTime][right_number]' => 11, 'entry_filter[readingTime][right_number]' => 11,
'entry_filter[readingTime][left_number]' => 11, 'entry_filter[readingTime][left_number]' => 11,
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
@ -480,28 +480,28 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
$data = [ $data = array(
'entry_filter[createdAt][left_date]' => date('d/m/Y'), 'entry_filter[createdAt][left_date]' => date('d/m/Y'),
'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')), 'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')),
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]')); $this->assertCount(5, $crawler->filter('div[class=entry]'));
$data = [ $data = array(
'entry_filter[createdAt][left_date]' => date('d/m/Y'), 'entry_filter[createdAt][left_date]' => date('d/m/Y'),
'entry_filter[createdAt][right_date]' => date('d/m/Y'), 'entry_filter[createdAt][right_date]' => date('d/m/Y'),
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]')); $this->assertCount(5, $crawler->filter('div[class=entry]'));
$data = [ $data = array(
'entry_filter[createdAt][left_date]' => '01/01/1970', 'entry_filter[createdAt][left_date]' => '01/01/1970',
'entry_filter[createdAt][right_date]' => '01/01/1970', 'entry_filter[createdAt][right_date]' => '01/01/1970',
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
@ -516,13 +516,13 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=config_save]')->form(); $form = $crawler->filter('button[id=config_save]')->form();
$data = [ $data = array(
'config[items_per_page]' => '1', 'config[items_per_page]' => '1',
]; );
$client->submit($form, $data); $client->submit($form, $data);
$parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&entry_filter%5BreadingTime%5D%5Bright_number%5D='; $parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&amp;entry_filter%5BreadingTime%5D%5Bright_number%5D=';
$client->request('GET', 'unread/list'.$parameters); $client->request('GET', 'unread/list'.$parameters);
@ -531,9 +531,9 @@ class EntryControllerTest extends WallabagCoreTestCase
// reset pagination // reset pagination
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
$form = $crawler->filter('button[id=config_save]')->form(); $form = $crawler->filter('button[id=config_save]')->form();
$data = [ $data = array(
'config[items_per_page]' => '12', 'config[items_per_page]' => '12',
]; );
$client->submit($form, $data); $client->submit($form, $data);
} }
@ -544,17 +544,17 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
$data = [ $data = array(
'entry_filter[domainName]' => 'domain', 'entry_filter[domainName]' => 'domain',
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]')); $this->assertCount(5, $crawler->filter('div[class=entry]'));
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
$data = [ $data = array(
'entry_filter[domainName]' => 'wallabag', 'entry_filter[domainName]' => 'wallabag',
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
$this->assertCount(0, $crawler->filter('div[class=entry]')); $this->assertCount(0, $crawler->filter('div[class=entry]'));
@ -601,17 +601,17 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/unread/list'); $crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
$data = [ $data = array(
'entry_filter[language]' => 'fr', 'entry_filter[language]' => 'fr',
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
$this->assertCount(2, $crawler->filter('div[class=entry]')); $this->assertCount(2, $crawler->filter('div[class=entry]'));
$form = $crawler->filter('button[id=submit-filter]')->form(); $form = $crawler->filter('button[id=submit-filter]')->form();
$data = [ $data = array(
'entry_filter[language]' => 'en', 'entry_filter[language]' => 'en',
]; );
$crawler = $client->submit($form, $data); $crawler = $client->submit($form, $data);
$this->assertCount(2, $crawler->filter('div[class=entry]')); $this->assertCount(2, $crawler->filter('div[class=entry]'));

View File

@ -34,17 +34,17 @@ class RssControllerTest extends WallabagCoreTestCase
public function dataForBadUrl() public function dataForBadUrl()
{ {
return [ return array(
[ array(
'/admin/YZIOAUZIAO/unread.xml', '/admin/YZIOAUZIAO/unread.xml',
], ),
[ array(
'/wallace/YZIOAUZIAO/starred.xml', '/wallace/YZIOAUZIAO/starred.xml',
], ),
[ array(
'/wallace/YZIOAUZIAO/archives.xml', '/wallace/YZIOAUZIAO/archives.xml',
], ),
]; );
} }
/** /**

View File

@ -13,7 +13,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
$client->followRedirects(); $client->followRedirects();
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
$this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(['_text'])[0]); $this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(array('_text'))[0]);
} }
public function testLoginWith2Factor() public function testLoginWith2Factor()
@ -38,7 +38,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
$this->logInAs('admin'); $this->logInAs('admin');
$crawler = $client->request('GET', '/config'); $crawler = $client->request('GET', '/config');
$this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(['_text'])[0]); $this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(array('_text'))[0]);
// restore user // restore user
$user = $em $user = $em

View File

@ -32,9 +32,9 @@ class TagControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=tag]')->form(); $form = $crawler->filter('form[name=tag]')->form();
$data = [ $data = array(
'tag[label]' => $this->tagName, 'tag[label]' => $this->tagName,
]; );
$client->submit($form, $data); $client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());
@ -53,9 +53,9 @@ class TagControllerTest extends WallabagCoreTestCase
$this->assertEquals(1, count($newEntry->getTags())); $this->assertEquals(1, count($newEntry->getTags()));
# tag already exists but still not assigned to this entry # tag already exists but still not assigned to this entry
$data = [ $data = array(
'tag[label]' => 'foo', 'tag[label]' => 'foo',
]; );
$client->submit($form, $data); $client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());
@ -82,9 +82,9 @@ class TagControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=tag]')->form(); $form = $crawler->filter('form[name=tag]')->form();
$data = [ $data = array(
'tag[label]' => 'foo2, bar2', 'tag[label]' => 'foo2, bar2',
]; );
$client->submit($form, $data); $client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode()); $this->assertEquals(302, $client->getResponse()->getStatusCode());

View File

@ -18,12 +18,12 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
public function transformProvider() public function transformProvider()
{ {
return [ return array(
[null, ''], array(null, ''),
[[], ''], array(array(), ''),
[['single value'], 'single value'], array(array('single value'), 'single value'),
[['first value', 'second value'], 'first value,second value'], array(array('first value', 'second value'), 'first value,second value'),
]; );
} }
/** /**
@ -38,13 +38,13 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
public function reverseTransformProvider() public function reverseTransformProvider()
{ {
return [ return array(
[null, null], array(null, null),
['', []], array('', array()),
['single value', ['single value']], array('single value', array('single value')),
['first value,second value', ['first value', 'second value']], array('first value,second value', array('first value', 'second value')),
['first value, second value', ['first value', 'second value']], array('first value, second value', array('first value', 'second value')),
['first value, , second value', ['first value', 'second value']], array('first value, , second value', array('first value', 'second value')),
]; );
} }
} }

View File

@ -17,19 +17,19 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag'); ->method('tag');
$graby = $this->getMockBuilder('Graby\Graby') $graby = $this->getMockBuilder('Graby\Graby')
->setMethods(['fetchContent']) ->setMethods(array('fetchContent'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$graby->expects($this->any()) $graby->expects($this->any())
->method('fetchContent') ->method('fetchContent')
->willReturn([ ->willReturn(array(
'html' => false, 'html' => false,
'title' => '', 'title' => '',
'url' => '', 'url' => '',
'content_type' => '', 'content_type' => '',
'language' => '', 'language' => '',
]); ));
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://user@:80'); $entry = $proxy->updateEntry(new Entry(new User()), 'http://user@:80');
@ -51,19 +51,19 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag'); ->method('tag');
$graby = $this->getMockBuilder('Graby\Graby') $graby = $this->getMockBuilder('Graby\Graby')
->setMethods(['fetchContent']) ->setMethods(array('fetchContent'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$graby->expects($this->any()) $graby->expects($this->any())
->method('fetchContent') ->method('fetchContent')
->willReturn([ ->willReturn(array(
'html' => false, 'html' => false,
'title' => '', 'title' => '',
'url' => '', 'url' => '',
'content_type' => '', 'content_type' => '',
'language' => '', 'language' => '',
]); ));
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0');
@ -85,23 +85,23 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag'); ->method('tag');
$graby = $this->getMockBuilder('Graby\Graby') $graby = $this->getMockBuilder('Graby\Graby')
->setMethods(['fetchContent']) ->setMethods(array('fetchContent'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$graby->expects($this->any()) $graby->expects($this->any())
->method('fetchContent') ->method('fetchContent')
->willReturn([ ->willReturn(array(
'html' => false, 'html' => false,
'title' => '', 'title' => '',
'url' => '', 'url' => '',
'content_type' => '', 'content_type' => '',
'language' => '', 'language' => '',
'open_graph' => [ 'open_graph' => array(
'og_title' => 'my title', 'og_title' => 'my title',
'og_description' => 'desc', 'og_description' => 'desc',
], ),
]); ));
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io'); $entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io');
@ -123,24 +123,24 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag'); ->method('tag');
$graby = $this->getMockBuilder('Graby\Graby') $graby = $this->getMockBuilder('Graby\Graby')
->setMethods(['fetchContent']) ->setMethods(array('fetchContent'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$graby->expects($this->any()) $graby->expects($this->any())
->method('fetchContent') ->method('fetchContent')
->willReturn([ ->willReturn(array(
'html' => str_repeat('this is my content', 325), 'html' => str_repeat('this is my content', 325),
'title' => 'this is my title', 'title' => 'this is my title',
'url' => 'http://1.1.1.1', 'url' => 'http://1.1.1.1',
'content_type' => 'text/html', 'content_type' => 'text/html',
'language' => 'fr', 'language' => 'fr',
'open_graph' => [ 'open_graph' => array(
'og_title' => 'my OG title', 'og_title' => 'my OG title',
'og_description' => 'OG desc', 'og_description' => 'OG desc',
'og_image' => 'http://3.3.3.3/cover.jpg', 'og_image' => 'http://3.3.3.3/cover.jpg',
], ),
]); ));
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger()); $proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0');
@ -217,7 +217,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$entry = new Entry(new User()); $entry = new Entry(new User());
$proxy->assignTagsToEntry($entry, [' tag1', 'tag2 ']); $proxy->assignTagsToEntry($entry, array(' tag1', 'tag2 '));
$this->assertCount(2, $entry->getTags()); $this->assertCount(2, $entry->getTags());
$this->assertEquals('tag1', $entry->getTags()[0]->getLabel()); $this->assertEquals('tag1', $entry->getTags()[0]->getLabel());
@ -253,7 +253,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$entry = new Entry(new User()); $entry = new Entry(new User());
$proxy->assignTagsToEntry($entry, []); $proxy->assignTagsToEntry($entry, array());
$this->assertCount(0, $entry->getTags()); $this->assertCount(0, $entry->getTags());
} }
@ -299,7 +299,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
private function getTaggerMock() private function getTaggerMock()
{ {
return $this->getMockBuilder('Wallabag\CoreBundle\Helper\RuleBasedTagger') return $this->getMockBuilder('Wallabag\CoreBundle\Helper\RuleBasedTagger')
->setMethods(['tag']) ->setMethods(array('tag'))
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
} }

View File

@ -1,55 +0,0 @@
<?php
namespace Wallabag\CoreBundle\Tests\Helper;
use Wallabag\CoreBundle\Helper\Redirect;
class RedirectTest extends \PHPUnit_Framework_TestCase
{
/** @var \PHPUnit_Framework_MockObject_MockObject */
private $routerMock;
/** @var Redirect */
private $redirect;
public function setUp()
{
$this->routerMock = $this->getRouterMock();
$this->redirect = new Redirect($this->routerMock);
}
public function testRedirectToNullWithFallback()
{
$redirectUrl = $this->redirect->to(null, 'fallback');
$this->assertEquals('fallback', $redirectUrl);
}
public function testRedirectToNullWithoutFallback()
{
$redirectUrl = $this->redirect->to(null);
$this->assertEquals($this->routerMock->generate('homepage'), $redirectUrl);
}
public function testRedirectToValidUrl()
{
$redirectUrl = $this->redirect->to('/unread/list');
$this->assertEquals('/unread/list', $redirectUrl);
}
private function getRouterMock()
{
$mock = $this->getMockBuilder('Symfony\Component\Routing\Router')
->disableOriginalConstructor()
->getMock();
$mock->expects($this->any())
->method('generate')
->with('homepage')
->willReturn('homepage');
return $mock;
}
}

View File

@ -36,7 +36,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagWithNoMatchingRule() public function testTagWithNoMatchingRule()
{ {
$taggingRule = $this->getTaggingRule('rule as string', ['foo', 'bar']); $taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar'));
$user = $this->getUser([$taggingRule]); $user = $this->getUser([$taggingRule]);
$entry = new Entry($user); $entry = new Entry($user);
@ -53,7 +53,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagWithAMatchingRule() public function testTagWithAMatchingRule()
{ {
$taggingRule = $this->getTaggingRule('rule as string', ['foo', 'bar']); $taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar'));
$user = $this->getUser([$taggingRule]); $user = $this->getUser([$taggingRule]);
$entry = new Entry($user); $entry = new Entry($user);
@ -74,8 +74,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagWithAMixOfMatchingRules() public function testTagWithAMixOfMatchingRules()
{ {
$taggingRule = $this->getTaggingRule('bla bla', ['hey']); $taggingRule = $this->getTaggingRule('bla bla', array('hey'));
$otherTaggingRule = $this->getTaggingRule('rule as string', ['foo']); $otherTaggingRule = $this->getTaggingRule('rule as string', array('foo'));
$user = $this->getUser([$taggingRule, $otherTaggingRule]); $user = $this->getUser([$taggingRule, $otherTaggingRule]);
$entry = new Entry($user); $entry = new Entry($user);
@ -94,7 +94,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testWhenTheTagExists() public function testWhenTheTagExists()
{ {
$taggingRule = $this->getTaggingRule('rule as string', ['foo']); $taggingRule = $this->getTaggingRule('rule as string', array('foo'));
$user = $this->getUser([$taggingRule]); $user = $this->getUser([$taggingRule]);
$entry = new Entry($user); $entry = new Entry($user);
$tag = new Tag(); $tag = new Tag();
@ -122,8 +122,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testSameTagWithDifferentfMatchingRules() public function testSameTagWithDifferentfMatchingRules()
{ {
$taggingRule = $this->getTaggingRule('bla bla', ['hey']); $taggingRule = $this->getTaggingRule('bla bla', array('hey'));
$otherTaggingRule = $this->getTaggingRule('rule as string', ['hey']); $otherTaggingRule = $this->getTaggingRule('rule as string', array('hey'));
$user = $this->getUser([$taggingRule, $otherTaggingRule]); $user = $this->getUser([$taggingRule, $otherTaggingRule]);
$entry = new Entry($user); $entry = new Entry($user);
@ -142,7 +142,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagAllEntriesForAUser() public function testTagAllEntriesForAUser()
{ {
$taggingRule = $this->getTaggingRule('bla bla', ['hey']); $taggingRule = $this->getTaggingRule('bla bla', array('hey'));
$user = $this->getUser([$taggingRule]); $user = $this->getUser([$taggingRule]);
@ -152,7 +152,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
$this->rulerz $this->rulerz
->method('filter') ->method('filter')
->willReturn([new Entry($user), new Entry($user)]); ->willReturn(array(new Entry($user), new Entry($user)));
$entries = $this->tagger->tagAllForUser($user); $entries = $this->tagger->tagAllForUser($user);

View File

@ -15,7 +15,7 @@ use Wallabag\CoreBundle\Command\InstallCommand;
*/ */
class InstallCommandMock extends InstallCommand class InstallCommandMock extends InstallCommand
{ {
protected function runCommand($command, $parameters = []) protected function runCommand($command, $parameters = array())
{ {
return $this; return $this;
} }

View File

@ -11,7 +11,7 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
{ {
public function testSupportsWithNoRegistry() public function testSupportsWithNoRegistry()
{ {
$params = new ParamConverter([]); $params = new ParamConverter(array());
$converter = new UsernameRssTokenConverter(); $converter = new UsernameRssTokenConverter();
$this->assertFalse($converter->supports($params)); $this->assertFalse($converter->supports($params));
@ -25,9 +25,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once()) $registry->expects($this->once())
->method('getManagers') ->method('getManagers')
->will($this->returnValue([])); ->will($this->returnValue(array()));
$params = new ParamConverter([]); $params = new ParamConverter(array());
$converter = new UsernameRssTokenConverter($registry); $converter = new UsernameRssTokenConverter($registry);
$this->assertFalse($converter->supports($params)); $this->assertFalse($converter->supports($params));
@ -41,9 +41,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once()) $registry->expects($this->once())
->method('getManagers') ->method('getManagers')
->will($this->returnValue(['default' => null])); ->will($this->returnValue(array('default' => null)));
$params = new ParamConverter([]); $params = new ParamConverter(array());
$converter = new UsernameRssTokenConverter($registry); $converter = new UsernameRssTokenConverter($registry);
$this->assertFalse($converter->supports($params)); $this->assertFalse($converter->supports($params));
@ -74,14 +74,14 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once()) $registry->expects($this->once())
->method('getManagers') ->method('getManagers')
->will($this->returnValue(['default' => null])); ->will($this->returnValue(array('default' => null)));
$registry->expects($this->once()) $registry->expects($this->once())
->method('getManagerForClass') ->method('getManagerForClass')
->with('superclass') ->with('superclass')
->will($this->returnValue($em)); ->will($this->returnValue($em));
$params = new ParamConverter(['class' => 'superclass']); $params = new ParamConverter(array('class' => 'superclass'));
$converter = new UsernameRssTokenConverter($registry); $converter = new UsernameRssTokenConverter($registry);
$this->assertFalse($converter->supports($params)); $this->assertFalse($converter->supports($params));
@ -112,14 +112,14 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once()) $registry->expects($this->once())
->method('getManagers') ->method('getManagers')
->will($this->returnValue(['default' => null])); ->will($this->returnValue(array('default' => null)));
$registry->expects($this->once()) $registry->expects($this->once())
->method('getManagerForClass') ->method('getManagerForClass')
->with('WallabagUserBundle:User') ->with('WallabagUserBundle:User')
->will($this->returnValue($em)); ->will($this->returnValue($em));
$params = new ParamConverter(['class' => 'WallabagUserBundle:User']); $params = new ParamConverter(array('class' => 'WallabagUserBundle:User'));
$converter = new UsernameRssTokenConverter($registry); $converter = new UsernameRssTokenConverter($registry);
$this->assertTrue($converter->supports($params)); $this->assertTrue($converter->supports($params));
@ -131,7 +131,7 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
*/ */
public function testApplyEmptyRequest() public function testApplyEmptyRequest()
{ {
$params = new ParamConverter([]); $params = new ParamConverter(array());
$converter = new UsernameRssTokenConverter(); $converter = new UsernameRssTokenConverter();
$converter->apply(new Request(), $params); $converter->apply(new Request(), $params);
@ -170,9 +170,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
->with('WallabagUserBundle:User') ->with('WallabagUserBundle:User')
->will($this->returnValue($em)); ->will($this->returnValue($em));
$params = new ParamConverter(['class' => 'WallabagUserBundle:User']); $params = new ParamConverter(array('class' => 'WallabagUserBundle:User'));
$converter = new UsernameRssTokenConverter($registry); $converter = new UsernameRssTokenConverter($registry);
$request = new Request([], [], ['username' => 'test', 'token' => 'test']); $request = new Request(array(), array(), array('username' => 'test', 'token' => 'test'));
$converter->apply($request, $params); $converter->apply($request, $params);
} }
@ -208,9 +208,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
->with('WallabagUserBundle:User') ->with('WallabagUserBundle:User')
->will($this->returnValue($em)); ->will($this->returnValue($em));
$params = new ParamConverter(['class' => 'WallabagUserBundle:User', 'name' => 'user']); $params = new ParamConverter(array('class' => 'WallabagUserBundle:User', 'name' => 'user'));
$converter = new UsernameRssTokenConverter($registry); $converter = new UsernameRssTokenConverter($registry);
$request = new Request([], [], ['username' => 'test', 'token' => 'test']); $request = new Request(array(), array(), array('username' => 'test', 'token' => 'test'));
$converter->apply($request, $params); $converter->apply($request, $params);

View File

@ -11,23 +11,23 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
{ {
public function dataForPrefix() public function dataForPrefix()
{ {
return [ return array(
['wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()], array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
['wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '`wallabag_user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()], array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '`wallabag_user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
['wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()], array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
['wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()], array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
['wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\MySqlPlatform()], array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
['wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\SqlitePlatform()], array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
['', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()], array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
['', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '`user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()], array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '`user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
['', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()], array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
['', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()], array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
['', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\MySqlPlatform()], array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
['', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\SqlitePlatform()], array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
]; );
} }
/** /**
@ -42,7 +42,7 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
$subscriber = new TablePrefixSubscriber($prefix); $subscriber = new TablePrefixSubscriber($prefix);
$metaClass = new ClassMetadata($entityName); $metaClass = new ClassMetadata($entityName);
$metaClass->setPrimaryTable(['name' => $tableName]); $metaClass->setPrimaryTable(array('name' => $tableName));
$metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em); $metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
@ -64,7 +64,7 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
->getMock(); ->getMock();
$metaClass = new ClassMetadata($entityName); $metaClass = new ClassMetadata($entityName);
$metaClass->setPrimaryTable(['name' => $tableName]); $metaClass->setPrimaryTable(array('name' => $tableName));
$metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em); $metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
@ -88,18 +88,18 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
$subscriber = new TablePrefixSubscriber('yo_'); $subscriber = new TablePrefixSubscriber('yo_');
$metaClass = new ClassMetadata('Wallabag\UserBundle\Entity\Entry'); $metaClass = new ClassMetadata('Wallabag\UserBundle\Entity\Entry');
$metaClass->setPrimaryTable(['name' => 'entry']); $metaClass->setPrimaryTable(array('name' => 'entry'));
$metaClass->mapManyToMany([ $metaClass->mapManyToMany(array(
'fieldName' => 'tags', 'fieldName' => 'tags',
'joinTable' => ['name' => null, 'schema' => null], 'joinTable' => array('name' => null, 'schema' => null),
'targetEntity' => 'Tag', 'targetEntity' => 'Tag',
'mappedBy' => null, 'mappedBy' => null,
'inversedBy' => 'entries', 'inversedBy' => 'entries',
'cascade' => ['persist'], 'cascade' => array('persist'),
'indexBy' => null, 'indexBy' => null,
'orphanRemoval' => false, 'orphanRemoval' => false,
'fetch' => 2, 'fetch' => 2,
]); ));
$metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em); $metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);

View File

@ -24,10 +24,10 @@ abstract class WallabagCoreTestCase extends WebTestCase
{ {
$crawler = $this->client->request('GET', '/login'); $crawler = $this->client->request('GET', '/login');
$form = $crawler->filter('button[type=submit]')->form(); $form = $crawler->filter('button[type=submit]')->form();
$data = [ $data = array(
'_username' => $username, '_username' => $username,
'_password' => 'mypassword', '_password' => 'mypassword',
]; );
$this->client->submit($form, $data); $this->client->submit($form, $data);
} }

View File

@ -16,7 +16,7 @@ class Utils
$token = substr(base64_encode(random_bytes($length)), 0, $length); $token = substr(base64_encode(random_bytes($length)), 0, $length);
// remove character which can broken the url // remove character which can broken the url
return str_replace(['+', '/'], '', $token); return str_replace(array('+', '/'), '', $token);
} }
/** /**

View File

@ -6,9 +6,9 @@ class WallabagExtension extends \Twig_Extension
{ {
public function getFilters() public function getFilters()
{ {
return [ return array(
new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), new \Twig_SimpleFilter('removeWww', array($this, 'removeWww')),
]; );
} }
public function removeWww($url) public function removeWww($url)

View File

@ -17,10 +17,10 @@ class PocketController extends Controller
{ {
$pocket = $this->get('wallabag_import.pocket.import'); $pocket = $this->get('wallabag_import.pocket.import');
$form = $this->createFormBuilder($pocket) $form = $this->createFormBuilder($pocket)
->add('mark_as_read', CheckboxType::class, [ ->add('mark_as_read', CheckboxType::class, array(
'label' => 'import.form.mark_as_read_label', 'label' => 'import.form.mark_as_read_label',
'required' => false, 'required' => false,
]) ))
->getForm(); ->getForm();
return $this->render('WallabagImportBundle:Pocket:index.html.twig', [ return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
@ -36,7 +36,7 @@ class PocketController extends Controller
public function authAction(Request $request) public function authAction(Request $request)
{ {
$requestToken = $this->get('wallabag_import.pocket.import') $requestToken = $this->get('wallabag_import.pocket.import')
->getRequestToken($this->generateUrl('import', [], UrlGeneratorInterface::ABSOLUTE_URL)); ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL));
if (false === $requestToken) { if (false === $requestToken) {
$this->get('session')->getFlashBag()->add( $this->get('session')->getFlashBag()->add(
@ -51,7 +51,7 @@ class PocketController extends Controller
$this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']); $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']);
return $this->redirect( return $this->redirect(
'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], UrlGeneratorInterface::ABSOLUTE_URL), 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL),
301 301
); );
} }
@ -79,10 +79,10 @@ class PocketController extends Controller
if (true === $pocket->setMarkAsRead($markAsRead)->import()) { if (true === $pocket->setMarkAsRead($markAsRead)->import()) {
$summary = $pocket->getSummary(); $summary = $pocket->getSummary();
$message = $this->get('translator')->trans('flashes.import.notice.summary', [ $message = $this->get('translator')->trans('flashes.import.notice.summary', array(
'%imported%' => $summary['imported'], '%imported%' => $summary['imported'],
'%skipped%' => $summary['skipped'], '%skipped%' => $summary['skipped'],
]); ));
} }
$this->get('session')->getFlashBag()->add( $this->get('session')->getFlashBag()->add(

View File

@ -55,10 +55,10 @@ abstract class WallabagController extends Controller
if (true === $res) { if (true === $res) {
$summary = $wallabag->getSummary(); $summary = $wallabag->getSummary();
$message = $this->get('translator')->trans('flashes.import.notice.summary', [ $message = $this->get('translator')->trans('flashes.import.notice.summary', array(
'%imported%' => $summary['imported'], '%imported%' => $summary['imported'],
'%skipped%' => $summary['skipped'], '%skipped%' => $summary['skipped'],
]); ));
unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name);
} }

View File

@ -13,16 +13,16 @@ class UploadImportType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('file', FileType::class, [ ->add('file', FileType::class, array(
'label' => 'import.form.file_label', 'label' => 'import.form.file_label',
]) ))
->add('mark_as_read', CheckboxType::class, [ ->add('mark_as_read', CheckboxType::class, array(
'label' => 'import.form.mark_as_read_label', 'label' => 'import.form.mark_as_read_label',
'required' => false, 'required' => false,
]) ))
->add('save', SubmitType::class, [ ->add('save', SubmitType::class, array(
'label' => 'import.form.save_label', 'label' => 'import.form.save_label',
]) ))
; ;
} }

View File

@ -258,7 +258,6 @@ class PocketImport implements ImportInterface
// flush every 20 entries // flush every 20 entries
if (($i % 20) === 0) { if (($i % 20) === 0) {
$this->em->flush(); $this->em->flush();
$this->em->clear($entry);
} }
++$i; ++$i;
} }

View File

@ -185,7 +185,6 @@ abstract class WallabagImport implements ImportInterface
// flush every 20 entries // flush every 20 entries
if (($i % 20) === 0) { if (($i % 20) === 0) {
$this->em->flush(); $this->em->flush();
$this->em->clear($entry);
} }
++$i; ++$i;
} }

View File

@ -29,9 +29,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json');
$data = [ $data = array(
'upload_import_file[file]' => $file, 'upload_import_file[file]' => $file,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -54,7 +54,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content->getTags()->contains($tag)); $this->assertTrue($content->getTags()->contains($tag));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('flashes.import.notice.summary', $body[0]); $this->assertContains('flashes.import.notice.summary', $body[0]);
} }
@ -68,10 +68,10 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json'); $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json');
$data = [ $data = array(
'upload_import_file[file]' => $file, 'upload_import_file[file]' => $file,
'upload_import_file[mark_as_read]' => 1, 'upload_import_file[mark_as_read]' => 1,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -99,7 +99,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived()); $this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('flashes.import.notice.summary', $body[0]); $this->assertContains('flashes.import.notice.summary', $body[0]);
} }
@ -113,9 +113,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt');
$data = [ $data = array(
'upload_import_file[file]' => $file, 'upload_import_file[file]' => $file,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -123,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('flashes.import.notice.failed', $body[0]); $this->assertContains('flashes.import.notice.failed', $body[0]);
} }
} }

View File

@ -29,9 +29,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json');
$data = [ $data = array(
'upload_import_file[file]' => $file, 'upload_import_file[file]' => $file,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -39,7 +39,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('flashes.import.notice.summary', $body[0]); $this->assertContains('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer() $content = $client->getContainer()
@ -79,9 +79,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt');
$data = [ $data = array(
'upload_import_file[file]' => $file, 'upload_import_file[file]' => $file,
]; );
$client->submit($form, $data); $client->submit($form, $data);
@ -89,7 +89,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect(); $crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('flashes.import.notice.failed', $body[0]); $this->assertContains('flashes.import.notice.failed', $body[0]);
} }
} }

View File

@ -25,7 +25,7 @@ class ImportCompilerPassTest extends \PHPUnit_Framework_TestCase
$container $container
->register('foo') ->register('foo')
->addTag('wallabag_import.import', ['alias' => 'pocket']) ->addTag('wallabag_import.import', array('alias' => 'pocket'))
; ;
$this->process($container); $this->process($container);

Some files were not shown because too many files have changed in this diff Show More