forked from wallabag/wallabag
Compare commits
267 Commits
2.0.0-beta
...
2.0.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 08dea0edb1 | |||
| 79c44cb4f8 | |||
| 9c0bc04cfe | |||
| dafde7fb2f | |||
| 9481187896 | |||
| 1c90663b79 | |||
| 7d5b4631d0 | |||
| 9f151b469f | |||
| 45919a295e | |||
| 2499cdbf29 | |||
| 868e76af10 | |||
| f88530de68 | |||
| 4a25bef077 | |||
| 24f65a838c | |||
| 89bafa95ed | |||
| 18bb5a90d5 | |||
| 938a16c0f6 | |||
| ca8d61b958 | |||
| 23feba63bb | |||
| 3320d39418 | |||
| 23d24b1750 | |||
| dc12084d93 | |||
| 0907a72c64 | |||
| 188b74b6df | |||
| 71601c171f | |||
| 5c2c1a6434 | |||
| 7fdecbb73c | |||
| 1f034a3316 | |||
| d1f4996b77 | |||
| 5180302650 | |||
| 2d899e8d30 | |||
| 345d74268b | |||
| 4086e0782e | |||
| af497a641c | |||
| f2e5fdc366 | |||
| a417b86923 | |||
| 18078ded12 | |||
| 245e2e2cae | |||
| 86732aa01c | |||
| c31ea8a409 | |||
| c95e39c51a | |||
| 63995be5ee | |||
| 1880da7420 | |||
| 76cd8dbb05 | |||
| 624a7c6df1 | |||
| 80bd17f00d | |||
| 1b8b3859c0 | |||
| 443cff9840 | |||
| 4094ea4771 | |||
| 7eccbda99f | |||
| 8846ad0a90 | |||
| 41e79f9792 | |||
| 637dc4bb21 | |||
| a83fbf4504 | |||
| d098cb04a8 | |||
| 574d101561 | |||
| 386d1120c3 | |||
| 15e9483323 | |||
| c5dede8445 | |||
| e9497f6fc0 | |||
| c71d83b60c | |||
| f642863ff2 | |||
| 69c21157ba | |||
| 9b2fe57eb6 | |||
| b351d0494b | |||
| 6d0db75328 | |||
| 615fc1d237 | |||
| 61fcbe9f57 | |||
| eaec84fcd3 | |||
| 834efe84ac | |||
| 466c0c6684 | |||
| 661d5ae0cf | |||
| dd4997d705 | |||
| c29747357a | |||
| 0135c98b24 | |||
| cea846d407 | |||
| 54ecbb41d6 | |||
| 19a7ea2a44 | |||
| 2504fe46ed | |||
| 82dbd47391 | |||
| 7ead8a0d9d | |||
| cb48a569e0 | |||
| 5c3ca4fe9e | |||
| 808f541ea9 | |||
| 7a2157b8d7 | |||
| b00a89e08f | |||
| 015e4284f0 | |||
| f652f41dab | |||
| 7704ef5d3f | |||
| e969c2a7ef | |||
| 5b732257db | |||
| 0c608f1183 | |||
| 77b9db87b8 | |||
| 6a986910b6 | |||
| c6cbe75b2e | |||
| 9479ae834c | |||
| c802181126 | |||
| 8687bcd0c9 | |||
| 4b0b77e4d7 | |||
| e543d03fd7 | |||
| 6d3a3cfcda | |||
| 4a749cad8d | |||
| 3a7df76013 | |||
| af47742dd0 | |||
| 52d806ea6b | |||
| 48bb9675c1 | |||
| 6b82630838 | |||
| b5cf84bdf6 | |||
| a119acd15d | |||
| 7d997fd9f6 | |||
| 163517da79 | |||
| 0795d04916 | |||
| eff75729a1 | |||
| 2ff626a451 | |||
| c61b68e8a6 | |||
| d92407041a | |||
| 187868d137 | |||
| 1695a6fecd | |||
| cb68c76cd8 | |||
| 69726ec78e | |||
| 12500bd772 | |||
| 1c7690d586 | |||
| dc89968c58 | |||
| 9191d8a640 | |||
| 0bb5669cf6 | |||
| b637526524 | |||
| 4063d821a3 | |||
| e2dda63152 | |||
| 0b05dae377 | |||
| ff6b683bb3 | |||
| b787a7757e | |||
| 0e49487bb0 | |||
| ba2157b270 | |||
| cc8c2d315f | |||
| a2d6f6e9d8 | |||
| 8f336fda64 | |||
| 4d0ec0e721 | |||
| 5d6f6f56a2 | |||
| 2baca964f3 | |||
| 4e38769ad0 | |||
| 18b812b1b9 | |||
| ce25b98132 | |||
| 4dc9f8d037 | |||
| 005c0d370f | |||
| 26880205a7 | |||
| 2f20bb2b7f | |||
| 58a0ca1651 | |||
| 5791e4f458 | |||
| a6ab1e6d56 | |||
| 48581c90a1 | |||
| 842a62e293 | |||
| 4258033451 | |||
| 7dbed56857 | |||
| 5a4ee4ae0f | |||
| 439b36323e | |||
| 4083887afe | |||
| f3e49264f2 | |||
| 4cb3ef5125 | |||
| f92b5de7ac | |||
| 1381db4835 | |||
| 3fae7f1d08 | |||
| a0c6c244d9 | |||
| b308b26339 | |||
| 4204a06b77 | |||
| 4f9cf232f8 | |||
| 0d42217e4e | |||
| d2b4f01d74 | |||
| e71c376db9 | |||
| bd46de6b25 | |||
| 169d60abc7 | |||
| f39e94ace3 | |||
| 1b64a84b78 | |||
| ec7c67badc | |||
| 78becd5401 | |||
| 1978d0e3b6 | |||
| bc2b947cd5 | |||
| 0cd0d6eb8c | |||
| 2f60e5ea75 | |||
| 189ef6342a | |||
| 0d3043a29c | |||
| 2cc7de1e93 | |||
| 3500d4099f | |||
| 3107f92acb | |||
| 17051137ec | |||
| bc44aa5784 | |||
| 6432b9277e | |||
| 37b371726b | |||
| db1d4b1e19 | |||
| 889c1cf328 | |||
| bca5485946 | |||
| 17b3d026fd | |||
| 5cc9b5151f | |||
| 7d1fdab2bb | |||
| c9c8345a4a | |||
| 6ab56c7b2c | |||
| b95ffda2a1 | |||
| 55e61971f3 | |||
| d6dba929a1 | |||
| 09d8bb6fa2 | |||
| 66e2be2371 | |||
| 6aed6d69a5 | |||
| c118131317 | |||
| 24c16007bb | |||
| 4c51979595 | |||
| 0f4e919100 | |||
| 83be3dc097 | |||
| e7931dbdf8 | |||
| b80841f23c | |||
| 612f5f1ec7 | |||
| 125460345f | |||
| d460a7377a | |||
| cebb42234c | |||
| f4109a9bbf | |||
| 3b32c122ab | |||
| d442cf4a92 | |||
| 807037884f | |||
| 6f8310b445 | |||
| 9761bfa18e | |||
| 2b4770301c | |||
| d11eb2e461 | |||
| f17281417c | |||
| 2766668b59 | |||
| 1256f6fe34 | |||
| 9bf15f0269 | |||
| 2c2308b783 | |||
| 1e5a4b36ab | |||
| e68568cd5b | |||
| d89908aed3 | |||
| e166a58fd9 | |||
| e18138dbca | |||
| fba9e7d44d | |||
| 11a452813c | |||
| 816ad4051b | |||
| 79d0e38e7f | |||
| 9e3355ee4f | |||
| 5dfd321d0e | |||
| c32ae320fe | |||
| c10fcb3bbb | |||
| fe8b37c137 | |||
| 3d15ea2fd7 | |||
| 76a9bc4797 | |||
| 7d12fd0628 | |||
| e5f3b04cce | |||
| 3ca529970c | |||
| 9931a37cf7 | |||
| 348e2b4852 | |||
| bd5b3ea8ea | |||
| 9c5cfd2823 | |||
| 0e576d2163 | |||
| 646df062df | |||
| 6b6f725182 | |||
| 461a171467 | |||
| f8b835f537 | |||
| df814148c3 | |||
| 7b70feb9d2 | |||
| 9adfede511 | |||
| 244ee24764 | |||
| a6a971d45f | |||
| c273b3a5c1 | |||
| 5bf8f3f164 | |||
| 5bc2da5628 | |||
| 8a4690b6a5 | |||
| abc329453b | |||
| 6a2c524a2c | |||
| b6321bed7b | |||
| 24152cdb5e | |||
| 923a7e8d68 |
1
.github/ISSUE_TEMPLATE.md
vendored
1
.github/ISSUE_TEMPLATE.md
vendored
@ -6,6 +6,7 @@ Remember, this is _not_ a place to ask questions. For that, go to http://gitter.
|
||||
### Environment
|
||||
|
||||
* wallabag version (or git revision) that exhibits the issue:
|
||||
* How did you install wallabag? Via `git clone` or by downloading the package?
|
||||
* Last wallabag version that did not exhibit the issue (if applicable):
|
||||
* php version:
|
||||
* OS:
|
||||
|
||||
15
.travis.yml
15
.travis.yml
@ -11,6 +11,7 @@ addons:
|
||||
|
||||
# cache vendor dirs
|
||||
cache:
|
||||
apt: true
|
||||
directories:
|
||||
- vendor
|
||||
- $HOME/.composer/cache
|
||||
@ -22,12 +23,15 @@ php:
|
||||
- hhvm
|
||||
|
||||
env:
|
||||
- DB=mysql
|
||||
- DB=pgsql
|
||||
- DB=sqlite
|
||||
- DB=mysql
|
||||
- DB=pgsql
|
||||
- DB=sqlite
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 7.0
|
||||
env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite
|
||||
exclude:
|
||||
- php: hhvm
|
||||
env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
|
||||
@ -37,8 +41,7 @@ matrix:
|
||||
# exclude v1 branches
|
||||
branches:
|
||||
except:
|
||||
- master
|
||||
- dev
|
||||
- legacy
|
||||
|
||||
before_script:
|
||||
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
|
||||
@ -53,3 +56,5 @@ script:
|
||||
- travis_wait composer update --no-interaction --no-progress
|
||||
- ant prepare-$DB
|
||||
- bin/phpunit -v
|
||||
- if [ "$CS_FIXER" = "run" ]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
|
||||
- if [ "$VALIDATE_TRANSLATION_FILE" = "run" ]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi;
|
||||
|
||||
96
CHANGELOG.md
Normal file
96
CHANGELOG.md
Normal file
@ -0,0 +1,96 @@
|
||||
# Changelog
|
||||
|
||||
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
|
||||
### Added
|
||||
|
||||
- [Documentation about importing large file](http://doc.wallabag.org/en/v2/user/installation.html#installing-on-nginx) into nginx. (Nicolas Lœuillet)
|
||||
- [Documentation about wallabag API](http://doc.wallabag.org/en/v2/developer/api.html) (Nicolas Lœuillet)
|
||||
- [#1861](https://github.com/wallabag/wallabag/pull/1861) Round estimated time and add reading speed for Baggy (Nicolas Lœuillet)
|
||||
- [Documentation about wallabag v1 CLI import](http://doc.wallabag.org/en/v2/user/migration.html#import-via-command-line-interface-cli) (Nicolas Lœuillet)
|
||||
- [Add migrate link](http://doc.wallabag.org/en/v2/user/migration.html) in documentation (Nicolas Lœuillet)
|
||||
|
||||
### Changed
|
||||
|
||||
- [#1823](https://github.com/wallabag/wallabag/pull/1823) Persian translation (Masoud Abkenar)
|
||||
- [#1901](https://github.com/wallabag/wallabag/pull/1901) Spanish translation (Jeremy Benoist)
|
||||
- [#1879](https://github.com/wallabag/wallabag/pull/1879) Move tag form in Material theme (Nicolas Lœuillet)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#1903](https://github.com/wallabag/wallabag/pull/1903) Force server version to avoid connection error (Jeremy Benoist)
|
||||
- [#1887](https://github.com/wallabag/wallabag/pull/1887) Fix duplicate article when added via the bookmarklet (Nicolas Lœuillet)
|
||||
- [#1895](https://github.com/wallabag/wallabag/pull/1895) API: All the entries are fetched via GET /api/entries (Nicolas Lœuillet)
|
||||
- [#1898](https://github.com/wallabag/wallabag/pull/1898) Fix estimated reading time in material view #1893 (Nicolas Lœuillet)
|
||||
- [#1896](https://github.com/wallabag/wallabag/pull/1896) remove download_picture setting and manage show_printlink in material theme #1867 (Nicolas Lœuillet)
|
||||
- [#1894](https://github.com/wallabag/wallabag/pull/1894) Fix documentation link in developer page (Nicolas Lœuillet)
|
||||
- [#1891](https://github.com/wallabag/wallabag/pull/1891) Fix typo on configuration page (Nicolas Lœuillet)
|
||||
- [#1884](https://github.com/wallabag/wallabag/pull/1884) Change the installation method in issue template (Nicolas Lœuillet)
|
||||
- [#1844](https://github.com/wallabag/wallabag/pull/1844) Lock ocramius/proxy-manager (Jeremy Benoist)
|
||||
- [#1840](https://github.com/wallabag/wallabag/pull/1840) Fix Archive page title translation (Nicolas Lœuillet)
|
||||
- [#1801](https://github.com/wallabag/wallabag/pull/1804) Force user-agent for iansommerville.com (Jeremy Benoist)
|
||||
|
||||
### Removed
|
||||
|
||||
- [#1900](https://github.com/wallabag/wallabag/pull/1900) Remove empty portugese documentation (Nicolas Lœuillet)
|
||||
- [#1868](https://github.com/wallabag/wallabag/pull/1868) Remove keyboard shortcut and add tagging rule panel in baggy (Nicolas Lœuillet)
|
||||
- [#1824](https://github.com/wallabag/wallabag/pull/1824) Remove SMTP configuration environment overrides (Mathieu Bruyen)
|
||||
|
||||
## [2.0.0] - 2016-04-03
|
||||
### Added
|
||||
|
||||
* save an article, read it, favorite it, archive it. (Hopefully)
|
||||
* annotations: In each article you read, you can write annotations. ([read the doc](http://doc.wallabag.org/en/v2/user/annotations.html))
|
||||
* filter entries by reading time, domain name, creation date, status, etc.
|
||||
* assign tags to entries
|
||||
* edit article titles
|
||||
* a REST API ([you can have a look to the documentation](http://v2.wallabag.org/api/doc))
|
||||
* authorization via oAuth2
|
||||
* a new default theme, called `material`
|
||||
* RSS feeds (with ability to limit number of articles)
|
||||
* create a new account from the config page (for super admin only)
|
||||
* recover passwords from login page (you have to fill your email on config page)
|
||||
* picture preview, if available, is displayed for each entry
|
||||
* Public registration
|
||||
* migration from wallabag v1/v2 (based on JSON export) ([read the doc](http://doc.wallabag.org/en/v2/user/import.html))
|
||||
* migration from Pocket (it works, but we need to implement asynchronous import: if you have too many articles, it can fail) ([read the doc](http://doc.wallabag.org/en/v2/user/import.html))
|
||||
* exports in many formats (PDF, JSON, EPUB, MOBI, XML, CSV and TXT).
|
||||
* 2-Factor authentication via email ([read the doc](http://doc.wallabag.org/en/v2/user/configuration.html#two-factor-authentication))
|
||||
* Tagging rule: create a rule to automatically assign tags to entries! ([read the doc](http://doc.wallabag.org/en/v2/user/configuration.html#tagging-rules))
|
||||
* Occitan, German, French, Turkish, Persian, Romanian, Polish, Danish, Spanish and English translations
|
||||
* Quickstart for beginners (when you don't have any entries)
|
||||
* Internal settings for administrator (the account created during installation)
|
||||
* For 3rd apps developers, a developer page is available to create API token
|
||||
15
README.md
15
README.md
@ -8,15 +8,18 @@ Click, save and read it when you can. It extracts content so that you can read i
|
||||
|
||||
More informations on our website: [wallabag.org](https://wallabag.org)
|
||||
|
||||
# Want to test the v2?
|
||||
Keep in mind it's an **unstable** branch, everything can be broken :)
|
||||
# Install wallabag
|
||||
|
||||
If you don't have it yet, please [install composer](https://getcomposer.org/download/). Then you can install wallabag by executing the following commands:
|
||||
If you don't have it yet, please [install composer](https://getcomposer.org/download/).
|
||||
Then you can install wallabag by executing the following commands:
|
||||
|
||||
```
|
||||
SYMFONY_ENV=prod composer create-project wallabag/wallabag wallabag "2.0.0-beta.1" --no-dev
|
||||
php bin/console wallabag:install --env=prod
|
||||
php bin/console server:run --env=prod
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.3
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
php bin/console server:run --env=prod
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
67
RELEASE_PROCESS.md
Normal file
67
RELEASE_PROCESS.md
Normal file
@ -0,0 +1,67 @@
|
||||
## Definition
|
||||
|
||||
A release is mostly a git tag of http://github.com/wallabag/wallabag, following [semantic versioning](http://semver.org).
|
||||
The last release at the time of writing is 2.0.0-alpha.2, from the v2 branch.
|
||||
|
||||
### Steps to release
|
||||
|
||||
During this documentation, we assume the release is `release-2.0.0-beta.1`.
|
||||
|
||||
#### Files to edit
|
||||
|
||||
- `app/config/config.yml` (`wallabag_core.version`)
|
||||
- `README.md` (`composer create-project` command)
|
||||
- `docs/en/user/installation.rst` and its translations (`composer create-project` command)
|
||||
|
||||
#### Create release on GitHub
|
||||
|
||||
- Run these commands to create the tag:
|
||||
|
||||
```
|
||||
git checkout v2
|
||||
git pull origin v2
|
||||
git checkout -b release-2.0.0-beta.1
|
||||
SYMFONY_ENV=prod composer up --no-dev
|
||||
git add --force composer.lock
|
||||
git add README.md
|
||||
git commit -m "Release wallabag 2.0.0-beta.1"
|
||||
git push origin release-2.0.0-beta.1
|
||||
```
|
||||
|
||||
- Create a new pull request with this title `DON'T MERGE Release wallabag 2.0.0-beta.1`. This pull request is used to launch builds on Travis-CI.
|
||||
- Run these commands to create the package:
|
||||
|
||||
```
|
||||
git clone git@github.com:wallabag/wallabag.git -b release-2.0.0-beta.1 release-2.0.0-beta.1
|
||||
SYMFONY_ENV=prod composer up -d=release-2.0.0-beta.1 --no-dev
|
||||
tar czf wallabag-release-2.0.0-beta.1.tar.gz --exclude="var/*" --exclude=".git" release-2.0.0-beta.1
|
||||
```
|
||||
|
||||
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new). You have to upload on this page the package.
|
||||
- Delete the `release-2.0.0-beta.1` branch and close the pull request (**DO NOT MERGE IT**).
|
||||
- Update the URL shortener (used on `wllbg.org` to generate links like `http://wllbg.org/latest-v2-package` or `http://wllbg.org/latest-v2`)
|
||||
- Update [the downloads page](https://github.com/wallabag/wallabag.org/blob/master/content/pages/download.md) on the website (MD5 sum, release date)
|
||||
- Drink a beer!
|
||||
|
||||
### `composer.lock`
|
||||
A release tag must contain a `composer.lock` file. It sets which dependencies were available at the time a release was done,
|
||||
making it easier to fix issues after the release. It also speeds up `composer install` on stable versions a LOT, by skipping the
|
||||
dependencies resolution part.
|
||||
|
||||
Since `composer.lock` is ignored by default, either it must be removed from `.gitignore` _in the release branch_,
|
||||
or it must be added using `git add --force composer.lock`.
|
||||
|
||||
### Target PHP version
|
||||
`composer.lock` is _always_ built for a particular version, by default the one it is generated (with `composer update`).
|
||||
|
||||
If the PHP version used to generate the .lock isn't a widely available one (like PHP 7), a more common one should
|
||||
be locally specified in `composer.lock`:
|
||||
|
||||
```json
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "5.5.9",
|
||||
"ext-something": "4.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -22,19 +22,22 @@ class AppKernel extends Kernel
|
||||
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
|
||||
new Nelmio\CorsBundle\NelmioCorsBundle(),
|
||||
new Liip\ThemeBundle\LiipThemeBundle(),
|
||||
new Wallabag\CoreBundle\WallabagCoreBundle(),
|
||||
new Wallabag\ApiBundle\WallabagApiBundle(),
|
||||
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
|
||||
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
|
||||
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
|
||||
new Wallabag\UserBundle\WallabagUserBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
|
||||
new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
|
||||
new Wallabag\ImportBundle\WallabagImportBundle(),
|
||||
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
|
||||
new Craue\ConfigBundle\CraueConfigBundle(),
|
||||
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(),
|
||||
];
|
||||
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
download_pictures: Bilder auf den Server herunterladen
|
||||
carrot: Teilen zu Carrot aktivieren
|
||||
diaspora_url: Diaspora-URL, sofern der Service aktiviert ist
|
||||
export_epub: ePUB-Export aktivieren
|
||||
export_mobi: .mobi-Export aktivieren
|
||||
export_pdf: PDF-Export aktivieren
|
||||
export_csv: CSV-Export aktivieren
|
||||
export_json: JSON-Export aktivieren
|
||||
export_txt: TXT-Export aktivieren
|
||||
export_xml: XML-Export aktivieren
|
||||
pocket_consumer_key: Consumer-Key für Pocket, um Inhalte zu importieren (https://getpocket.com/developer/docs/authentication)
|
||||
shaarli_url: Shaarli-URL, sofern der Service aktiviert ist
|
||||
share_diaspora: Teilen zu Diaspora aktiveren
|
||||
share_mail: Teilen via E-Mail aktiveren
|
||||
share_shaarli: Teilen zu Shaarli aktiveren
|
||||
share_twitter: Teilen zu Twitter aktiveren
|
||||
show_printlink: Link anzeigen, um den Inhalt auszudrucken
|
||||
wallabag_support_url: Support-URL für wallabag
|
||||
wallabag_url: URL von *deiner* wallabag-Instanz
|
||||
entry: "Artikel"
|
||||
export: "Export"
|
||||
import: "Import"
|
||||
misc: "Verschiedenes"
|
||||
modify_settings: "Übernehmen"
|
||||
piwik_host: Host deiner Webseite in Piwik
|
||||
piwik_site_id: ID deiner Webseite in Piwik
|
||||
piwik_enabled: Piwik aktivieren
|
||||
demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-Demo genutzt)"
|
||||
demo_mode_username: "Test-Benutzer"
|
||||
@ -0,0 +1,29 @@
|
||||
download_pictures: Descagar imagenes
|
||||
carrot: Activar compartir con Carrot
|
||||
diaspora_url: Diaspora URL, si el servicio esta activado
|
||||
export_epub: Activar exportación a ePub
|
||||
export_mobi: Activar exportación a .mobi
|
||||
export_pdf: Activar exportación a PDF
|
||||
export_csv: Activar exportación a CSV
|
||||
export_json: Activar exportación a JSON
|
||||
export_txt: Activar exportación a TXT
|
||||
export_xml: Activar exportación a XML
|
||||
pocket_consumer_key: Consumer key for Pocket to import contents (https://getpocket.com/developer/docs/authentication)
|
||||
shaarli_url: Shaarli URL, si el servicio está activado
|
||||
share_diaspora: Activar compartir con Diaspora
|
||||
share_mail: Activar compartir con email
|
||||
share_shaarli: Activar compartir con Shaarli
|
||||
share_twitter: Activar compartir con Twitter
|
||||
show_printlink: Mostrar un link para imprimir contenido
|
||||
wallabag_support_url: URL de soporte de wallabag
|
||||
wallabag_url: URL de *tu* instancia de wallabag
|
||||
entry: "artículo"
|
||||
export: "exportar"
|
||||
import: "importar"
|
||||
misc: "misc"
|
||||
modify_settings: "modificar configuración"
|
||||
piwik_host: Host de tu website de Piwik
|
||||
piwik_site_id: ID de tu website de Piwik
|
||||
piwik_enabled: Activar Piwik
|
||||
demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)"
|
||||
demo_mode_username: "Nombre de usuario demo"
|
||||
@ -0,0 +1,29 @@
|
||||
download_pictures: Telecargar los imatges sul servidor
|
||||
carrot: Activar lo partatge cap a Carrot
|
||||
diaspora_url: URL de Diaspora, se lo servici Diaspora es activat
|
||||
export_epub: Activar l'expòrt ePub
|
||||
export_mobi: Activar l'expòrt .mobi
|
||||
export_pdf: Activar l'expòrt PDF
|
||||
export_csv: Activar l'expòrt CSV
|
||||
export_json: Activar l'expòrt JSON
|
||||
export_txt: Activar l'expòrt TXT
|
||||
export_xml: Activar l'expòrt XML
|
||||
pocket_consumer_key: Clau d'autentificacion Pocket per importar las donadas (https://getpocket.com/developer/docs/authentication)
|
||||
shaarli_url: URL de Shaarli, se lo servici Shaarli es activat
|
||||
share_diaspora: Activar lo partatge cap a Diaspora
|
||||
share_mail: Activar lo partatge per corrièl
|
||||
share_shaarli: Activar lo partatge cap a Shaarli
|
||||
share_twitter: Activar lo partatge cap a Twitter
|
||||
show_printlink: Afichar un ligam per imprimir
|
||||
wallabag_support_url: URL d'assisténcia de wallabag
|
||||
wallabag_url: URL de *vòstra* instància de wallabag
|
||||
entry: "article"
|
||||
export: "expòrt"
|
||||
import: "impòrt"
|
||||
misc: "divèrs"
|
||||
modify_settings: "aplicar"
|
||||
piwik_host: URL de vòstre site dins Piwik
|
||||
piwik_site_id: ID de vòstre site dins Piwik
|
||||
piwik_enabled: Activar Piwik
|
||||
demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la demostracion publica de wallabag)"
|
||||
demo_mode_username: "Utilizaire de la demostracion"
|
||||
@ -0,0 +1,2 @@
|
||||
Login: "Anmelden"
|
||||
Enter your email address below and we'll send you password reset instructions.: "Tippe deine E-Mail-Adresse unten ein und wir senden dir die Anweisungen, wie du dein Kennwort zurücksetzen kannst."
|
||||
@ -0,0 +1,2 @@
|
||||
Login: "Logearse"
|
||||
Enter your email address below and we'll send you password reset instructions.: "Introduzca su dirección de email y le enviaremos las instrucciones para resetear su contraseña."
|
||||
@ -0,0 +1,2 @@
|
||||
Login: "Se connectar"
|
||||
Enter your email address below and we'll send you password reset instructions.: "Picatz vòstra adreça de corrièl çai-jos, vos mandarem las instruccions per reïnicializar vòstre senhal."
|
||||
@ -0,0 +1,2 @@
|
||||
Login: "Logowanie"
|
||||
Enter your email address below and we'll send you password reset instructions.: "Wpisz poniżej swój adres email, abyśmy mogli wysłać ci instrukcję resetowania hasła."
|
||||
@ -1,2 +1,2 @@
|
||||
set :branch, 'v2'
|
||||
set :branch, 'master'
|
||||
set :deploy_to, '/var/www/v2.wallabag.org/web/'
|
||||
|
||||
@ -28,7 +28,7 @@ framework:
|
||||
assets: ~
|
||||
|
||||
wallabag_core:
|
||||
version: 2.0.0-beta.1
|
||||
version: 2.0.3
|
||||
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
|
||||
languages:
|
||||
en: 'English'
|
||||
@ -39,10 +39,13 @@ wallabag_core:
|
||||
ro: 'Română'
|
||||
pl: 'Polish'
|
||||
da: 'Dansk'
|
||||
es: 'Español'
|
||||
oc: 'Occitan'
|
||||
items_on_page: 12
|
||||
theme: material
|
||||
language: en
|
||||
rss_limit: 50
|
||||
reading_speed: 1
|
||||
|
||||
wallabag_import:
|
||||
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain']
|
||||
@ -79,6 +82,7 @@ doctrine:
|
||||
password: "%database_password%"
|
||||
charset: UTF8
|
||||
path: "%database_path%"
|
||||
server_version: 5.6
|
||||
|
||||
orm:
|
||||
auto_generate_proxy_classes: "%kernel.debug%"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
imports:
|
||||
- { resource: config_dev.yml }
|
||||
- { resource: parameters_test.yml }
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
@ -7,6 +8,8 @@ framework:
|
||||
storage_id: session.storage.mock_file
|
||||
profiler:
|
||||
collect: false
|
||||
translator:
|
||||
enabled: false
|
||||
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
|
||||
@ -19,14 +19,6 @@ parameters:
|
||||
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||
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_host: 127.0.0.1
|
||||
mailer_user: ~
|
||||
|
||||
8
app/config/parameters_test.yml
Normal file
8
app/config/parameters_test.yml
Normal file
@ -0,0 +1,8 @@
|
||||
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'
|
||||
@ -53,6 +53,7 @@ security:
|
||||
|
||||
access_control:
|
||||
- { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/api/version, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
|
||||
@ -6,7 +6,7 @@ services:
|
||||
filesystem_cache:
|
||||
class: Doctrine\Common\Cache\FilesystemCache
|
||||
arguments:
|
||||
- %kernel.cache_dir%/doctrine/metadata
|
||||
- "%kernel.cache_dir%/doctrine/metadata"
|
||||
|
||||
twig.extension.text:
|
||||
class: Twig_Extensions_Extension_Text
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
# 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
|
||||
@ -1,37 +0,0 @@
|
||||
# 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
|
||||
@ -1,37 +0,0 @@
|
||||
# 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
|
||||
8
app/config/tests/parameters_test.mysql.yml
Normal file
8
app/config/tests/parameters_test.mysql.yml
Normal file
@ -0,0 +1,8 @@
|
||||
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: ~
|
||||
8
app/config/tests/parameters_test.pgsql.yml
Normal file
8
app/config/tests/parameters_test.pgsql.yml
Normal file
@ -0,0 +1,8 @@
|
||||
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: ~
|
||||
8
app/config/tests/parameters_test.sqlite.yml
Normal file
8
app/config/tests/parameters_test.sqlite.yml
Normal file
@ -0,0 +1,8 @@
|
||||
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"
|
||||
1
bin/php-cs-fixer
Symbolic link
1
bin/php-cs-fixer
Symbolic link
@ -0,0 +1 @@
|
||||
../vendor/fabpot/php-cs-fixer/php-cs-fixer
|
||||
12
build.xml
12
build.xml
@ -42,8 +42,8 @@
|
||||
<target name="db_mysql" description="Run test for MySQL">
|
||||
<delete dir="${basedir}/app/config/parameters.yml"/>
|
||||
<exec executable="cp">
|
||||
<arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
|
||||
<arg value="${basedir}/app/config/parameters.yml"/>
|
||||
<arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
|
||||
<arg value="${basedir}/app/config/parameters_test.yml"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="php">
|
||||
@ -56,8 +56,8 @@
|
||||
<target name="db_sqlite" description="Run test for SQLite">
|
||||
<delete dir="${basedir}/app/config/parameters.yml"/>
|
||||
<exec executable="cp">
|
||||
<arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
|
||||
<arg value="${basedir}/app/config/parameters.yml"/>
|
||||
<arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
|
||||
<arg value="${basedir}/app/config/parameters_test.yml"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="php">
|
||||
@ -70,8 +70,8 @@
|
||||
<target name="db_pgsql" description="Run test for PostgreSQL">
|
||||
<delete dir="${basedir}/app/config/parameters.yml"/>
|
||||
<exec executable="cp">
|
||||
<arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
|
||||
<arg value="${basedir}/app/config/parameters.yml"/>
|
||||
<arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
|
||||
<arg value="${basedir}/app/config/parameters_test.yml"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="php">
|
||||
|
||||
@ -58,7 +58,6 @@
|
||||
"friendsofsymfony/rest-bundle": "~1.4",
|
||||
"jms/serializer-bundle": "~1.0",
|
||||
"nelmio/api-doc-bundle": "~2.7",
|
||||
"ezyang/htmlpurifier": "~4.6",
|
||||
"mgargano/simplehtmldom": "~1.5",
|
||||
"tecnickcom/tcpdf": "~6.2",
|
||||
"simplepie/simplepie": "~1.3.1",
|
||||
@ -80,20 +79,20 @@
|
||||
"paragonie/random_compat": "~1.0",
|
||||
"craue/config-bundle": "~1.4",
|
||||
"mnapoli/piwik-twig-extension": "^1.0",
|
||||
"lexik/maintenance-bundle": "~2.1"
|
||||
"lexik/maintenance-bundle": "~2.1",
|
||||
"ocramius/proxy-manager": "1.*",
|
||||
"white-october/pagerfanta-bundle": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/doctrine-fixtures-bundle": "~2.2",
|
||||
"sensio/generator-bundle": "^3.0",
|
||||
"phpunit/phpunit": "~4.4",
|
||||
"symfony/phpunit-bridge": "^2.7"
|
||||
"symfony/phpunit-bridge": "^2.7",
|
||||
"fabpot/php-cs-fixer": "~1.9"
|
||||
},
|
||||
"scripts": {
|
||||
"build-parameters": [
|
||||
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
|
||||
],
|
||||
"post-cmd": [
|
||||
"@build-parameters",
|
||||
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
|
||||
@ -115,13 +114,7 @@
|
||||
"symfony-tests-dir": "tests",
|
||||
"symfony-assets-install": "relative",
|
||||
"incenteev-parameters": {
|
||||
"file": "app/config/parameters.yml",
|
||||
"env-map": {
|
||||
"mailer_host": "WALLABAG_MAILER_HOST",
|
||||
"mailer_user": "WALLABAG_MAILER_USER",
|
||||
"mailer_password": "WALLABAG_MAILER_PASSWORD",
|
||||
"secret": "WALLABAG_SECRET"
|
||||
}
|
||||
"file": "app/config/parameters.yml"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
||||
419
composer.lock
generated
419
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,42 +1,48 @@
|
||||
nginx:
|
||||
image: nginx
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./docker/nginx/nginx.conf:/nginx.conf
|
||||
- ./docker/logs/nginx:/var/log/nginx
|
||||
- .:/var/www/html
|
||||
links:
|
||||
- php:php
|
||||
command: nginx -c /nginx.conf
|
||||
php:
|
||||
build: docker/php
|
||||
ports:
|
||||
- "9000:9000"
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
#links:
|
||||
# - "postgres:rdbms"
|
||||
# - "mariadb:rdbms"
|
||||
env_file:
|
||||
- ./docker/php/env
|
||||
# Comment non-used DBMS lines
|
||||
# If all DBMS are commented out, sqlite will be used as default
|
||||
# - ./docker/postgres/env
|
||||
# - ./docker/mariadb/env
|
||||
#postgres:
|
||||
# image: postgres:9
|
||||
# ports:
|
||||
# - "5432:5432"
|
||||
# volumes:
|
||||
# - ./docker/data/pgsql:/var/lib/postgresql/data
|
||||
# env_file:
|
||||
# - ./docker/postgres/env
|
||||
#mariadb:
|
||||
# image: mariadb:10
|
||||
# ports:
|
||||
# - "3306:3306"
|
||||
# volumes:
|
||||
# - ./docker/data/mariadb:/var/lib/mysql
|
||||
# env_file:
|
||||
# - ./docker/mariadb/env
|
||||
version: '2'
|
||||
services:
|
||||
nginx:
|
||||
image: nginx
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./docker/nginx/nginx.conf:/nginx.conf
|
||||
- ./docker/logs/nginx:/var/log/nginx
|
||||
- .:/var/www/html
|
||||
links:
|
||||
- php:php
|
||||
command: nginx -c /nginx.conf
|
||||
php:
|
||||
build:
|
||||
context: docker/php
|
||||
args:
|
||||
# Set here your timezone using one of this: http://php.net/manual/en/timezones.php
|
||||
timezone: 'Europe/Monaco'
|
||||
ports:
|
||||
- "9000:9000"
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
#links:
|
||||
# - "postgres:rdbms"
|
||||
# - "mariadb:rdbms"
|
||||
env_file:
|
||||
- ./docker/php/env
|
||||
# Comment non-used DBMS lines
|
||||
# If all DBMS are commented out, sqlite will be used as default
|
||||
# - ./docker/postgres/env
|
||||
# - ./docker/mariadb/env
|
||||
#postgres:
|
||||
# image: postgres:9
|
||||
# ports:
|
||||
# - "5432:5432"
|
||||
# volumes:
|
||||
# - ./docker/data/pgsql:/var/lib/postgresql/data
|
||||
# env_file:
|
||||
# - ./docker/postgres/env
|
||||
#mariadb:
|
||||
# image: mariadb:10
|
||||
# ports:
|
||||
# - "3306:3306"
|
||||
# volumes:
|
||||
# - ./docker/data/mariadb:/var/lib/mysql
|
||||
# env_file:
|
||||
# - ./docker/mariadb/env
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
FROM php:fpm
|
||||
|
||||
# Default timezone. To change it, use the argument in the docker-compose.yml file
|
||||
ARG timezone='Europe/Paris'
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libmcrypt-dev libicu-dev libpq-dev libxml2-dev \
|
||||
&& docker-php-ext-install \
|
||||
iconv mcrypt mbstring intl pdo pdo_mysql pdo_pgsql
|
||||
|
||||
RUN echo "date.timezone="$timezone > /usr/local/etc/php/conf.d/date_timezone.ini
|
||||
|
||||
RUN usermod -u 1000 www-data
|
||||
|
||||
CMD ["php-fpm"]
|
||||
|
||||
259
docs/en/developer/api.rst
Normal file
259
docs/en/developer/api.rst
Normal file
File diff suppressed because one or more lines are too long
@ -12,15 +12,15 @@ Translation files
|
||||
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.
|
||||
|
||||
You can find translation files here: https://github.com/wallabag/wallabag/tree/v2/src/Wallabag/CoreBundle/Resources/translations.
|
||||
You can find translation files here: https://github.com/wallabag/wallabag/tree/master/src/Wallabag/CoreBundle/Resources/translations.
|
||||
|
||||
You have to create ``messages.CODE.yml`` and ``validators.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>`__).
|
||||
|
||||
Other files to translate:
|
||||
|
||||
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/CraueConfigBundle/translations.
|
||||
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/FOSUserBundle/translations.
|
||||
- https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
|
||||
- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations.
|
||||
|
||||
You have to create ``THE_TRANSLATION_FILE.CODE.yml`` files.
|
||||
|
||||
@ -28,7 +28,7 @@ Configuration file
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You have to edit `app/config/config.yml
|
||||
<https://github.com/wallabag/wallabag/blob/v2/app/config/config.yml>`__ to display
|
||||
<https://github.com/wallabag/wallabag/blob/master/app/config/config.yml>`__ to display
|
||||
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
|
||||
@ -55,6 +55,6 @@ wallabag documentation
|
||||
|
||||
Contrary to the web application, the main language for documentation is english.
|
||||
|
||||
Documentation files are stored here: https://github.com/wallabag/wallabag/tree/v2/docs
|
||||
Documentation files are stored here: https://github.com/wallabag/wallabag/tree/master/docs
|
||||
|
||||
You need to respect the ``en`` folder structure when you create your own translation.
|
||||
|
||||
@ -24,6 +24,7 @@ The main documentation for this application is organized into a couple sections:
|
||||
:caption: User documentation
|
||||
|
||||
user/installation
|
||||
user/migration
|
||||
user/create_account
|
||||
user/login
|
||||
user/configuration
|
||||
@ -41,6 +42,7 @@ The main documentation for this application is organized into a couple sections:
|
||||
:maxdepth: 2
|
||||
:caption: Developer documentation
|
||||
|
||||
developer/api
|
||||
developer/docker
|
||||
developer/translate
|
||||
developer/maintenance
|
||||
|
||||
@ -21,6 +21,12 @@ Items per page
|
||||
|
||||
You can change the number of articles displayed on each page.
|
||||
|
||||
Reading speed
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are
|
||||
a fast or a slow reader. wallabag will recalculate the reading time for each article.
|
||||
|
||||
Language
|
||||
~~~~~~~~
|
||||
|
||||
|
||||
@ -12,9 +12,9 @@ There may be several reasons:
|
||||
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.
|
||||
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?
|
||||
---------------------------------------
|
||||
|
||||
@ -1,2 +1,49 @@
|
||||
Filters
|
||||
=======
|
||||
=======
|
||||
|
||||
To retrieve articles easier, you can use filters.
|
||||
Click on the third icon in the top bar.
|
||||
|
||||
.. image:: ../../img/user/topbar.png
|
||||
:alt: Top bar
|
||||
:align: center
|
||||
|
||||
All these filters can be combined.
|
||||
|
||||
.. image:: ../../img/user/filters.png
|
||||
:alt: Combine all filters
|
||||
:align: center
|
||||
|
||||
Status
|
||||
------
|
||||
|
||||
Use these checkboxes to find archived or starred articles.
|
||||
|
||||
Preview picture
|
||||
---------------
|
||||
|
||||
Check this filter if you want to retrieve articles with a preview picture.
|
||||
|
||||
Language
|
||||
--------
|
||||
|
||||
wallabag (via graby) can detect article language. It's easy to you to retrieve articles
|
||||
written in a specific language.
|
||||
|
||||
Reading time
|
||||
------------
|
||||
|
||||
wallabag estimates how many time you need to read an article. With this filter,
|
||||
you can for example find the articles with a reading time between 2 and 5 minutes.
|
||||
|
||||
Domain name
|
||||
-----------
|
||||
|
||||
Thanks to this filter, you can retrieve the articles from the same domain name.
|
||||
For example, in this field, type ``bbc.co.uk`` to retrieve the articles of this website.
|
||||
|
||||
Creation date
|
||||
-------------
|
||||
|
||||
When you save an article, wallabag stored the current date. So handful to retrieve articles written
|
||||
between 1st and 31th January for example.
|
||||
|
||||
@ -4,14 +4,14 @@ Install wallabag
|
||||
Requirements
|
||||
------------
|
||||
|
||||
wallabag is compatible with php >= 5.5
|
||||
wallabag is compatible with PHP >= 5.5, including PHP 7.
|
||||
|
||||
You'll need the following extensions for wallabag to work. Some of these may already activated in your version of php, so you may not have to install all corresponding packages.
|
||||
You'll need the following extensions for wallabag to work. Some of these may already activated in your version of PHP, so you may not have to install all corresponding packages.
|
||||
|
||||
- php-session
|
||||
- php-ctype
|
||||
- php-dom
|
||||
- pĥp-hash
|
||||
- php-hash
|
||||
- php-simplexml
|
||||
- php-json
|
||||
- php-gd
|
||||
@ -25,9 +25,9 @@ You'll need the following extensions for wallabag to work. Some of these may alr
|
||||
|
||||
wallabag uses PDO to connect to database, so you'll need one of:
|
||||
|
||||
- php-pdo_mysql
|
||||
- php-pdo_sqlite
|
||||
- php-pdo_pgsql
|
||||
- pdo_mysql
|
||||
- pdo_sqlite
|
||||
- pdo_pgsql
|
||||
|
||||
and it's corresponding database server.
|
||||
|
||||
@ -42,13 +42,16 @@ Install Composer:
|
||||
|
||||
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:
|
||||
|
||||
::
|
||||
|
||||
SYMFONY_ENV=prod composer create-project wallabag/wallabag wallabag "2.0.0-beta.1" --no-dev
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.3
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
|
||||
To start php's build-in server and test if everything did install correctly, you can do:
|
||||
@ -59,6 +62,10 @@ To start php's build-in server and test if everything did install correctly, you
|
||||
|
||||
And access wallabag at http://yourserverip:8000
|
||||
|
||||
.. 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>`__.
|
||||
|
||||
Installing on Apache
|
||||
--------------------
|
||||
|
||||
@ -143,3 +150,7 @@ Assuming you install wallabag in the /var/www/wallabag folder, here's the recipe
|
||||
}
|
||||
|
||||
After reloading or restarting nginx, you should now be able to access wallabag at http://domain.tld.
|
||||
|
||||
.. note::
|
||||
|
||||
When you want to import large file into wallabag, you need to add this line in your nginx configuration ``client_max_body_size XM; # allows file uploads up to X megabytes``.
|
||||
|
||||
62
docs/en/user/migration.rst
Normal file
62
docs/en/user/migration.rst
Normal file
@ -0,0 +1,62 @@
|
||||
Migrate wallabag
|
||||
================
|
||||
|
||||
From wallabag 1.x
|
||||
-----------------
|
||||
|
||||
If you were using wallabag v1.x, you need to export your data before migrating to wallabag v2.x, because the application and its database changed a lot. In your old wallabag installation, you can export your data, which can be done on the Config page of your old wallabag installation.
|
||||
|
||||
.. image:: ../../img/user/export_v1.png
|
||||
:alt: Exporting from wallabag v1
|
||||
:align: center
|
||||
|
||||
.. note::
|
||||
If you have multiple accounts on the same instance of wallabag, each user must export from v1 and import into v2 its data.
|
||||
|
||||
.. note::
|
||||
If you encounter issues during the export or the import, don't hesitate to `ask for support <https://www.wallabag.org/pages/support.html>`__.
|
||||
|
||||
When you have retrieved the json file containing your entries, you can install wallabag v2 if needed by following `the standard procedure <http://doc.wallabag.org/en/v2/user/installation.html>`__.
|
||||
|
||||
After creating an user account on your new wallabag v2 instance, you must head over to the `Import` section and select `Import from wallabag v1`. Select your json file and upload it.
|
||||
|
||||
.. image:: ../../img/user/import_wallabagv1.png
|
||||
:alt: Import from wallabag v1
|
||||
:align: center
|
||||
|
||||
Import via command-line interface (CLI)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you have a CLI access on your web server, you can execute this command to import your wallabag v1 export:
|
||||
|
||||
::
|
||||
|
||||
bin/console wallabag:import-v1 1 ~/Downloads/wallabag-export-1-2016-04-05.json --env=prod
|
||||
|
||||
Please replace values:
|
||||
|
||||
* ``1`` is the user identifier in database (The ID of the first user created on wallabag is 1)
|
||||
* ``~/Downloads/wallabag-export-1-2016-04-05.json`` is the path of your wallabag v1 export
|
||||
|
||||
You'll have this in return:
|
||||
|
||||
::
|
||||
|
||||
Start : 05-04-2016 11:36:07 ---
|
||||
403 imported
|
||||
0 already saved
|
||||
End : 05-04-2016 11:36:09 ---
|
||||
|
||||
From wallabag 2.x
|
||||
-----------------
|
||||
|
||||
From the previous wallabag instance on which you were before, go to `All articles`, then export these articles as json.
|
||||
|
||||
.. image:: ../../img/user/export_v2.png
|
||||
:alt: Export depuis wallabag v2
|
||||
:align: center
|
||||
|
||||
From your new wallabag instance, create your user account and click on the link in the menu to proceed to import. Choose import from wallabag v2 and select your json file to upload it.
|
||||
|
||||
.. note::
|
||||
If you encounter issues during the export or the import, don't hesitate to `ask for support <https://www.wallabag.org/pages/support.html>`__.
|
||||
259
docs/fr/developer/api.rst
Normal file
259
docs/fr/developer/api.rst
Normal file
File diff suppressed because one or more lines are too long
@ -13,15 +13,15 @@ Fichiers de traductions
|
||||
cette traduction qui est considérée comme la plus récente. Merci de vous baser
|
||||
sur celle-ci pour créer votre traduction.
|
||||
|
||||
Les principaux fichiers de traduction se trouvent ici : https://github.com/wallabag/wallabag/tree/v2/src/Wallabag/CoreBundle/Resources/translations.
|
||||
Les principaux fichiers de traduction se trouvent ici : https://github.com/wallabag/wallabag/tree/master/src/Wallabag/CoreBundle/Resources/translations.
|
||||
|
||||
Vous devez créer les fichiers ``messages.CODE.yml`` et ``validators.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>`__).
|
||||
|
||||
Autres fichiers à traduire :
|
||||
|
||||
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/CraueConfigBundle/translations.
|
||||
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/FOSUserBundle/translations.
|
||||
- https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
|
||||
- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations.
|
||||
|
||||
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
|
||||
<https://github.com/wallabag/wallabag/blob/v2/app/config/config.yml>`__ pour
|
||||
<https://github.com/wallabag/wallabag/blob/master/app/config/config.yml>`__ pour
|
||||
afficher votre langue dans la page Configuration de wallabag (pour permettre aux
|
||||
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
|
||||
|
||||
Les fichiers de documentation se trouvent ici : https://github.com/wallabag/wallabag/tree/v2/docs
|
||||
Les fichiers de documentation se trouvent ici : https://github.com/wallabag/wallabag/tree/master/docs
|
||||
|
||||
Vous devez respecter la structure du dossier ``en`` quand vous crééz votre traduction.
|
||||
|
||||
@ -25,6 +25,7 @@ La documentation principale de cette application est découpée en plusieurs sec
|
||||
:caption: Documentation utilisateur
|
||||
|
||||
user/installation
|
||||
user/migration
|
||||
user/create_account
|
||||
user/login
|
||||
user/configuration
|
||||
@ -42,6 +43,7 @@ La documentation principale de cette application est découpée en plusieurs sec
|
||||
:maxdepth: 2
|
||||
:caption: Documentation développeur
|
||||
|
||||
developer/api
|
||||
developer/docker
|
||||
developer/translate
|
||||
developer/maintenance
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Maintenant que vous êtes connecté, il est temps de confirurer votre compte.
|
||||
Maintenant que vous êtes connecté, il est temps de configurer votre compte.
|
||||
|
||||
Cliquez sur le menu ``Configuration``. Vous avez accès à 5 onglets:
|
||||
Cliquez sur le menu ``Configuration``. Vous avez accès à 5 onglets :
|
||||
``Paramètres``, ``RSS``, ``Mon compte``, ``Mot de passe`` and ``Règles de tag automatiques``.
|
||||
|
||||
Paramètres
|
||||
@ -14,7 +14,7 @@ Thème
|
||||
|
||||
L'affichage de wallabag est personnalisable. C'est ici que vous choisissez le thème
|
||||
que vous préférez. Vous pouvez aussi en créer un nouveau, une documentation sera
|
||||
disponible pour apprendre comment. Le thème par défaut ``Material``, c'est ce thème
|
||||
disponible pour guider. Le thème par défaut est ``Material``, c'est celui
|
||||
qui est utilisé dans les captures d'écran de la documentation.
|
||||
|
||||
Nombre d'articles par page
|
||||
@ -22,6 +22,11 @@ Nombre d'articles par page
|
||||
|
||||
Vous pouvez définir le nombre d'articles affichés sur chaque page.
|
||||
|
||||
Vitesse de lecture
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article.
|
||||
|
||||
Langue
|
||||
~~~~~~
|
||||
|
||||
@ -31,12 +36,12 @@ pour que la nouvelle langue soit prise en compte.
|
||||
RSS
|
||||
---
|
||||
|
||||
wallabag propose un flux RSS for chaque statut d'article : non lus, favoris and lus.
|
||||
wallabag propose un flux RSS pour chaque statut d'article : non lus, favoris et lus.
|
||||
|
||||
Tout d'abord, vous devez vous créer un jeton personnel : cliquez sur ``Créez votre jeton``.
|
||||
C'est possible de regénérer votre jeton en cliquant sur ``Réinitialisez votre jeton``.
|
||||
Tout d'abord, vous devez vous créer un jeton personnel : cliquez sur ``Créez votre jeton``.
|
||||
Il est possible de regénérer votre jeton en cliquant sur ``Réinitialisez votre jeton``.
|
||||
|
||||
Vous avez maintenant trois liens, un par statut : ajoutez les dans votre agrégateur de flux RSS préféré.
|
||||
Vous avez maintenant trois liens, un par statut : ajoutez-les dans votre agrégateur de flux RSS préféré.
|
||||
|
||||
Vous pouvez aussi définir combien d'articles vous souhaitez dans vos flux RSS
|
||||
(50 est la valeur par défaut).
|
||||
@ -49,16 +54,16 @@ Vous pouvez ici modifier votre nom, votre adresse email et activer la ``Double a
|
||||
Double authentification (2FA)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Two-factor authentication (also known as 2FA) is a technology patented in
|
||||
1984 that provides identification of users by means of the combination of two different components.
|
||||
L'authentification à deux facteurs (également appelée 2FA) est une technologie brevetée en 1984
|
||||
qui fournit l'identification des utilisateurs au moyen de la combinaison de deux composants différents .
|
||||
|
||||
https://en.wikipedia.org/wiki/Two-factor_authentication
|
||||
https://fr.wikipedia.org/wiki/Authentification_forte
|
||||
|
||||
Si vous activer 2FA, à chaque tentative de connexion à wallabag, vous recevrez
|
||||
Si vous activez 2FA, à chaque tentative de connexion à wallabag, vous recevrez
|
||||
un code par email. Vous devez renseigner ce code dans le formulaire suivant :
|
||||
|
||||
.. image:: ../../img/user/2FA_form.png
|
||||
:alt: Two factor authentication
|
||||
:alt: Authentification à deux facteurs
|
||||
:align: center
|
||||
|
||||
Si vous ne souhaitez pas recevoir un code à chaque fois que vous vous connectez,
|
||||
@ -89,15 +94,15 @@ Comment les utiliser ?
|
||||
|
||||
Admettons que vous voulez ajouter comme tag *« lecture rapide »* quand le temps de lecture
|
||||
d'un article est inférieur à 3 minutes.
|
||||
Dans ce cas, vous devez ajouter « readingTime <= 3 » dans le champ **Règle** et *« lecture rapide »* dans le champ **Tags**.
|
||||
Plusieurs tags peuvent être ajoutés en même temps en les séparant par une virgule : *« lecture rapide, à lire »*.
|
||||
Dans ce cas, vous devez ajouter « readingTime <= 3 » dans le champ **Règle** et *« lecture rapide »* dans le champ **Tags**.
|
||||
Plusieurs tags peuvent être ajoutés en même temps en les séparant par une virgule : *« lecture rapide, à lire »*.
|
||||
Des règles complexes peuvent être écrites en utilisant les opérateurs pré-définis :
|
||||
if *« readingTime >= 5 AND domainName = "github.com" »* then tag as *« long reading, github »*.
|
||||
|
||||
Quels variables et opérateurs puis-je utiliser pour écrire mes règles ?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Les variables et opérateurs suivants peuvent être utilisés lors de la création de vos règles :
|
||||
Les variables et opérateurs suivants peuvent être utilisés lors de la création de vos règles :
|
||||
|
||||
=========== ============================================== ========== ==========
|
||||
Variable Sens Opérateur Sens
|
||||
@ -110,5 +115,5 @@ content Le contenu de l'article = Égal
|
||||
language La langue de l'article != Différent de …
|
||||
mimetype The type MIME de l'article OR Telle règle ou telle autre règle
|
||||
readingTime Le temps de lecture de l'article, en minutes AND Telle règle et telle règle
|
||||
domainName Le nom de domaine de l'article matches Contient telle chaine de caractère (insensible à la casse). Exemple : title matches "football"
|
||||
domainName Le nom de domaine de l'article matches Contient telle chaîne de caractère (insensible à la casse). Exemple : title matches "football"
|
||||
=========== ============================================== ========== ==========
|
||||
|
||||
@ -4,14 +4,14 @@ Se créer un compte
|
||||
Sur la page de connexion, cliquez sur le bouton ``Créer un compte``.
|
||||
|
||||
.. image:: ../../img/user/registration_form.png
|
||||
:alt: Registration form
|
||||
:alt: Formulaire de création de compte
|
||||
:align: center
|
||||
|
||||
Vous devez renseigner le formulaire. Faites attention de bien renseigner une adresse
|
||||
email valide, nous allons vous envoyer un email d'activation.
|
||||
|
||||
.. image:: ../../img/user/sent_email.png
|
||||
:alt: Email was sent to activate account
|
||||
:alt: Un email a été envoyé pour activer votre compte
|
||||
:align: center
|
||||
|
||||
Vérifiez votre boite de réception, vous avez un nouvel email avec un lien comme celui-ci
|
||||
@ -21,7 +21,7 @@ Cliquez dessus pour activer votre compte.
|
||||
Votre compte est maintenant actif.
|
||||
|
||||
.. image:: ../../img/user/activated_account.png
|
||||
:alt: Welcome on board!
|
||||
:alt: Bienvenue à bord !
|
||||
:align: center
|
||||
|
||||
Foire aux questions
|
||||
|
||||
@ -6,12 +6,12 @@ Vous pouvez télécharger chaque article dans plusieurs formats : ePUB, MOBI, PD
|
||||
Lorsque vous lisez un article, cliquez sur cette icône dans la barre latérale :
|
||||
|
||||
.. image:: ../../img/user/download_article.png
|
||||
:alt: download article
|
||||
:alt: Télécharger l'article
|
||||
:align: center
|
||||
|
||||
Vous pouvez aussi télécharger une catégorie (non lus, favoris, lus) dans ces formats.
|
||||
Par exemple, dans la vue **Non lus**, cliquez sur cette icône dans la barre supérieure :
|
||||
|
||||
.. image:: ../../img/user/download_articles.png
|
||||
:alt: download articles
|
||||
:alt: Télécharger l'article
|
||||
:align: center
|
||||
|
||||
@ -12,9 +12,9 @@ Il peut y avoir plusieurs raisons :
|
||||
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.
|
||||
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 ?
|
||||
---------------------------------------------------
|
||||
@ -23,5 +23,5 @@ Si wallabag échoue en récupérant l'article, vous pouvez cliquer sur le bouton
|
||||
(le troisième sur l'image ci-dessous).
|
||||
|
||||
.. image:: ../../img/user/refetch.png
|
||||
:alt: Refetch content
|
||||
:alt: Réessayer de récupérer le contenu
|
||||
:align: center
|
||||
|
||||
@ -1,2 +1,50 @@
|
||||
Filtres
|
||||
=======
|
||||
|
||||
Pour retrouver plus facilement vos articles, vous pouvez utiliser les filtres.
|
||||
Cliquez sur la troisième icône de la barre supérieure.
|
||||
|
||||
.. image:: ../../img/user/topbar.png
|
||||
:alt: Barre supérieure
|
||||
:align: center
|
||||
|
||||
Tous ces filtres peuvent être combinés.
|
||||
|
||||
.. image:: ../../img/user/filters.png
|
||||
:alt: Combine all filters
|
||||
:align: center
|
||||
|
||||
Statut
|
||||
------
|
||||
|
||||
Utilisez ces cases à cocher pour retrouver les articles lus ou mis en favori.
|
||||
|
||||
Image de prévisualisation
|
||||
-------------------------
|
||||
|
||||
Cochez ce filtre si vous voulez retrouver les articles avec une image de prévisualisation.
|
||||
|
||||
Langage
|
||||
-------
|
||||
|
||||
wallabag (via graby) peut détecter la langue dans laquelle l'article est écrit.
|
||||
C'est ainsi facile pour vous de retrouver des articles écrits dans une langue spécifique.
|
||||
|
||||
Temps de lecture
|
||||
----------------
|
||||
|
||||
wallabag estime combien de temps vous avez besoin pour lire un article.
|
||||
Avec ce filtre, vous pouvez par exemple retrouver les articles qui ont une estimation
|
||||
entre 2 et 5 minutes.
|
||||
|
||||
Nom de domaine
|
||||
--------------
|
||||
|
||||
Grâce à ce filtre, vous pouvez retrouver les articles venant d'un même nom de domaine.
|
||||
Par exemple, dans ce champ, saisissez ``lemonde.fr`` pour retrouver les articles de ce site.
|
||||
|
||||
Date de création
|
||||
----------------
|
||||
|
||||
Quand vous ajoutez un article, wallabag stocke la date courante.
|
||||
C'est très pratique pour retrouver les articles ajoutés entre le 1er et le 31 janvier par exemple.
|
||||
|
||||
@ -25,7 +25,7 @@ Dans la barre haut de wallabag, vous avez trois icônes. Avec la première icôn
|
||||
un signe plus, vous pouvez facilement ajouter un nouvel article.
|
||||
|
||||
.. image:: ../../img/user/topbar.png
|
||||
:alt: Top bar
|
||||
:alt: Barre supérieure
|
||||
:align: center
|
||||
|
||||
Cliquez dessus pour afficher un nouveau champ, collez-y l'URL de l'article et appuyez
|
||||
|
||||
@ -10,7 +10,7 @@ Exportez vos données de wallabag 1.x
|
||||
Sur la page de configuration, cliquez sur ``Export JSON`` dans la section ``Exportez vos données wallabag``.
|
||||
|
||||
.. image:: ../../img/user/export_wllbg_1.png
|
||||
:alt: Export from wallabag 1.x
|
||||
:alt: Export depuis wallabag 1.x
|
||||
:align: center
|
||||
|
||||
Vous obtiendrez un fichier ``wallabag-export-1-1970-01-01.json``.
|
||||
@ -21,7 +21,7 @@ Exportez vos données de wallabag 2.x
|
||||
Dans la barre latérale de téléchargement, cliquez sur ``JSON``.
|
||||
|
||||
.. image:: ../../img/user/export_wllbg_2.png
|
||||
:alt: Export from wallabag 2.x
|
||||
:alt: Export depuis wallabag 2.x
|
||||
:align: center
|
||||
|
||||
Vous obtiendrez un fichier ``Unread articles.json``.
|
||||
@ -33,7 +33,7 @@ Cliquez sur le lien ``Importer`` dans le menu, choisissez la version de wallabag
|
||||
sélectionnez votre fichier d'export sur votre ordinateur et importez-le.
|
||||
|
||||
.. image:: ../../img/user/import_wllbg.png
|
||||
:alt: Import from wallabag 1.x
|
||||
:alt: Import depuis wallabag 1.x
|
||||
:align: center
|
||||
|
||||
Tous vos articles wallabag seront importés.
|
||||
|
||||
@ -4,9 +4,9 @@ Installer wallabag
|
||||
Pré-requis
|
||||
------------
|
||||
|
||||
wallabag est compatible avec php >= 5.5
|
||||
wallabag est compatible avec PHP >= 5.5, PHP 7 inclus.
|
||||
|
||||
Vous aurez besoin des extensions suivantes pour que wallabag fonctionne. Il est possible que certaines de ces extensions soient déjà activées dans votre version de php, donc vous n'avez pas forcément besoin d'installer tous les paquets correspondants.
|
||||
Vous aurez besoin des extensions suivantes pour que wallabag fonctionne. Il est possible que certaines de ces extensions soient déjà activées dans votre version de PHP, donc vous n'avez pas forcément besoin d'installer tous les paquets correspondants.
|
||||
|
||||
- php-session
|
||||
- php-ctype
|
||||
@ -25,9 +25,9 @@ Vous aurez besoin des extensions suivantes pour que wallabag fonctionne. Il est
|
||||
|
||||
wallabag utilise PDO afin de se connecter à une base de données, donc vous aurez besoin d'une extension et d'un système de bases de données parmi :
|
||||
|
||||
- php-pdo_mysql
|
||||
- php-pdo_sqlite
|
||||
- php-pdo_pgsql
|
||||
- pdo_mysql
|
||||
- pdo_sqlite
|
||||
- pdo_pgsql
|
||||
|
||||
Installation
|
||||
------------
|
||||
@ -40,13 +40,16 @@ Installation de Composer :
|
||||
|
||||
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 :
|
||||
|
||||
::
|
||||
|
||||
SYMFONY_ENV=prod composer create-project wallabag/wallabag wallabag "2.0.0-beta.1" --no-dev
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.3
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
|
||||
Pour démarrer le serveur interne à php et vérifier que tout s'est installé correctement, vous pouvez exécuter :
|
||||
@ -57,6 +60,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
|
||||
|
||||
.. 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.
|
||||
|
||||
Installation avec Apache
|
||||
------------------------
|
||||
|
||||
@ -141,3 +147,7 @@ En imaginant que vous vouliez installer wallabag dans le dossier /var/www/wallab
|
||||
}
|
||||
|
||||
Après que vous ayez rechargé/redémarré Nginx, vous devriez pouvoir avoir accès à wallabag à l'adresse http://domain.tld.
|
||||
|
||||
.. note::
|
||||
|
||||
Si vous voulez importer un fichier important dans wallabag, vous devez ajouter cette ligne dans votre configuration nginx ``client_max_body_size XM; # allows file uploads up to X megabytes``.
|
||||
|
||||
@ -9,7 +9,7 @@ Si vous êtes sur un ordinateur de confiance et que vous souhaitez rester connec
|
||||
vous pouvez cocher la case ``Restez connecté`` : wallabag se souviendra de vous pour un an.
|
||||
|
||||
.. image:: ../../img/user/login_form.png
|
||||
:alt: Login form
|
||||
:alt: Formulaire de connexion
|
||||
:align: center
|
||||
|
||||
Foire aux questions
|
||||
|
||||
62
docs/fr/user/migration.rst
Normal file
62
docs/fr/user/migration.rst
Normal file
@ -0,0 +1,62 @@
|
||||
Migrer wallabag
|
||||
===============
|
||||
|
||||
Depuis wallabag 1.x
|
||||
-------------------
|
||||
|
||||
Si vous utilisiez wallabag v1.x, vous devez exporter vos données avant de migrer à wallabag v2.x, à cause du changement complet de l'application et de sa base de données. Sur votre ancienne instance de wallabag v1, vous pouvez exporter vos données en allant sur la page de configuration de l'application.
|
||||
|
||||
.. image:: ../../img/user/export_v1.png
|
||||
:alt: Export depuis wallabag v1
|
||||
:align: center
|
||||
|
||||
.. note::
|
||||
Si vous avez plusieurs comptes sur la même instance de wallabag, chaque utilisateur doit exporter ses données depuis wallabag v1 et les importer dans la v2.
|
||||
|
||||
.. note::
|
||||
S'il vous arrive des problèmes durant l'export ou l'import, n'hésitez pas à `demander de l'aide <https://www.wallabag.org/pages/support.html>`__.
|
||||
|
||||
Une fois que vous avez récupéré le fichier json contenant vos données, vous pouvez installer wallabag v2 si c'est nécessaire en suivant `la procédure standard <http://doc.wallabag.org/fr/v2/user/installation.html>`__.
|
||||
|
||||
Une fois que vous avez créé un compte utilisateur sur votre nouvelle instance de wallabag v2, rendez-vous dans la section `Import`. Vous devez choisir l'import depuis wallabag v1 puis sélectionner votre fichier json récupéré précédemment.
|
||||
|
||||
.. image:: ../../img/user/import_wallabagv1.png
|
||||
:alt: Import depuis wallabag v1
|
||||
:align: center
|
||||
|
||||
Import via via la ligne de commande (CLI)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Si vous avez accès à la ligne de commandes de votre serveur web, vous pouvez exécuter cette commande pour import votre fichier wallabag v1 :
|
||||
|
||||
::
|
||||
|
||||
bin/console wallabag:import-v1 1 ~/Downloads/wallabag-export-1-2016-04-05.json --env=prod
|
||||
|
||||
Remplacez les valeurs :
|
||||
|
||||
* ``1`` est l'identifiant de votre utilisateur en base (l'ID de votre premier utilisateur créé sur wallabag est 1)
|
||||
* ``~/Downloads/wallabag-export-1-2016-04-05.json`` est le chemin de votre export wallabag v1
|
||||
|
||||
Vous obtiendrez :
|
||||
|
||||
::
|
||||
|
||||
Start : 05-04-2016 11:36:07 ---
|
||||
403 imported
|
||||
0 already saved
|
||||
End : 05-04-2016 11:36:09 ---
|
||||
|
||||
Depuis wallabag 2.x
|
||||
-------------------
|
||||
|
||||
Depuis l'instance sur laquelle vous étiez, rendez-vous dans la section `Tous les articles`, puis exportez ces articles au format json.
|
||||
|
||||
.. image:: ../../img/user/export_v2.png
|
||||
:alt: Export depuis wallabag v2
|
||||
:align: center
|
||||
|
||||
Depuis votre nouvelle instance de wallabag, créez votre compte utilisateur puis cliquez sur le lien dans le menu pour accéder à l'import. Choisissez l'import depuis wallabag v2 puis sélectionnez votre fichier json pour l'uploader.
|
||||
|
||||
.. note::
|
||||
S'il vous arrive des problèmes durant l'export ou l'import, n'hésitez pas à `demander de l'aide <https://www.wallabag.org/pages/support.html>`__.
|
||||
BIN
docs/img/user/export_v1.png
Normal file
BIN
docs/img/user/export_v1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
docs/img/user/export_v2.png
Normal file
BIN
docs/img/user/export_v2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
docs/img/user/filters.png
Normal file
BIN
docs/img/user/filters.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/img/user/import_wallabagv1.png
Normal file
BIN
docs/img/user/import_wallabagv1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -1,55 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# wallabag documentation build configuration file, created by
|
||||
# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
extensions = []
|
||||
templates_path = ['_templates']
|
||||
source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
project = u'wallabag-pt'
|
||||
copyright = u'2013-2016, Nicolas Lœuillet - MIT Licence'
|
||||
version = '2.0.0'
|
||||
release = version
|
||||
exclude_patterns = ['_build']
|
||||
pygments_style = 'sphinx'
|
||||
html_theme = 'default'
|
||||
html_static_path = ['_static']
|
||||
htmlhelp_basename = 'wallabagfrdoc'
|
||||
|
||||
latex_elements = {
|
||||
}
|
||||
|
||||
latex_documents = [
|
||||
('index', 'wallabag-pt.tex', u'wallabag Documentation',
|
||||
u'Nicolas Lœuillet', 'manual'),
|
||||
]
|
||||
|
||||
man_pages = [
|
||||
('index', 'wallabagpt', u'wallabag Documentation',
|
||||
[u'Nicolas Lœuillet'], 1)
|
||||
]
|
||||
|
||||
texinfo_documents = [
|
||||
('index', 'wallabag', u'wallabag Documentation',
|
||||
u'Nicolas Lœuillet', 'wallabag', 'wallabag is an opensource read-it-later.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
##### Guzzle sphinx theme
|
||||
|
||||
import guzzle_sphinx_theme
|
||||
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
|
||||
html_theme_path = guzzle_sphinx_theme.html_theme_path()
|
||||
html_theme = 'guzzle_sphinx_theme'
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
html_sidebars = {
|
||||
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
|
||||
}
|
||||
|
||||
# Register the theme as an extension to generate a sitemap.xml
|
||||
extensions.append("guzzle_sphinx_theme")
|
||||
@ -1,36 +0,0 @@
|
||||
wallabag documentation
|
||||
======================
|
||||
|
||||
.. image:: ../img/wallabag.png
|
||||
:alt: wallabag logo
|
||||
:align: center
|
||||
|
||||
**wallabag** É uma aplicação "leia mais tarde": Ele salva páginas da web mantendo apenas o conteúdo. Elementos como ícones de navegação ou propaganda são deletedos.
|
||||
|
||||
A documentação principal desta aplicação é organizada em duas seções:
|
||||
|
||||
* :ref:`doc-usuario`
|
||||
* :ref:`doc-desenvolvedor`
|
||||
|
||||
.. _user-docs:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Documentação do usuário
|
||||
|
||||
user/criar_conta
|
||||
user/login
|
||||
user/configuração
|
||||
user/primeiro_artigo
|
||||
user/importar
|
||||
user/baixar_artigos
|
||||
user/filtros
|
||||
user/tags
|
||||
|
||||
.. _dev-docs:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Documentação do desenvolvedor
|
||||
|
||||
developer/docker
|
||||
@ -1,2 +0,0 @@
|
||||
Sphinx>=1.3.0,<1.4.0
|
||||
guzzle_sphinx_theme>=0.7.0,<0.8.0
|
||||
@ -30,7 +30,7 @@ class WallabagAnnotationController extends FOSRestController
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
|
||||
$total = count($annotationRows);
|
||||
$annotations = array('total' => $total, 'rows' => $annotationRows);
|
||||
$annotations = ['total' => $total, 'rows' => $annotationRows];
|
||||
|
||||
$json = $this->get('serializer')->serialize($annotations, 'json');
|
||||
|
||||
@ -141,6 +141,6 @@ class WallabagAnnotationController extends FOSRestController
|
||||
*/
|
||||
private function renderJsonResponse($json, $code = 200)
|
||||
{
|
||||
return new Response($json, $code, array('application/json'));
|
||||
return new Response($json, $code, ['application/json']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ class Annotation
|
||||
/*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(\Wallabag\UserBundle\Entity\User $user)
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
@ -204,7 +204,7 @@ class Annotation
|
||||
/**
|
||||
* Set user.
|
||||
*
|
||||
* @param string $user
|
||||
* @param User $user
|
||||
*
|
||||
* @return Annotation
|
||||
*/
|
||||
@ -218,7 +218,7 @@ class Annotation
|
||||
/**
|
||||
* Get user.
|
||||
*
|
||||
* @return string
|
||||
* @return User
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
|
||||
@ -88,4 +88,22 @@ class AnnotationRepository extends EntityRepository
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used only in test case to get the right annotation associated to the right user.
|
||||
*
|
||||
* @param string $username
|
||||
*
|
||||
* @return Annotation
|
||||
*/
|
||||
public function findOneByUsername($username)
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->leftJoin('a.user', 'u')
|
||||
->where('u.username = :username')->setParameter('username', $username)
|
||||
->orderBy('a.id', 'DESC')
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getSingleResult();
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,11 +11,12 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||
$annotation = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findOneBy(array('user' => 1));
|
||||
->findOneByUsername('admin');
|
||||
|
||||
if (!$annotation) {
|
||||
$this->markTestSkipped('No content found in db.');
|
||||
}
|
||||
|
||||
$this->logInAs('admin');
|
||||
$crawler = $this->client->request('GET', 'annotations/'.$annotation->getEntry()->getId().'.json');
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
@ -32,18 +33,25 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||
$entry = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneBy(array('user' => 1));
|
||||
->findOneByUsernameAndNotArchived('admin');
|
||||
|
||||
$headers = array('CONTENT_TYPE' => 'application/json');
|
||||
$content = json_encode(array(
|
||||
$headers = ['CONTENT_TYPE' => 'application/json'];
|
||||
$content = json_encode([
|
||||
'text' => 'my annotation',
|
||||
'quote' => 'my quote',
|
||||
'range' => '[{"start":"","startOffset":24,"end":"","endOffset":31}]',
|
||||
));
|
||||
$crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', array(), array(), $headers, $content);
|
||||
'ranges' => ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
|
||||
]);
|
||||
$crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', [], [], $headers, $content);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertEquals('Big boss', $content['user']);
|
||||
$this->assertEquals('v1.0', $content['annotator_schema_version']);
|
||||
$this->assertEquals('my annotation', $content['text']);
|
||||
$this->assertEquals('my quote', $content['quote']);
|
||||
|
||||
$annotation = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
@ -57,25 +65,56 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||
$annotation = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findOneBy(array('user' => 1));
|
||||
->findOneByUsername('admin');
|
||||
|
||||
$this->logInAs('admin');
|
||||
|
||||
$headers = array('CONTENT_TYPE' => 'application/json');
|
||||
$content = json_encode(array(
|
||||
$headers = ['CONTENT_TYPE' => 'application/json'];
|
||||
$content = json_encode([
|
||||
'text' => 'a modified annotation',
|
||||
));
|
||||
$crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content);
|
||||
]);
|
||||
$crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content);
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertEquals('Big boss', $content['user']);
|
||||
$this->assertEquals('v1.0', $content['annotator_schema_version']);
|
||||
$this->assertEquals('a modified annotation', $content['text']);
|
||||
$this->assertEquals('my quote', $content['quote']);
|
||||
|
||||
$annotationUpdated = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findOneById($annotation->getId());
|
||||
$this->assertEquals('a modified annotation', $annotationUpdated->getText());
|
||||
}
|
||||
|
||||
public function testDeleteAnnotation()
|
||||
{
|
||||
$annotation = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findOneByUsername('admin');
|
||||
|
||||
$this->logInAs('admin');
|
||||
|
||||
$headers = ['CONTENT_TYPE' => 'application/json'];
|
||||
$content = json_encode([
|
||||
'text' => 'a modified annotation',
|
||||
]);
|
||||
$crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content);
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertEquals('a modified annotation', $content['text']);
|
||||
|
||||
$annotationUpdated = $this->client->getContainer()
|
||||
$annotationDeleted = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
||||
->findAnnotationById($annotation->getId());
|
||||
$this->assertEquals('a modified annotation', $annotationUpdated->getText());
|
||||
->findOneById($annotation->getId());
|
||||
|
||||
$this->assertNull($annotationDeleted);
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,10 +26,10 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
|
||||
{
|
||||
$crawler = $this->client->request('GET', '/login');
|
||||
$form = $crawler->filter('button[type=submit]')->form();
|
||||
$data = array(
|
||||
$data = [
|
||||
'_username' => $username,
|
||||
'_password' => 'mypassword',
|
||||
);
|
||||
];
|
||||
|
||||
$this->client->submit($form, $data);
|
||||
}
|
||||
@ -48,7 +48,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
|
||||
$loginManager = $container->get('fos_user.security.login_manager');
|
||||
$firewallName = $container->getParameter('fos_user.firewall_name');
|
||||
|
||||
$this->user = $userManager->findUserBy(array('username' => 'admin'));
|
||||
$this->user = $userManager->findUserBy(['username' => 'admin']);
|
||||
$loginManager->loginUser($firewallName, $this->user);
|
||||
|
||||
// save the login token into the session and put it in a cookie
|
||||
|
||||
@ -27,13 +27,13 @@ class WallabagRestController extends FOSRestController
|
||||
*
|
||||
* @ApiDoc(
|
||||
* parameters={
|
||||
* {"name"="archive", "dataType"="boolean", "required"=false, "format"="true or false, all entries by default", "description"="filter by archived status."},
|
||||
* {"name"="star", "dataType"="boolean", "required"=false, "format"="true or false, all entries by default", "description"="filter by starred status."},
|
||||
* {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."},
|
||||
* {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."},
|
||||
* {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated', default 'created'", "description"="sort entries by date."},
|
||||
* {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."},
|
||||
* {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."},
|
||||
* {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."},
|
||||
* {"name"="tags", "dataType"="string", "required"=false, "format"="api%2Crest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."},
|
||||
* {"name"="tags", "dataType"="string", "required"=false, "format"="api,rest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."},
|
||||
* }
|
||||
* )
|
||||
*
|
||||
@ -43,8 +43,8 @@ class WallabagRestController extends FOSRestController
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$isArchived = $request->query->get('archive');
|
||||
$isStarred = $request->query->get('star');
|
||||
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
||||
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
|
||||
$sort = $request->query->get('sort', 'created');
|
||||
$order = $request->query->get('order', 'desc');
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
@ -97,6 +97,8 @@ class WallabagRestController extends FOSRestController
|
||||
* {"name"="url", "dataType"="string", "required"=true, "format"="http://www.test.com/article.html", "description"="Url for the entry."},
|
||||
* {"name"="title", "dataType"="string", "required"=false, "description"="Optional, we'll get the title from the page."},
|
||||
* {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
|
||||
* {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="entry already starred"},
|
||||
* {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="entry already archived"},
|
||||
* }
|
||||
* )
|
||||
*
|
||||
@ -107,19 +109,34 @@ class WallabagRestController extends FOSRestController
|
||||
$this->validateAuthentication();
|
||||
|
||||
$url = $request->request->get('url');
|
||||
$isArchived = (int) $request->request->get('archive');
|
||||
$isStarred = (int) $request->request->get('starred');
|
||||
|
||||
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
|
||||
new Entry($this->getUser()),
|
||||
$url
|
||||
);
|
||||
$entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
|
||||
|
||||
if (false === $entry) {
|
||||
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
|
||||
new Entry($this->getUser()),
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
$tags = $request->request->get('tags', '');
|
||||
if (!empty($tags)) {
|
||||
$this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
|
||||
}
|
||||
|
||||
if (!is_null($isStarred)) {
|
||||
$entry->setStarred((bool) $isStarred);
|
||||
}
|
||||
|
||||
if (!is_null($isArchived)) {
|
||||
$entry->setArchived((bool) $isArchived);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entry);
|
||||
|
||||
$em->flush();
|
||||
|
||||
$json = $this->get('serializer')->serialize($entry, 'json');
|
||||
@ -137,8 +154,8 @@ class WallabagRestController extends FOSRestController
|
||||
* parameters={
|
||||
* {"name"="title", "dataType"="string", "required"=false},
|
||||
* {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
|
||||
* {"name"="archive", "dataType"="boolean", "required"=false, "format"="true or false", "description"="archived the entry."},
|
||||
* {"name"="star", "dataType"="boolean", "required"=false, "format"="true or false", "description"="starred the entry."},
|
||||
* {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="archived the entry."},
|
||||
* {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0", "description"="starred the entry."},
|
||||
* }
|
||||
* )
|
||||
*
|
||||
@ -150,19 +167,19 @@ class WallabagRestController extends FOSRestController
|
||||
$this->validateUserAccess($entry->getUser()->getId());
|
||||
|
||||
$title = $request->request->get('title');
|
||||
$isArchived = $request->request->get('archive');
|
||||
$isStarred = $request->request->get('star');
|
||||
$isArchived = (int) $request->request->get('archive');
|
||||
$isStarred = (int) $request->request->get('starred');
|
||||
|
||||
if (!is_null($title)) {
|
||||
$entry->setTitle($title);
|
||||
}
|
||||
|
||||
if (!is_null($isArchived)) {
|
||||
$entry->setArchived($isArchived);
|
||||
$entry->setArchived((bool) $isArchived);
|
||||
}
|
||||
|
||||
if (!is_null($isStarred)) {
|
||||
$entry->setStarred($isStarred);
|
||||
$entry->setStarred((bool) $isStarred);
|
||||
}
|
||||
|
||||
$tags = $request->request->get('tags', '');
|
||||
@ -327,6 +344,21 @@ class WallabagRestController extends FOSRestController
|
||||
|
||||
return $this->renderJsonResponse($json);
|
||||
}
|
||||
/**
|
||||
* Retrieve version number.
|
||||
*
|
||||
* @ApiDoc()
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getVersionAction()
|
||||
{
|
||||
$version = $this->container->getParameter('wallabag_core.version');
|
||||
|
||||
$json = $this->get('serializer')->serialize($version, 'json');
|
||||
|
||||
return $this->renderJsonResponse($json);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that the first id is equal to the second one.
|
||||
@ -352,6 +384,6 @@ class WallabagRestController extends FOSRestController
|
||||
*/
|
||||
private function renderJsonResponse($json)
|
||||
{
|
||||
return new Response($json, 200, array('application/json'));
|
||||
return new Response($json, 200, ['application/json']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
$entry = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneBy(array('user' => 1, 'isArchived' => false));
|
||||
->findOneBy(['user' => 1, 'isArchived' => false]);
|
||||
|
||||
if (!$entry) {
|
||||
$this->markTestSkipped('No content found in db.');
|
||||
@ -27,6 +27,9 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
$this->assertEquals($entry->getTitle(), $content['title']);
|
||||
$this->assertEquals($entry->getUrl(), $content['url']);
|
||||
$this->assertCount(count($entry->getTags()), $content['tags']);
|
||||
$this->assertEquals($entry->getUserName(), $content['user_name']);
|
||||
$this->assertEquals($entry->getUserEmail(), $content['user_email']);
|
||||
$this->assertEquals($entry->getUserId(), $content['user_id']);
|
||||
|
||||
$this->assertTrue(
|
||||
$this->client->getResponse()->headers->contains(
|
||||
@ -41,7 +44,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
$entry = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneBy(array('user' => 2, 'isArchived' => false));
|
||||
->findOneBy(['user' => 2, 'isArchived' => false]);
|
||||
|
||||
if (!$entry) {
|
||||
$this->markTestSkipped('No content found in db.');
|
||||
@ -76,7 +79,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testGetStarredEntries()
|
||||
{
|
||||
$this->client->request('GET', '/api/entries', array('star' => 1, 'sort' => 'updated'));
|
||||
$this->client->request('GET', '/api/entries', ['star' => 1, 'sort' => 'updated']);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
@ -98,7 +101,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testGetArchiveEntries()
|
||||
{
|
||||
$this->client->request('GET', '/api/entries', array('archive' => 1));
|
||||
$this->client->request('GET', '/api/entries', ['archive' => 1]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
@ -146,10 +149,10 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
public function testPostEntry()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', array(
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
'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',
|
||||
));
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
@ -159,9 +162,66 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
$this->assertEquals('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', $content['url']);
|
||||
$this->assertEquals(false, $content['is_archived']);
|
||||
$this->assertEquals(false, $content['is_starred']);
|
||||
$this->assertEquals(1, $content['user_id']);
|
||||
$this->assertCount(1, $content['tags']);
|
||||
}
|
||||
|
||||
public function testPostSameEntry()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
'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',
|
||||
'tags' => 'google, apple',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertGreaterThan(0, $content['id']);
|
||||
$this->assertEquals('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', $content['url']);
|
||||
$this->assertEquals(true, $content['is_archived']);
|
||||
$this->assertEquals(false, $content['is_starred']);
|
||||
$this->assertCount(2, $content['tags']);
|
||||
}
|
||||
|
||||
public function testPostArchivedAndStarredEntry()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
|
||||
'archive' => '1',
|
||||
'starred' => '1',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertGreaterThan(0, $content['id']);
|
||||
$this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
|
||||
$this->assertEquals(true, $content['is_archived']);
|
||||
$this->assertEquals(true, $content['is_starred']);
|
||||
$this->assertEquals(1, $content['user_id']);
|
||||
}
|
||||
|
||||
public function testPostArchivedAndStarredEntryWithoutQuotes()
|
||||
{
|
||||
$this->client->request('POST', '/api/entries.json', [
|
||||
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
|
||||
'archive' => 0,
|
||||
'starred' => 1,
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertGreaterThan(0, $content['id']);
|
||||
$this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
|
||||
$this->assertEquals(false, $content['is_archived']);
|
||||
$this->assertEquals(true, $content['is_starred']);
|
||||
}
|
||||
|
||||
public function testPatchEntry()
|
||||
{
|
||||
$entry = $this->client->getContainer()
|
||||
@ -176,12 +236,44 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
// hydrate the tags relations
|
||||
$nbTags = count($entry->getTags());
|
||||
|
||||
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
|
||||
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [
|
||||
'title' => 'New awesome title',
|
||||
'tags' => 'new tag '.uniqid(),
|
||||
'star' => true,
|
||||
'archive' => false,
|
||||
));
|
||||
'starred' => '1',
|
||||
'archive' => '0',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertEquals($entry->getId(), $content['id']);
|
||||
$this->assertEquals($entry->getUrl(), $content['url']);
|
||||
$this->assertEquals('New awesome title', $content['title']);
|
||||
$this->assertGreaterThan($nbTags, count($content['tags']));
|
||||
$this->assertEquals(1, $content['user_id']);
|
||||
}
|
||||
|
||||
public function testPatchEntryWithoutQuotes()
|
||||
{
|
||||
$entry = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneByUser(1);
|
||||
|
||||
if (!$entry) {
|
||||
$this->markTestSkipped('No content found in db.');
|
||||
}
|
||||
|
||||
// hydrate the tags relations
|
||||
$nbTags = count($entry->getTags());
|
||||
|
||||
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [
|
||||
'title' => 'New awesome title',
|
||||
'tags' => 'new tag '.uniqid(),
|
||||
'starred' => 1,
|
||||
'archive' => 0,
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
@ -206,9 +298,9 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
$this->markTestSkipped('No content found in db.');
|
||||
}
|
||||
|
||||
$tags = array();
|
||||
$tags = [];
|
||||
foreach ($entry->getTags() as $tag) {
|
||||
$tags[] = array('id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug());
|
||||
$tags[] = ['id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug()];
|
||||
}
|
||||
|
||||
$this->client->request('GET', '/api/entries/'.$entry->getId().'/tags');
|
||||
@ -231,7 +323,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
$newTags = 'tag1,tag2,tag3';
|
||||
|
||||
$this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', array('tags' => $newTags));
|
||||
$this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', ['tags' => $newTags]);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
@ -245,7 +337,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->find($entry->getId());
|
||||
|
||||
$tagsInDB = array();
|
||||
$tagsInDB = [];
|
||||
foreach ($entryDB->getTags()->toArray() as $tag) {
|
||||
$tagsInDB[$tag->getId()] = $tag->getLabel();
|
||||
}
|
||||
@ -318,4 +410,15 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||
|
||||
$this->assertCount(0, $entries);
|
||||
}
|
||||
|
||||
public function testGetVersion()
|
||||
{
|
||||
$this->client->request('GET', '/api/version');
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertEquals($this->client->getContainer()->getParameter('wallabag_core.version'), $content);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ abstract class WallabagApiTestCase extends WebTestCase
|
||||
$loginManager = $container->get('fos_user.security.login_manager');
|
||||
$firewallName = $container->getParameter('fos_user.firewall_name');
|
||||
|
||||
$this->user = $userManager->findUserBy(array('username' => 'admin'));
|
||||
$this->user = $userManager->findUserBy(['username' => 'admin']);
|
||||
$loginManager->loginUser($firewallName, $this->user);
|
||||
|
||||
// save the login token into the session and put it in a cookie
|
||||
|
||||
@ -60,6 +60,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
->checkRequirements()
|
||||
->setupDatabase()
|
||||
->setupAdmin()
|
||||
->setupConfig()
|
||||
->setupAsset()
|
||||
;
|
||||
|
||||
@ -69,40 +70,40 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
protected function checkRequirements()
|
||||
{
|
||||
$this->defaultOutput->writeln('<info><comment>Step 1 of 4.</comment> Checking system requirements.</info>');
|
||||
$this->defaultOutput->writeln('<info><comment>Step 1 of 5.</comment> Checking system requirements.</info>');
|
||||
|
||||
$fulfilled = true;
|
||||
|
||||
$label = '<comment>PDO Drivers</comment>';
|
||||
if (extension_loaded('pdo_sqlite') || extension_loaded('pdo_mysql') || extension_loaded('pdo_pgsql')) {
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
} else {
|
||||
$label = '<comment>PDO Driver</comment>';
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
if (!extension_loaded($this->getContainer()->getParameter('database_driver'))) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'Needs one of sqlite, mysql or pgsql PDO drivers';
|
||||
$help = 'Database driver "'.$this->getContainer()->getParameter('database_driver').'" is not installed.';
|
||||
}
|
||||
|
||||
$rows[] = array($label, $status, $help);
|
||||
$rows = [];
|
||||
$rows[] = [$label, $status, $help];
|
||||
|
||||
foreach ($this->functionExists as $functionRequired) {
|
||||
$label = '<comment>'.$functionRequired.'</comment>';
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
if (function_exists($functionRequired)) {
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
} else {
|
||||
if (!function_exists($functionRequired)) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'You need the '.$functionRequired.' function activated';
|
||||
}
|
||||
|
||||
$rows[] = array($label, $status, $help);
|
||||
$rows[] = [$label, $status, $help];
|
||||
}
|
||||
|
||||
$table = new Table($this->defaultOutput);
|
||||
$table
|
||||
->setHeaders(array('Checked', 'Status', 'Recommendation'))
|
||||
->setHeaders(['Checked', 'Status', 'Recommendation'])
|
||||
->setRows($rows)
|
||||
->render();
|
||||
|
||||
@ -119,14 +120,14 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
protected function setupDatabase()
|
||||
{
|
||||
$this->defaultOutput->writeln('<info><comment>Step 2 of 4.</comment> Setting up database.</info>');
|
||||
$this->defaultOutput->writeln('<info><comment>Step 2 of 5.</comment> Setting up database.</info>');
|
||||
|
||||
// user want to reset everything? Don't care about what is already here
|
||||
if (true === $this->defaultInput->getOption('reset')) {
|
||||
$this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache');
|
||||
|
||||
$this
|
||||
->runCommand('doctrine:database:drop', array('--force' => true))
|
||||
->runCommand('doctrine:database:drop', ['--force' => true])
|
||||
->runCommand('doctrine:database:create')
|
||||
->runCommand('doctrine:schema:create')
|
||||
->runCommand('cache:clear')
|
||||
@ -158,7 +159,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
$this->defaultOutput->writeln('Droping database, creating database and schema');
|
||||
|
||||
$this
|
||||
->runCommand('doctrine:database:drop', array('--force' => true))
|
||||
->runCommand('doctrine:database:drop', ['--force' => true])
|
||||
->runCommand('doctrine:database:create')
|
||||
->runCommand('doctrine:schema:create')
|
||||
;
|
||||
@ -168,7 +169,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
$this->defaultOutput->writeln('Droping schema and creating schema');
|
||||
|
||||
$this
|
||||
->runCommand('doctrine:schema:drop', array('--force' => true))
|
||||
->runCommand('doctrine:schema:drop', ['--force' => true])
|
||||
->runCommand('doctrine:schema:create')
|
||||
;
|
||||
}
|
||||
@ -190,7 +191,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
protected function setupAdmin()
|
||||
{
|
||||
$this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>');
|
||||
$this->defaultOutput->writeln('<info><comment>Step 3 of 5.</comment> Administration setup.</info>');
|
||||
|
||||
$questionHelper = $this->getHelperSet()->get('question');
|
||||
$question = new ConfirmationQuestion('Would you like to create a new admin user (recommended) ? (Y/n)', true);
|
||||
@ -222,19 +223,25 @@ class InstallCommand extends ContainerAwareCommand
|
||||
$config->setTheme($this->getContainer()->getParameter('wallabag_core.theme'));
|
||||
$config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page'));
|
||||
$config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit'));
|
||||
$config->setReadingSpeed($this->getContainer()->getParameter('wallabag_core.reading_speed'));
|
||||
$config->setLanguage($this->getContainer()->getParameter('wallabag_core.language'));
|
||||
|
||||
$em->persist($config);
|
||||
|
||||
$this->defaultOutput->writeln('');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function setupConfig()
|
||||
{
|
||||
$this->defaultOutput->writeln('<info><comment>Step 4 of 5.</comment> Config setup.</info>');
|
||||
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
|
||||
|
||||
// cleanup before insert new stuff
|
||||
$em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute();
|
||||
|
||||
$settings = [
|
||||
[
|
||||
'name' => 'download_pictures',
|
||||
'value' => '1',
|
||||
'section' => 'entry',
|
||||
],
|
||||
[
|
||||
'name' => 'carrot',
|
||||
'value' => '1',
|
||||
@ -369,7 +376,7 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
protected function setupAsset()
|
||||
{
|
||||
$this->defaultOutput->writeln('<info><comment>Step 4 of 4.</comment> Installing assets.</info>');
|
||||
$this->defaultOutput->writeln('<info><comment>Step 5 of 5.</comment> Installing assets.</info>');
|
||||
|
||||
$this
|
||||
->runCommand('assets:install')
|
||||
@ -387,19 +394,19 @@ class InstallCommand extends ContainerAwareCommand
|
||||
* @param string $command
|
||||
* @param array $parameters Parameters to this command (usually 'force' => true)
|
||||
*/
|
||||
protected function runCommand($command, $parameters = array())
|
||||
protected function runCommand($command, $parameters = [])
|
||||
{
|
||||
$parameters = array_merge(
|
||||
array('command' => $command),
|
||||
['command' => $command],
|
||||
$parameters,
|
||||
array(
|
||||
[
|
||||
'--no-debug' => true,
|
||||
'--env' => $this->defaultInput->getOption('env') ?: 'dev',
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
if ($this->defaultInput->getOption('no-interaction')) {
|
||||
$parameters = array_merge($parameters, array('--no-interaction' => true));
|
||||
$parameters = array_merge($parameters, ['--no-interaction' => true]);
|
||||
}
|
||||
|
||||
$this->getApplication()->setAutoExit(false);
|
||||
@ -459,7 +466,13 @@ class InstallCommand extends ContainerAwareCommand
|
||||
return false;
|
||||
}
|
||||
|
||||
return in_array($databaseName, $schemaManager->listDatabases());
|
||||
try {
|
||||
return in_array($databaseName, $schemaManager->listDatabases());
|
||||
} catch (\Doctrine\DBAL\Exception\DriverException $e) {
|
||||
// it means we weren't able to get database list, assume the database doesn't exist
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -16,7 +16,6 @@ use Wallabag\CoreBundle\Form\Type\RssType;
|
||||
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
|
||||
use Wallabag\CoreBundle\Form\Type\UserInformationType;
|
||||
use Wallabag\CoreBundle\Tools\Utils;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class ConfigController extends Controller
|
||||
{
|
||||
@ -33,7 +32,7 @@ class ConfigController extends Controller
|
||||
$user = $this->getUser();
|
||||
|
||||
// handle basic config detail (this form is defined as a service)
|
||||
$configForm = $this->createForm(ConfigType::class, $config, array('action' => $this->generateUrl('config')));
|
||||
$configForm = $this->createForm(ConfigType::class, $config, ['action' => $this->generateUrl('config')]);
|
||||
$configForm->handleRequest($request);
|
||||
|
||||
if ($configForm->isValid()) {
|
||||
@ -46,21 +45,21 @@ class ConfigController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Config saved. Some parameters will be considered after disconnection.'
|
||||
'flashes.config.notice.config_saved'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config'));
|
||||
}
|
||||
|
||||
// handle changing password
|
||||
$pwdForm = $this->createForm(ChangePasswordType::class, null, array('action' => $this->generateUrl('config').'#set4'));
|
||||
$pwdForm = $this->createForm(ChangePasswordType::class, null, ['action' => $this->generateUrl('config').'#set4']);
|
||||
$pwdForm->handleRequest($request);
|
||||
|
||||
if ($pwdForm->isValid()) {
|
||||
if ($this->get('craue_config')->get('demo_mode_enabled') && $this->get('craue_config')->get('demo_mode_username') === $user->getUsername()) {
|
||||
$message = 'In demonstration mode, you can\'t change password for this user.';
|
||||
$message = 'flashes.config.notice.password_not_updated_demo';
|
||||
} else {
|
||||
$message = 'Password updated';
|
||||
$message = 'flashes.config.notice.password_updated';
|
||||
|
||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||
$userManager->updateUser($user, true);
|
||||
@ -72,10 +71,10 @@ class ConfigController extends Controller
|
||||
}
|
||||
|
||||
// handle changing user information
|
||||
$userForm = $this->createForm(UserInformationType::class, $user, array(
|
||||
'validation_groups' => array('Profile'),
|
||||
$userForm = $this->createForm(UserInformationType::class, $user, [
|
||||
'validation_groups' => ['Profile'],
|
||||
'action' => $this->generateUrl('config').'#set3',
|
||||
));
|
||||
]);
|
||||
$userForm->handleRequest($request);
|
||||
|
||||
if ($userForm->isValid()) {
|
||||
@ -83,14 +82,14 @@ class ConfigController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Information updated'
|
||||
'flashes.config.notice.user_updated'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set3');
|
||||
}
|
||||
|
||||
// handle rss information
|
||||
$rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2'));
|
||||
$rssForm = $this->createForm(RssType::class, $config, ['action' => $this->generateUrl('config').'#set2']);
|
||||
$rssForm->handleRequest($request);
|
||||
|
||||
if ($rssForm->isValid()) {
|
||||
@ -99,7 +98,7 @@ class ConfigController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'RSS information updated'
|
||||
'flashes.config.notice.rss_updated'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set2');
|
||||
@ -107,7 +106,7 @@ class ConfigController extends Controller
|
||||
|
||||
// handle tagging rule
|
||||
$taggingRule = new TaggingRule();
|
||||
$newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
|
||||
$newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, ['action' => $this->generateUrl('config').'#set5']);
|
||||
$newTaggingRule->handleRequest($request);
|
||||
|
||||
if ($newTaggingRule->isValid()) {
|
||||
@ -117,7 +116,7 @@ class ConfigController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Tagging rules updated'
|
||||
'flashes.config.notice.tagging_rules_updated'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set5');
|
||||
@ -127,10 +126,10 @@ class ConfigController extends Controller
|
||||
$newUser = $userManager->createUser();
|
||||
// enable created user by default
|
||||
$newUser->setEnabled(true);
|
||||
$newUserForm = $this->createForm(NewUserType::class, $newUser, array(
|
||||
'validation_groups' => array('Profile'),
|
||||
$newUserForm = $this->createForm(NewUserType::class, $newUser, [
|
||||
'validation_groups' => ['Profile'],
|
||||
'action' => $this->generateUrl('config').'#set6',
|
||||
));
|
||||
]);
|
||||
$newUserForm->handleRequest($request);
|
||||
|
||||
if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
|
||||
@ -148,27 +147,27 @@ class ConfigController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
$this->get('translator')->trans('User "%username%" added', array('%username%' => $newUser->getUsername()))
|
||||
$this->get('translator')->trans('flashes.config.notice.user_added', ['%username%' => $newUser->getUsername()])
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set6');
|
||||
}
|
||||
|
||||
return $this->render('WallabagCoreBundle:Config:index.html.twig', array(
|
||||
'form' => array(
|
||||
return $this->render('WallabagCoreBundle:Config:index.html.twig', [
|
||||
'form' => [
|
||||
'config' => $configForm->createView(),
|
||||
'rss' => $rssForm->createView(),
|
||||
'pwd' => $pwdForm->createView(),
|
||||
'user' => $userForm->createView(),
|
||||
'new_user' => $newUserForm->createView(),
|
||||
'new_tagging_rule' => $newTaggingRule->createView(),
|
||||
),
|
||||
'rss' => array(
|
||||
],
|
||||
'rss' => [
|
||||
'username' => $user->getUsername(),
|
||||
'token' => $config->getRssToken(),
|
||||
),
|
||||
],
|
||||
'twofactor_auth' => $this->getParameter('twofactor_auth'),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,12 +187,12 @@ class ConfigController extends Controller
|
||||
$em->flush();
|
||||
|
||||
if ($request->isXmlHttpRequest()) {
|
||||
return new JsonResponse(array('token' => $config->getRssToken()));
|
||||
return new JsonResponse(['token' => $config->getRssToken()]);
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'RSS token updated'
|
||||
'flashes.config.notice.rss_token_updated'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set2');
|
||||
@ -211,7 +210,7 @@ class ConfigController extends Controller
|
||||
public function deleteTaggingRuleAction(TaggingRule $rule)
|
||||
{
|
||||
if ($this->getUser()->getId() != $rule->getConfig()->getUser()->getId()) {
|
||||
throw $this->createAccessDeniedException('You can not access this tagging ryle.');
|
||||
throw $this->createAccessDeniedException('You can not access this tagging rule.');
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
@ -220,7 +219,7 @@ class ConfigController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Tagging rule deleted'
|
||||
'flashes.config.notice.tagging_rules_deleted'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('config').'#set5');
|
||||
@ -230,7 +229,7 @@ class ConfigController extends Controller
|
||||
* Retrieve config for the current user.
|
||||
* If no config were found, create a new one.
|
||||
*
|
||||
* @return Wallabag\CoreBundle\Entity\Config
|
||||
* @return Config
|
||||
*/
|
||||
private function getConfig()
|
||||
{
|
||||
|
||||
100
src/Wallabag/CoreBundle/Controller/DeveloperController.php
Normal file
100
src/Wallabag/CoreBundle/Controller/DeveloperController.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Wallabag\ApiBundle\Entity\Client;
|
||||
use Wallabag\CoreBundle\Form\Type\ClientType;
|
||||
|
||||
class DeveloperController extends Controller
|
||||
{
|
||||
/**
|
||||
* List all clients and link to create a new one.
|
||||
*
|
||||
* @Route("/developer", name="developer")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findAll();
|
||||
|
||||
return $this->render('WallabagCoreBundle:Developer:index.html.twig', [
|
||||
'clients' => $clients,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a client (an app).
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @Route("/developer/client/create", name="developer_create_client")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function createClientAction(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$client = new Client();
|
||||
$clientForm = $this->createForm(ClientType::class, $client);
|
||||
$clientForm->handleRequest($request);
|
||||
|
||||
if ($clientForm->isValid()) {
|
||||
$client->setAllowedGrantTypes(['token', 'authorization_code', 'password', 'refresh_token']);
|
||||
$em->persist($client);
|
||||
$em->flush();
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'flashes.developer.notice.client_created'
|
||||
);
|
||||
|
||||
return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', [
|
||||
'client_id' => $client->getPublicId(),
|
||||
'client_secret' => $client->getSecret(),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->render('WallabagCoreBundle:Developer:client.html.twig', [
|
||||
'form' => $clientForm->createView(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a client.
|
||||
*
|
||||
* @param Client $client
|
||||
*
|
||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function deleteClientAction(Client $client)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($client);
|
||||
$em->flush();
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'flashes.developer.notice.client_deleted'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('developer'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display developer how to use an existing app.
|
||||
*
|
||||
* @Route("/developer/howto/first-app", name="developer_howto_firstapp")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function howtoFirstAppAction()
|
||||
{
|
||||
return $this->render('WallabagCoreBundle:Developer:howto_app.html.twig');
|
||||
}
|
||||
}
|
||||
@ -49,30 +49,29 @@ class EntryController extends Controller
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
// check for existing entry, if it exists, redirect to it with a message
|
||||
$existingEntry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
|
||||
$existingEntry = $this->checkIfEntryAlreadyExists($entry);
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry already saved on '.$existingEntry->getCreatedAt()->format('d-m-Y')
|
||||
$this->get('translator')->trans('flashes.entry.notice.entry_already_saved', ['%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')])
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', array('id' => $existingEntry->getId())));
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $existingEntry->getId()]));
|
||||
}
|
||||
|
||||
$this->updateEntry($entry);
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry saved'
|
||||
'flashes.entry.notice.entry_saved'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('homepage'));
|
||||
}
|
||||
|
||||
return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', array(
|
||||
return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,19 +85,20 @@ class EntryController extends Controller
|
||||
{
|
||||
$entry = new Entry($this->getUser());
|
||||
$entry->setUrl($request->get('url'));
|
||||
$this->updateEntry($entry);
|
||||
|
||||
if (false === $this->checkIfEntryAlreadyExists($entry)) {
|
||||
$this->updateEntry($entry);
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('homepage'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @Route("/new", name="new")
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function addEntryAction(Request $request)
|
||||
public function addEntryAction()
|
||||
{
|
||||
return $this->render('WallabagCoreBundle:Entry:new.html.twig');
|
||||
}
|
||||
@ -128,15 +128,15 @@ class EntryController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry updated'
|
||||
'flashes.entry.notice.entry_updated'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
||||
return $this->render('WallabagCoreBundle:Entry:edit.html.twig', array(
|
||||
return $this->render('WallabagCoreBundle:Entry:edit.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,17 +257,17 @@ class EntryController extends Controller
|
||||
$entries->setCurrentPage($page);
|
||||
} catch (OutOfRangeCurrentPageException $e) {
|
||||
if ($page > 1) {
|
||||
return $this->redirect($this->generateUrl($type, array('page' => $entries->getNbPages())), 302);
|
||||
return $this->redirect($this->generateUrl($type, ['page' => $entries->getNbPages()]), 302);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entries.html.twig',
|
||||
array(
|
||||
[
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page,
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ class EntryController extends Controller
|
||||
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Entry:entry.html.twig',
|
||||
array('entry' => $entry)
|
||||
['entry' => $entry]
|
||||
);
|
||||
}
|
||||
|
||||
@ -304,9 +304,9 @@ class EntryController extends Controller
|
||||
{
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
$message = 'Entry reloaded';
|
||||
$message = 'flashes.entry.notice.entry_reloaded';
|
||||
if (false === $this->updateEntry($entry)) {
|
||||
$message = 'Failed to reload entry';
|
||||
$message = 'flashes.entry.notice.entry_reload_failed';
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
@ -314,7 +314,7 @@ class EntryController extends Controller
|
||||
$message
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -334,12 +334,19 @@ class EntryController extends Controller
|
||||
$entry->toggleArchive();
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
$message = 'flashes.entry.notice.entry_unarchived';
|
||||
if ($entry->isArchived()) {
|
||||
$message = 'flashes.entry.notice.entry_archived';
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry '.($entry->isArchived() ? 'archived' : 'unarchived')
|
||||
$message
|
||||
);
|
||||
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -359,12 +366,19 @@ class EntryController extends Controller
|
||||
$entry->toggleStar();
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
$message = 'flashes.entry.notice.entry_unstarred';
|
||||
if ($entry->isStarred()) {
|
||||
$message = 'flashes.entry.notice.entry_starred';
|
||||
}
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry '.($entry->isStarred() ? 'starred' : 'unstarred')
|
||||
$message
|
||||
);
|
||||
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -384,7 +398,7 @@ class EntryController extends Controller
|
||||
// to avoid redirecting to the deleted entry. Ugh.
|
||||
$url = $this->generateUrl(
|
||||
'view',
|
||||
array('id' => $entry->getId()),
|
||||
['id' => $entry->getId()],
|
||||
UrlGeneratorInterface::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
@ -394,11 +408,15 @@ class EntryController extends Controller
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Entry deleted'
|
||||
'flashes.entry.notice.entry_deleted'
|
||||
);
|
||||
|
||||
// don't redirect user to the deleted entry
|
||||
return $this->redirect($url !== $request->headers->get('referer') ? $request->headers->get('referer') : $this->generateUrl('homepage'));
|
||||
$to = ($url !== $request->headers->get('referer') ? $request->headers->get('referer') : null);
|
||||
|
||||
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($to);
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -412,4 +430,16 @@ class EntryController extends Controller
|
||||
throw $this->createAccessDeniedException('You can not access this entry.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for existing entry, if it exists, redirect to it with a message.
|
||||
*
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @return Entry|bool
|
||||
*/
|
||||
private function checkIfEntryAlreadyExists(Entry $entry)
|
||||
{
|
||||
return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,12 +16,15 @@ class ExportController extends Controller
|
||||
/**
|
||||
* Gets one entry content.
|
||||
*
|
||||
* @param Entry $entry
|
||||
* @param Entry $entry
|
||||
* @param string $format
|
||||
*
|
||||
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||
* "id": "\d+"
|
||||
* })
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function downloadEntryAction(Entry $entry, $format)
|
||||
{
|
||||
@ -38,10 +41,15 @@ class ExportController extends Controller
|
||||
/**
|
||||
* Export all entries for current user.
|
||||
*
|
||||
* @param string $format
|
||||
* @param string $category
|
||||
*
|
||||
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||
* "category": "all|unread|starred|archive"
|
||||
* })
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function downloadEntriesAction($format, $category)
|
||||
{
|
||||
|
||||
@ -87,9 +87,9 @@ class RssController extends Controller
|
||||
$perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit');
|
||||
$entries->setMaxPerPage($perPage);
|
||||
|
||||
return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
|
||||
return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', [
|
||||
'type' => $type,
|
||||
'entries' => $entries,
|
||||
));
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ class StaticController extends Controller
|
||||
{
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Static:howto.html.twig',
|
||||
array()
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
@ -25,10 +25,10 @@ class StaticController extends Controller
|
||||
{
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Static:about.html.twig',
|
||||
array(
|
||||
[
|
||||
'version' => $this->getParameter('wallabag_core.version'),
|
||||
'paypal_url' => $this->getParameter('wallabag_core.paypal_url'),
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ class StaticController extends Controller
|
||||
{
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Static:quickstart.html.twig',
|
||||
array()
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ class TagController extends Controller
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag")
|
||||
*
|
||||
@ -20,39 +21,31 @@ class TagController extends Controller
|
||||
*/
|
||||
public function addTagFormAction(Request $request, Entry $entry)
|
||||
{
|
||||
$tag = new Tag();
|
||||
$form = $this->createForm(NewTagType::class, $tag);
|
||||
$form = $this->createForm(NewTagType::class, new Tag());
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$existingTag = $this->getDoctrine()
|
||||
->getRepository('WallabagCoreBundle:Tag')
|
||||
->findOneByLabel($tag->getLabel());
|
||||
$this->get('wallabag_core.content_proxy')->assignTagsToEntry(
|
||||
$entry,
|
||||
$form->get('label')->getData()
|
||||
);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
if (is_null($existingTag)) {
|
||||
$entry->addTag($tag);
|
||||
$em->persist($tag);
|
||||
} elseif (!$existingTag->hasEntry($entry)) {
|
||||
$entry->addTag($existingTag);
|
||||
$em->persist($existingTag);
|
||||
}
|
||||
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
'notice',
|
||||
'Tag added'
|
||||
'flashes.tag.notice.tag_added'
|
||||
);
|
||||
|
||||
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
||||
return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', array(
|
||||
return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'entry' => $entry,
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +65,9 @@ class TagController extends Controller
|
||||
}
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -90,9 +85,9 @@ class TagController extends Controller
|
||||
|
||||
return $this->render(
|
||||
'WallabagCoreBundle:Tag:tags.html.twig',
|
||||
array(
|
||||
[
|
||||
'tags' => $tags,
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
||||
|
||||
$adminConfig->setTheme('material');
|
||||
$adminConfig->setItemsPerPage(30);
|
||||
$adminConfig->setReadingSpeed(1);
|
||||
$adminConfig->setLanguage('en');
|
||||
|
||||
$manager->persist($adminConfig);
|
||||
@ -34,6 +35,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
||||
$bobConfig = new Config($this->getReference('bob-user'));
|
||||
$bobConfig->setTheme('default');
|
||||
$bobConfig->setItemsPerPage(10);
|
||||
$bobConfig->setReadingSpeed(1);
|
||||
$bobConfig->setLanguage('fr');
|
||||
|
||||
$manager->persist($bobConfig);
|
||||
@ -43,6 +45,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
||||
$emptyConfig = new Config($this->getReference('empty-user'));
|
||||
$emptyConfig->setTheme('material');
|
||||
$emptyConfig->setItemsPerPage(10);
|
||||
$emptyConfig->setReadingSpeed(1);
|
||||
$emptyConfig->setLanguage('en');
|
||||
|
||||
$manager->persist($emptyConfig);
|
||||
|
||||
@ -15,11 +15,6 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
$settings = [
|
||||
[
|
||||
'name' => 'download_pictures',
|
||||
'value' => '1',
|
||||
'section' => 'entry',
|
||||
],
|
||||
[
|
||||
'name' => 'carrot',
|
||||
'value' => '1',
|
||||
|
||||
@ -16,14 +16,14 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter
|
||||
{
|
||||
$tr1 = new TaggingRule();
|
||||
$tr1->setRule('content matches "spurs"');
|
||||
$tr1->setTags(array('sport'));
|
||||
$tr1->setTags(['sport']);
|
||||
$tr1->setConfig($this->getReference('admin-config'));
|
||||
|
||||
$manager->persist($tr1);
|
||||
|
||||
$tr2 = new TaggingRule();
|
||||
$tr2->setRule('content matches "basket"');
|
||||
$tr2->setTags(array('sport'));
|
||||
$tr2->setTags(['sport']);
|
||||
$tr2->setConfig($this->getReference('admin-config'));
|
||||
|
||||
$manager->persist($tr2);
|
||||
|
||||
@ -29,6 +29,9 @@ class Configuration implements ConfigurationInterface
|
||||
->integerNode('rss_limit')
|
||||
->defaultValue(50)
|
||||
->end()
|
||||
->integerNode('reading_speed')
|
||||
->defaultValue(1)
|
||||
->end()
|
||||
->scalarNode('version')
|
||||
->end()
|
||||
->scalarNode('paypal_url')
|
||||
|
||||
@ -19,6 +19,7 @@ class WallabagCoreExtension extends Extension
|
||||
$container->setParameter('wallabag_core.theme', $config['theme']);
|
||||
$container->setParameter('wallabag_core.language', $config['language']);
|
||||
$container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
|
||||
$container->setParameter('wallabag_core.reading_speed', $config['reading_speed']);
|
||||
$container->setParameter('wallabag_core.version', $config['version']);
|
||||
$container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ class Config
|
||||
* @Assert\Range(
|
||||
* min = 1,
|
||||
* max = 100000,
|
||||
* maxMessage = "This will certainly kill the app"
|
||||
* maxMessage = "validator.item_per_page_too_high"
|
||||
* )
|
||||
* @ORM\Column(name="items_per_page", type="integer", nullable=false)
|
||||
*/
|
||||
@ -68,11 +68,18 @@ class Config
|
||||
* @Assert\Range(
|
||||
* min = 1,
|
||||
* max = 100000,
|
||||
* maxMessage = "This will certainly kill the app"
|
||||
* maxMessage = "validator.rss_limit_too_hight"
|
||||
* )
|
||||
*/
|
||||
private $rssLimit;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*
|
||||
* @ORM\Column(name="reading_speed", type="float", nullable=true)
|
||||
*/
|
||||
private $readingSpeed;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
||||
*/
|
||||
@ -247,6 +254,30 @@ class Config
|
||||
return $this->rssLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set readingSpeed.
|
||||
*
|
||||
* @param float $readingSpeed
|
||||
*
|
||||
* @return Config
|
||||
*/
|
||||
public function setReadingSpeed($readingSpeed)
|
||||
{
|
||||
$this->readingSpeed = $readingSpeed;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get readingSpeed.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getReadingSpeed()
|
||||
{
|
||||
return $this->readingSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TaggingRule $rule
|
||||
*
|
||||
|
||||
@ -7,6 +7,9 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Hateoas\Configuration\Annotation as Hateoas;
|
||||
use JMS\Serializer\Annotation\Groups;
|
||||
use JMS\Serializer\Annotation\XmlRoot;
|
||||
use JMS\Serializer\Annotation\Exclude;
|
||||
use JMS\Serializer\Annotation\VirtualProperty;
|
||||
use JMS\Serializer\Annotation\SerializedName;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
@ -56,6 +59,8 @@ class Entry
|
||||
/**
|
||||
* @var bool
|
||||
*
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\Column(name="is_archived", type="boolean")
|
||||
*
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
@ -65,6 +70,8 @@ class Entry
|
||||
/**
|
||||
* @var bool
|
||||
*
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\Column(name="is_starred", type="boolean")
|
||||
*
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
@ -161,6 +168,8 @@ class Entry
|
||||
private $isPublic;
|
||||
|
||||
/**
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries")
|
||||
*
|
||||
* @Groups({"export_all"})
|
||||
@ -178,7 +187,7 @@ class Entry
|
||||
/*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(\Wallabag\UserBundle\Entity\User $user)
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->tags = new ArrayCollection();
|
||||
@ -266,6 +275,16 @@ class Entry
|
||||
return $this->isArchived;
|
||||
}
|
||||
|
||||
/**
|
||||
* @VirtualProperty
|
||||
* @SerializedName("is_archived")
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
*/
|
||||
public function is_Archived()
|
||||
{
|
||||
return (int) $this->isArchived();
|
||||
}
|
||||
|
||||
public function toggleArchive()
|
||||
{
|
||||
$this->isArchived = $this->isArchived() ^ 1;
|
||||
@ -297,6 +316,16 @@ class Entry
|
||||
return $this->isStarred;
|
||||
}
|
||||
|
||||
/**
|
||||
* @VirtualProperty
|
||||
* @SerializedName("is_starred")
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
*/
|
||||
public function is_Starred()
|
||||
{
|
||||
return (int) $this->isStarred();
|
||||
}
|
||||
|
||||
public function toggleStar()
|
||||
{
|
||||
$this->isStarred = $this->isStarred() ^ 1;
|
||||
@ -336,6 +365,33 @@ class Entry
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @VirtualProperty
|
||||
* @SerializedName("user_name")
|
||||
*/
|
||||
public function getUserName()
|
||||
{
|
||||
return $this->user->getUserName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @VirtualProperty
|
||||
* @SerializedName("user_email")
|
||||
*/
|
||||
public function getUserEmail()
|
||||
{
|
||||
return $this->user->getEmail();
|
||||
}
|
||||
|
||||
/**
|
||||
* @VirtualProperty
|
||||
* @SerializedName("user_id")
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->user->getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@ -36,9 +36,9 @@ class LocaleListener implements EventSubscriberInterface
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
// must be registered before the default Locale listener
|
||||
KernelEvents::REQUEST => array(array('onKernelRequest', 17)),
|
||||
);
|
||||
KernelEvents::REQUEST => [['onKernelRequest', 17]],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,9 +28,9 @@ class RegistrationConfirmedListener implements EventSubscriberInterface
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
FOSUserEvents::REGISTRATION_CONFIRMED => 'authenticate',
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
public function authenticate(FilterUserResponseEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)
|
||||
|
||||
@ -15,24 +15,28 @@ class ChangePasswordType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('old_password', PasswordType::class, array(
|
||||
'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
|
||||
))
|
||||
->add('new_password', RepeatedType::class, array(
|
||||
->add('old_password', PasswordType::class, [
|
||||
'constraints' => new UserPassword(['message' => 'validator.password_wrong_value']),
|
||||
'label' => 'config.form_password.old_password_label',
|
||||
])
|
||||
->add('new_password', RepeatedType::class, [
|
||||
'type' => PasswordType::class,
|
||||
'invalid_message' => 'The password fields must match.',
|
||||
'invalid_message' => 'validator.password_must_match',
|
||||
'required' => true,
|
||||
'first_options' => array('label' => 'New password'),
|
||||
'second_options' => array('label' => 'Repeat new password'),
|
||||
'constraints' => array(
|
||||
new Constraints\Length(array(
|
||||
'first_options' => ['label' => 'config.form_password.new_password_label'],
|
||||
'second_options' => ['label' => 'config.form_password.repeat_new_password_label'],
|
||||
'constraints' => [
|
||||
new Constraints\Length([
|
||||
'min' => 8,
|
||||
'minMessage' => 'Password should by at least 8 chars long',
|
||||
)),
|
||||
'minMessage' => 'validator.password_too_short',
|
||||
]),
|
||||
new Constraints\NotBlank(),
|
||||
),
|
||||
))
|
||||
->add('save', SubmitType::class)
|
||||
],
|
||||
'label' => 'config.form_password.new_password_label',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'config.form.save',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
44
src/Wallabag/CoreBundle/Form/Type/ClientType.php
Normal file
44
src/Wallabag/CoreBundle/Form/Type/ClientType.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ClientType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('redirect_uris', UrlType::class, ['required' => true, 'label' => 'developer.client.form.redirect_uris_label'])
|
||||
->add('save', SubmitType::class, ['label' => 'developer.client.form.save_label'])
|
||||
;
|
||||
|
||||
$builder->get('redirect_uris')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
function ($originalUri) {
|
||||
return $originalUri;
|
||||
},
|
||||
function ($submittedUri) {
|
||||
return [$submittedUri];
|
||||
}
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\ApiBundle\Entity\Client',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'client';
|
||||
}
|
||||
}
|
||||
@ -10,8 +10,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ConfigType extends AbstractType
|
||||
{
|
||||
private $themes = array();
|
||||
private $languages = array();
|
||||
private $themes = [];
|
||||
private $languages = [];
|
||||
|
||||
/**
|
||||
* @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
|
||||
@ -30,24 +30,39 @@ class ConfigType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('theme', ChoiceType::class, array(
|
||||
->add('theme', ChoiceType::class, [
|
||||
'choices' => array_flip($this->themes),
|
||||
'choices_as_values' => true,
|
||||
))
|
||||
->add('items_per_page')
|
||||
->add('language', ChoiceType::class, array(
|
||||
'label' => 'config.form_settings.theme_label',
|
||||
])
|
||||
->add('items_per_page', null, [
|
||||
'label' => 'config.form_settings.items_per_page_label',
|
||||
])
|
||||
->add('reading_speed', ChoiceType::class, [
|
||||
'label' => 'config.form_settings.reading_speed.label',
|
||||
'choices' => [
|
||||
'config.form_settings.reading_speed.100_word' => '0.5',
|
||||
'config.form_settings.reading_speed.200_word' => '1',
|
||||
'config.form_settings.reading_speed.300_word' => '1.5',
|
||||
'config.form_settings.reading_speed.400_word' => '2',
|
||||
],
|
||||
])
|
||||
->add('language', ChoiceType::class, [
|
||||
'choices' => array_flip($this->languages),
|
||||
'choices_as_values' => true,
|
||||
))
|
||||
->add('save', SubmitType::class)
|
||||
'label' => 'config.form_settings.language_label',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'config.form.save',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Config',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -14,17 +14,30 @@ class EditEntryType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class, array('required' => true))
|
||||
->add('is_public', CheckboxType::class, array('required' => false))
|
||||
->add('save', SubmitType::class)
|
||||
->add('title', TextType::class, [
|
||||
'required' => true,
|
||||
'label' => 'entry.edit.title_label',
|
||||
])
|
||||
->add('is_public', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'entry.edit.is_public_label',
|
||||
])
|
||||
->add('url', TextType::class, [
|
||||
'disabled' => true,
|
||||
'required' => false,
|
||||
'label' => 'entry.edit.url_label',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'entry.edit.save_label',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -34,25 +34,28 @@ class EntryFilterType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('readingTime', NumberRangeFilterType::class)
|
||||
->add('createdAt', DateRangeFilterType::class, array(
|
||||
'left_date_options' => array(
|
||||
'attr' => array(
|
||||
->add('readingTime', NumberRangeFilterType::class, [
|
||||
'label' => 'entry.filters.reading_time.label',
|
||||
])
|
||||
->add('createdAt', DateRangeFilterType::class, [
|
||||
'left_date_options' => [
|
||||
'attr' => [
|
||||
'placeholder' => 'dd/mm/yyyy',
|
||||
),
|
||||
],
|
||||
'format' => 'dd/MM/yyyy',
|
||||
'widget' => 'single_text',
|
||||
),
|
||||
'right_date_options' => array(
|
||||
'attr' => array(
|
||||
],
|
||||
'right_date_options' => [
|
||||
'attr' => [
|
||||
'placeholder' => 'dd/mm/yyyy',
|
||||
),
|
||||
],
|
||||
'format' => 'dd/MM/yyyy',
|
||||
'widget' => 'single_text',
|
||||
),
|
||||
)
|
||||
],
|
||||
'label' => 'entry.filters.created_at.label',
|
||||
]
|
||||
)
|
||||
->add('domainName', TextFilterType::class, array(
|
||||
->add('domainName', TextFilterType::class, [
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$value = $values['value'];
|
||||
if (strlen($value) <= 2 || empty($value)) {
|
||||
@ -62,10 +65,15 @@ class EntryFilterType extends AbstractType
|
||||
|
||||
return $filterQuery->createCondition($expression);
|
||||
},
|
||||
))
|
||||
->add('isArchived', CheckboxFilterType::class)
|
||||
->add('isStarred', CheckboxFilterType::class)
|
||||
->add('previewPicture', CheckboxFilterType::class, array(
|
||||
'label' => 'entry.filters.domain_label',
|
||||
])
|
||||
->add('isArchived', CheckboxFilterType::class, [
|
||||
'label' => 'entry.filters.archived_label',
|
||||
])
|
||||
->add('isStarred', CheckboxFilterType::class, [
|
||||
'label' => 'entry.filters.starred_label',
|
||||
])
|
||||
->add('previewPicture', CheckboxFilterType::class, [
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
if (false === $values['value']) {
|
||||
return;
|
||||
@ -75,11 +83,13 @@ class EntryFilterType extends AbstractType
|
||||
|
||||
return $filterQuery->createCondition($expression);
|
||||
},
|
||||
))
|
||||
->add('language', ChoiceFilterType::class, array(
|
||||
'label' => 'entry.filters.preview_picture_label',
|
||||
])
|
||||
->add('language', ChoiceFilterType::class, [
|
||||
'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
|
||||
'choices_as_values' => true,
|
||||
))
|
||||
'label' => 'entry.filters.language_label',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
@ -90,9 +100,9 @@ class EntryFilterType extends AbstractType
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'csrf_protection' => false,
|
||||
'validation_groups' => array('filtering'),
|
||||
));
|
||||
'validation_groups' => ['filtering'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
@ -13,16 +12,18 @@ class NewEntryType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('url', UrlType::class, array('required' => true))
|
||||
->add('save', SubmitType::class)
|
||||
->add('url', UrlType::class, [
|
||||
'required' => true,
|
||||
'label' => 'entry.new.form_new.url_label',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
@ -13,16 +12,15 @@ class NewTagType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('label', TextType::class, array('required' => true))
|
||||
->add('save', SubmitType::class)
|
||||
->add('label', TextType::class, ['required' => true])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -17,30 +17,38 @@ class NewUserType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('username', TextType::class, array('required' => true))
|
||||
->add('plainPassword', RepeatedType::class, array(
|
||||
->add('username', TextType::class, [
|
||||
'required' => true,
|
||||
'label' => 'config.form_new_user.username_label',
|
||||
])
|
||||
->add('plainPassword', RepeatedType::class, [
|
||||
'type' => PasswordType::class,
|
||||
'invalid_message' => 'The password fields must match',
|
||||
'first_options' => array('label' => 'Password'),
|
||||
'second_options' => array('label' => 'Repeat new password'),
|
||||
'constraints' => array(
|
||||
new Constraints\Length(array(
|
||||
'invalid_message' => 'validator.password_must_match',
|
||||
'first_options' => ['label' => 'config.form_new_user.password_label'],
|
||||
'second_options' => ['label' => 'config.form_new_user.repeat_new_password_label'],
|
||||
'constraints' => [
|
||||
new Constraints\Length([
|
||||
'min' => 8,
|
||||
'minMessage' => 'Password should by at least 8 chars long',
|
||||
)),
|
||||
'minMessage' => 'validator.password_too_short',
|
||||
]),
|
||||
new Constraints\NotBlank(),
|
||||
),
|
||||
))
|
||||
->add('email', EmailType::class)
|
||||
->add('save', SubmitType::class)
|
||||
],
|
||||
'label' => 'config.form_new_user.plain_password_label',
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
'label' => 'config.form_new_user.email_label',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'config.form.save',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\UserBundle\Entity\User',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -12,16 +12,20 @@ class RssType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('rss_limit')
|
||||
->add('save', SubmitType::class)
|
||||
->add('rss_limit', null, [
|
||||
'label' => 'config.form_rss.rss_limit',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'config.form.save',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\Config',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -14,12 +14,19 @@ class TaggingRuleType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('rule', TextType::class, array('required' => true))
|
||||
->add('save', SubmitType::class)
|
||||
->add('rule', TextType::class, [
|
||||
'required' => true,
|
||||
'label' => 'config.form_rules.rule_label',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'config.form.save',
|
||||
])
|
||||
;
|
||||
|
||||
$tagsField = $builder
|
||||
->create('tags', TextType::class)
|
||||
->create('tags', TextType::class, [
|
||||
'label' => 'config.form_rules.tags_label',
|
||||
])
|
||||
->addModelTransformer(new StringToListTransformer(','));
|
||||
|
||||
$builder->add($tagsField);
|
||||
@ -27,9 +34,9 @@ class TaggingRuleType extends AbstractType
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\TaggingRule',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -15,10 +15,19 @@ class UserInformationType extends AbstractType
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('name', TextType::class)
|
||||
->add('email', EmailType::class)
|
||||
->add('twoFactorAuthentication', CheckboxType::class, array('required' => false))
|
||||
->add('save', SubmitType::class)
|
||||
->add('name', TextType::class, [
|
||||
'label' => 'config.form_user.name_label',
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
'label' => 'config.form_user.email_label',
|
||||
])
|
||||
->add('twoFactorAuthentication', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'config.form_user.twoFactorAuthentication_label',
|
||||
])
|
||||
->add('save', SubmitType::class, [
|
||||
'label' => 'config.form.save',
|
||||
])
|
||||
->remove('username')
|
||||
->remove('plainPassword')
|
||||
;
|
||||
@ -31,9 +40,9 @@ class UserInformationType extends AbstractType
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'Wallabag\UserBundle\Entity\User',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
|
||||
@ -32,14 +32,21 @@ class ContentProxy
|
||||
* Fetch content using graby and hydrate given entry with results information.
|
||||
* In case we couldn't find content, we'll try to use Open Graph data.
|
||||
*
|
||||
* @param Entry $entry Entry to update
|
||||
* @param string $url Url to grab content for
|
||||
* We can also force the content, in case of an import from the v1 for example, so the function won't
|
||||
* fetch the content from the website but rather use information given with the $content parameter.
|
||||
*
|
||||
* @param Entry $entry Entry to update
|
||||
* @param string $url Url to grab content for
|
||||
* @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
|
||||
*
|
||||
* @return Entry
|
||||
*/
|
||||
public function updateEntry(Entry $entry, $url)
|
||||
public function updateEntry(Entry $entry, $url, array $content = [])
|
||||
{
|
||||
$content = $this->graby->fetchContent($url);
|
||||
// do we have to fetch the content or the provided one is ok?
|
||||
if (empty($content) || false === $this->validateContent($content)) {
|
||||
$content = $this->graby->fetchContent($url);
|
||||
}
|
||||
|
||||
$title = $content['title'];
|
||||
if (!$title && isset($content['open_graph']['og_title'])) {
|
||||
@ -62,7 +69,11 @@ class ContentProxy
|
||||
$entry->setLanguage($content['language']);
|
||||
$entry->setMimetype($content['content_type']);
|
||||
$entry->setReadingTime(Utils::getReadingTime($html));
|
||||
$entry->setDomainName(parse_url($entry->getUrl(), PHP_URL_HOST));
|
||||
|
||||
$domainName = parse_url($entry->getUrl(), PHP_URL_HOST);
|
||||
if (false !== $domainName) {
|
||||
$entry->setDomainName($domainName);
|
||||
}
|
||||
|
||||
if (isset($content['open_graph']['og_image'])) {
|
||||
$entry->setPreviewPicture($content['open_graph']['og_image']);
|
||||
@ -71,10 +82,10 @@ class ContentProxy
|
||||
try {
|
||||
$this->tagger->tag($entry);
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error('Error while trying to automatically tag an entry.', array(
|
||||
$this->logger->error('Error while trying to automatically tag an entry.', [
|
||||
'entry_url' => $url,
|
||||
'error_msg' => $e->getMessage(),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
return $entry;
|
||||
@ -113,4 +124,17 @@ class ContentProxy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that the given content as enough value to be used
|
||||
* instead of fetch the content from the url.
|
||||
*
|
||||
* @param array $content
|
||||
*
|
||||
* @return bool true if valid otherwise false
|
||||
*/
|
||||
private function validateContent(array $content)
|
||||
{
|
||||
return isset($content['title']) && isset($content['html']) && isset($content['url']) && isset($content['language']) && isset($content['content_type']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,10 +18,10 @@ class EntriesExport
|
||||
private $wallabagUrl;
|
||||
private $logoPath;
|
||||
private $title = '';
|
||||
private $entries = array();
|
||||
private $authors = array('wallabag');
|
||||
private $entries = [];
|
||||
private $authors = ['wallabag'];
|
||||
private $language = '';
|
||||
private $tags = array();
|
||||
private $tags = [];
|
||||
private $footerTemplate = '<div style="text-align:center;">
|
||||
<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>
|
||||
@ -41,12 +41,14 @@ class EntriesExport
|
||||
* Define entries.
|
||||
*
|
||||
* @param array|Entry $entries An array of entries or one entry
|
||||
*
|
||||
* @return EntriesExport
|
||||
*/
|
||||
public function setEntries($entries)
|
||||
{
|
||||
if (!is_array($entries)) {
|
||||
$this->language = $entries->getLanguage();
|
||||
$entries = array($entries);
|
||||
$entries = [$entries];
|
||||
}
|
||||
|
||||
$this->entries = $entries;
|
||||
@ -62,6 +64,8 @@ class EntriesExport
|
||||
* Sets the category of which we want to get articles, or just one entry.
|
||||
*
|
||||
* @param string $method Method to get articles
|
||||
*
|
||||
* @return EntriesExport
|
||||
*/
|
||||
public function updateTitle($method)
|
||||
{
|
||||
@ -78,30 +82,14 @@ class EntriesExport
|
||||
* Sets the output format.
|
||||
*
|
||||
* @param string $format
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function exportAs($format)
|
||||
{
|
||||
switch ($format) {
|
||||
case 'epub':
|
||||
return $this->produceEpub();
|
||||
|
||||
case 'mobi':
|
||||
return $this->produceMobi();
|
||||
|
||||
case 'pdf':
|
||||
return $this->producePDF();
|
||||
|
||||
case 'csv':
|
||||
return $this->produceCSV();
|
||||
|
||||
case 'json':
|
||||
return $this->produceJSON();
|
||||
|
||||
case 'xml':
|
||||
return $this->produceXML();
|
||||
|
||||
case 'txt':
|
||||
return $this->produceTXT();
|
||||
$functionName = 'produce'.ucfirst($format);
|
||||
if (method_exists($this, $functionName)) {
|
||||
return $this->$functionName();
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('The format "%s" is not yet supported.', $format));
|
||||
@ -109,6 +97,8 @@ class EntriesExport
|
||||
|
||||
/**
|
||||
* Use PHPePub to dump a .epub file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceEpub()
|
||||
{
|
||||
@ -180,17 +170,19 @@ class EntriesExport
|
||||
return Response::create(
|
||||
$book->getBook(),
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Content-Description' => 'File Transfer',
|
||||
'Content-type' => 'application/epub+zip',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.epub"',
|
||||
'Content-Transfer-Encoding' => 'binary',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use PHPMobi to dump a .mobi file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceMobi()
|
||||
{
|
||||
@ -229,20 +221,22 @@ class EntriesExport
|
||||
return Response::create(
|
||||
$mobi->toString(),
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Accept-Ranges' => 'bytes',
|
||||
'Content-Description' => 'File Transfer',
|
||||
'Content-type' => 'application/x-mobipocket-ebook',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.mobi"',
|
||||
'Content-Transfer-Encoding' => 'binary',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use TCPDF to dump a .pdf file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function producePDF()
|
||||
private function producePdf()
|
||||
{
|
||||
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
@ -284,38 +278,40 @@ class EntriesExport
|
||||
return Response::create(
|
||||
$pdf->Output('', 'S'),
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Content-Description' => 'File Transfer',
|
||||
'Content-type' => 'application/pdf',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.pdf"',
|
||||
'Content-Transfer-Encoding' => 'binary',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inspired from CsvFileDumper.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceCSV()
|
||||
private function produceCsv()
|
||||
{
|
||||
$delimiter = ';';
|
||||
$enclosure = '"';
|
||||
$handle = fopen('php://memory', 'rb+');
|
||||
|
||||
fputcsv($handle, array('Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'), $delimiter, $enclosure);
|
||||
fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'], $delimiter, $enclosure);
|
||||
|
||||
foreach ($this->entries as $entry) {
|
||||
fputcsv(
|
||||
$handle,
|
||||
array(
|
||||
[
|
||||
$entry->getTitle(),
|
||||
$entry->getURL(),
|
||||
// remove new line to avoid crazy results
|
||||
str_replace(array("\r\n", "\r", "\n"), '', $entry->getContent()),
|
||||
str_replace(["\r\n", "\r", "\n"], '', $entry->getContent()),
|
||||
implode(', ', $entry->getTags()->toArray()),
|
||||
$entry->getMimetype(),
|
||||
$entry->getLanguage(),
|
||||
),
|
||||
],
|
||||
$delimiter,
|
||||
$enclosure
|
||||
);
|
||||
@ -328,41 +324,56 @@ class EntriesExport
|
||||
return Response::create(
|
||||
$output,
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Content-type' => 'application/csv',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.csv"',
|
||||
'Content-Transfer-Encoding' => 'UTF-8',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
private function produceJSON()
|
||||
/**
|
||||
* Dump a JSON file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceJson()
|
||||
{
|
||||
return Response::create(
|
||||
$this->prepareSerializingContent('json'),
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Content-type' => 'application/json',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.json"',
|
||||
'Content-Transfer-Encoding' => 'UTF-8',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
private function produceXML()
|
||||
/**
|
||||
* Dump a XML file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceXml()
|
||||
{
|
||||
return Response::create(
|
||||
$this->prepareSerializingContent('xml'),
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Content-type' => 'application/xml',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.xml"',
|
||||
'Content-Transfer-Encoding' => 'UTF-8',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
private function produceTXT()
|
||||
/**
|
||||
* Dump a TXT file.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
private function produceTxt()
|
||||
{
|
||||
$content = '';
|
||||
$bar = str_repeat('=', 100);
|
||||
@ -374,17 +385,19 @@ class EntriesExport
|
||||
return Response::create(
|
||||
$content,
|
||||
200,
|
||||
array(
|
||||
[
|
||||
'Content-type' => 'text/plain',
|
||||
'Content-Disposition' => 'attachment; filename="'.$this->title.'.txt"',
|
||||
'Content-Transfer-Encoding' => 'UTF-8',
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a Serializer object for producing processes that need it (JSON & XML).
|
||||
*
|
||||
* @param string $format
|
||||
*
|
||||
* @return Serializer
|
||||
*/
|
||||
private function prepareSerializingContent($format)
|
||||
@ -394,7 +407,7 @@ class EntriesExport
|
||||
return $serializer->serialize(
|
||||
$this->entries,
|
||||
$format,
|
||||
SerializationContext::create()->setGroups(array('entries_for_user'))
|
||||
SerializationContext::create()->setGroups(['entries_for_user'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
37
src/Wallabag/CoreBundle/Helper/Redirect.php
Normal file
37
src/Wallabag/CoreBundle/Helper/Redirect.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
@ -54,7 +54,7 @@ class RuleBasedTagger
|
||||
public function tagAllForUser(User $user)
|
||||
{
|
||||
$rules = $this->getRulesForUser($user);
|
||||
$entries = array();
|
||||
$entries = [];
|
||||
|
||||
foreach ($rules as $rule) {
|
||||
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user