forked from wallabag/wallabag
Compare commits
539 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff5623baac | |||
| 39e84e74a4 | |||
| 092a11b21e | |||
| 980646c52c | |||
| bf85187304 | |||
| f044dddcc0 | |||
| 25282de2be | |||
| dfda2bfbb5 | |||
| fd11d7476d | |||
| 18f5d402b4 | |||
| 2de4d2464f | |||
| 9fce559cb7 | |||
| db2f5d4c5f | |||
| a74ebc65cf | |||
| c589ee9b3c | |||
| db465ace02 | |||
| d954899f5d | |||
| 188da933e0 | |||
| 0cae692681 | |||
| fad18335b1 | |||
| 80b98fbd68 | |||
| 04c2f0de18 | |||
| ed5912e272 | |||
| e229389fd1 | |||
| 7780af1d4b | |||
| e832f1e0be | |||
| 3855de88ff | |||
| da3eaed297 | |||
| 00b33e3855 | |||
| a5972d7983 | |||
| 820d1c69c0 | |||
| fc6a7da71c | |||
| 68aa2cdeaf | |||
| 507ef47bd8 | |||
| ec964ab724 | |||
| dbac4e8591 | |||
| 9ca9b8eb85 | |||
| 3015551b23 | |||
| 5b5584d9f9 | |||
| ebc46ef1fc | |||
| 19178c5a20 | |||
| fc6aafe302 | |||
| ffece8d19a | |||
| 764a79b0ed | |||
| 431d49eb8c | |||
| 4a5f769428 | |||
| 5a9abf8821 | |||
| 68fabb71f8 | |||
| afc3a9b088 | |||
| 70991255b4 | |||
| ca79f8c018 | |||
| d0d7f5ab5e | |||
| 97e922dddc | |||
| a55c4ebf32 | |||
| 5a2821b3ce | |||
| 0364a171bb | |||
| 913fb51707 | |||
| e97902412f | |||
| dfe370eaa3 | |||
| 9fa207bdc6 | |||
| c4a5806180 | |||
| 826ff3f71e | |||
| 486f943e9a | |||
| 2417471bcc | |||
| 41991b326d | |||
| 734bf415c9 | |||
| 470b4aa15b | |||
| f3458bdbd6 | |||
| 15ebd406d4 | |||
| e2d2ce66e7 | |||
| 0cf4a61344 | |||
| ffa9e370f2 | |||
| 7aef830815 | |||
| 9ea4c136d9 | |||
| 74fa98fee3 | |||
| c195dbbd6c | |||
| 2c904346af | |||
| 8f6a3d412c | |||
| 57c896ce81 | |||
| be6695e041 | |||
| d93756d298 | |||
| 5a9612a15e | |||
| 36100365c6 | |||
| 77dbf189ff | |||
| cd17f86c6d | |||
| 843fd97805 | |||
| 5afff609b3 | |||
| 60623246ae | |||
| fa107116cc | |||
| 0cfdddc2eb | |||
| 8b0108d686 | |||
| adc79d0578 | |||
| 5d498135ab | |||
| d287ed6b54 | |||
| e69b07314b | |||
| f3291f5797 | |||
| 7cbe1dafb3 | |||
| 0ed133f3d5 | |||
| bfa5a4a556 | |||
| a0cd522db2 | |||
| 926ff63a73 | |||
| 1145810345 | |||
| 5ac6deda69 | |||
| d8e936add0 | |||
| af374b8cb0 | |||
| 6ebffd0f63 | |||
| e8663003c5 | |||
| 255d71727c | |||
| 0fc117ec41 | |||
| aa06e8328e | |||
| 5240684be9 | |||
| 9ec351e8b6 | |||
| 6fab27f3ce | |||
| e4d69cafe4 | |||
| 34e51243d9 | |||
| d21ccc1e28 | |||
| 9bc026f343 | |||
| 752606941f | |||
| 728aa902bb | |||
| fde129e5c6 | |||
| 3b78bbae64 | |||
| 675d78f9c6 | |||
| a46fd5fc9f | |||
| a26a6bd3a5 | |||
| d021823bab | |||
| 26fbf050f1 | |||
| 8a670fe4fe | |||
| 775a23a6d0 | |||
| e096656e09 | |||
| b2a5e680d3 | |||
| 0a8c9ae64a | |||
| ee266ab12b | |||
| f006bf4324 | |||
| 735bd89cfd | |||
| 46f51c68a9 | |||
| 35c1060f9a | |||
| 5fc91cca06 | |||
| 6a1a7e5f26 | |||
| da0d504c10 | |||
| 25caadf301 | |||
| a083aaf8d3 | |||
| a00763209f | |||
| 2910fb6da4 | |||
| 1761a646ac | |||
| 51c68655fb | |||
| 094604a87c | |||
| 111e17e74d | |||
| 95736f9ada | |||
| 9a29118df9 | |||
| 2bbd1b2e6f | |||
| d640600a40 | |||
| 2feefbf221 | |||
| ed858ef2ac | |||
| 9901556382 | |||
| f4e3cde352 | |||
| f9f320c6dc | |||
| 49e8619c01 | |||
| 94846eb82b | |||
| ace1fa3251 | |||
| a71aeef135 | |||
| 5165ffa6a4 | |||
| a0037b1103 | |||
| 944461d67c | |||
| bec697e23b | |||
| 234ba7c05f | |||
| 049502c444 | |||
| 4c235ddb39 | |||
| af01b63bc4 | |||
| 827bc27e66 | |||
| d231645889 | |||
| efe9e4d291 | |||
| b3308ed8d0 | |||
| f1c9e4ca3a | |||
| 13ee2cf20c | |||
| 9c8d3f1ba0 | |||
| e59a807aa1 | |||
| a4221caec7 | |||
| 91b67ced99 | |||
| b21413cf9a | |||
| 203be88474 | |||
| a8bbc1cc88 | |||
| 750fff8370 | |||
| f46900ca98 | |||
| f06a826c6d | |||
| c7e5ba6dd0 | |||
| c0ecd38e76 | |||
| da588f6202 | |||
| 62ab325ad4 | |||
| c5d21025c4 | |||
| ff7c692da0 | |||
| bce6bb7f7d | |||
| d84c44aaf7 | |||
| d08c4fdaaa | |||
| 8ac80e934e | |||
| 4b04cd5746 | |||
| 820ff41363 | |||
| b49f49f8e6 | |||
| 5db058ff72 | |||
| ab2203ccb7 | |||
| 098c69e845 | |||
| b4ba6584aa | |||
| 120d9b42f9 | |||
| cddc90b7dd | |||
| fdc4d13db2 | |||
| d96d1bf0dc | |||
| 4a5302dd20 | |||
| bf62bf52f7 | |||
| eeeceb193f | |||
| 2dda155f95 | |||
| f042f37bfc | |||
| 9e399a61f4 | |||
| dbed27f8d8 | |||
| 137c8ab756 | |||
| 3ed7c7c37c | |||
| 476f3afec3 | |||
| 0fdffb0b96 | |||
| 2d7d16ee6c | |||
| 18615738c0 | |||
| 452362c17a | |||
| ec4d23b584 | |||
| f78c088304 | |||
| 444d20ba4b | |||
| f6cfae5ed7 | |||
| 340dfe7125 | |||
| faaa98c6d6 | |||
| e5c937dffc | |||
| c0414355aa | |||
| aaf4ab2d2a | |||
| 56983b01a8 | |||
| 6b7e9ec1df | |||
| f052f6f580 | |||
| 16a92c54a7 | |||
| 13b2752e8d | |||
| 634997c9b5 | |||
| ca608ece65 | |||
| 027042cc1a | |||
| 10727cd261 | |||
| 3a859d9fa0 | |||
| ca03eb7332 | |||
| de64ca1251 | |||
| 20f8c369c3 | |||
| c309d86c07 | |||
| e051771782 | |||
| c52bb0cc18 | |||
| b10100ebfd | |||
| 9663747719 | |||
| a606e463ca | |||
| 90c21fa1fb | |||
| f27b0fe405 | |||
| 1958b86777 | |||
| 47660ff6c5 | |||
| e42200ec17 | |||
| 49eea9f921 | |||
| d2e821d843 | |||
| bf66901e40 | |||
| 54ca4b67db | |||
| d012103142 | |||
| 2e134d81c4 | |||
| 22a2fc13a1 | |||
| 796b31c3b1 | |||
| 27e54e0634 | |||
| c93a677926 | |||
| 9313190303 | |||
| 2cf99296a1 | |||
| 9b663800fd | |||
| e30b5a856a | |||
| c6ff0bc691 | |||
| cf9243151a | |||
| e9a837a0ac | |||
| abef36fd2b | |||
| bdb297f2b4 | |||
| bbc20c2071 | |||
| 0fc6ae8cdb | |||
| 2f86dd9c73 | |||
| b1752b619d | |||
| 0e44035b67 | |||
| 741db06447 | |||
| 4482e52f3a | |||
| 2af48b8174 | |||
| a1aac10bd5 | |||
| 40aeeafea2 | |||
| e6abd04026 | |||
| 8ef6a14652 | |||
| 1ce5164e70 | |||
| a3b64611f8 | |||
| 981d6a47da | |||
| 4b338afa40 | |||
| 1c2190fd68 | |||
| 407dd48ed0 | |||
| 397ad455e6 | |||
| 3d22442f8c | |||
| c12239c4f8 | |||
| c99a733aff | |||
| 88c9df9b80 | |||
| cbcfa69c05 | |||
| 20578f0b8e | |||
| 18e1106f76 | |||
| 6ff00315d0 | |||
| 0f17a8cf8a | |||
| 85065b509f | |||
| ca879c36de | |||
| ffcc5c9062 | |||
| 78b0b55c40 | |||
| 94a6bc0dad | |||
| 383dcc5c45 | |||
| de5aa004cb | |||
| dca910e2a6 | |||
| bc491e3712 | |||
| 40d7ca11da | |||
| 89d38b23e0 | |||
| 7be1a4e1b2 | |||
| 4d890868ed | |||
| 1d0200c5b9 | |||
| 6a5e7dba89 | |||
| 6f23eba62d | |||
| d87237484c | |||
| 46ebbfc9a4 | |||
| 8ee95437a0 | |||
| ef5b43f55c | |||
| a465db607f | |||
| 985c7add1d | |||
| 3d9986d6fc | |||
| 4b7a6eaf39 | |||
| 3e8cc92dcd | |||
| 6172071a64 | |||
| cf3adbfaea | |||
| 24e6311c05 | |||
| 69b96fe179 | |||
| ffa2e68c5f | |||
| b338c68945 | |||
| f67486a6df | |||
| 33c72bb9fc | |||
| 78dc311c72 | |||
| 48226ad6e5 | |||
| f33d1f8e48 | |||
| 97810f7335 | |||
| 15230f488a | |||
| 89ca32e705 | |||
| a71d95e38a | |||
| fa2e1d933f | |||
| 181fe7e1e9 | |||
| 905d61eb49 | |||
| c78f2706c9 | |||
| dbbb5f3cfb | |||
| 33d22c149b | |||
| cc33fcb4ba | |||
| 24db3d6862 | |||
| c3d1f92278 | |||
| a9893d754f | |||
| f4fd8e4675 | |||
| 0ccbd653fa | |||
| 70452cfc3f | |||
| 826e310687 | |||
| b81054697b | |||
| ddd8754a11 | |||
| ac1c1ff571 | |||
| 815158fefa | |||
| e1928c78ff | |||
| 65915004e0 | |||
| 60cb8c0294 | |||
| f6e85e88af | |||
| a4b0a01b6d | |||
| 1bed15fd9b | |||
| 59860d9526 | |||
| 807d473564 | |||
| ed17e61db2 | |||
| 6159c92f27 | |||
| bf176121c4 | |||
| ec33ec14e5 | |||
| 2aa7e7e121 | |||
| 093003d9af | |||
| 58a0ca2622 | |||
| 1ba1ed23f1 | |||
| 7beb535b7a | |||
| 9870785d59 | |||
| 53a2874351 | |||
| bb6b9f9f05 | |||
| 526ef23e1a | |||
| 8d3d916d4a | |||
| e90daf0690 | |||
| 9729db75de | |||
| ced2ea4015 | |||
| 7d78e2ae06 | |||
| f43d8fa947 | |||
| f48f982025 | |||
| 667ea14d42 | |||
| e93fdca2d3 | |||
| fcf6d3c3f8 | |||
| 5e4eae42a0 | |||
| c2bfc0f359 | |||
| 8281920f2c | |||
| d4913c50c2 | |||
| 19d3e878cf | |||
| c659a42c51 | |||
| cb411e8dcd | |||
| fec8a993d9 | |||
| 31542bc4b1 | |||
| 827dded754 | |||
| 39bcddfd8b | |||
| 8cfa1cd551 | |||
| 649e1e56a9 | |||
| c1ed66aad5 | |||
| 9beadfde59 | |||
| 090f873ffc | |||
| 1b7d756be0 | |||
| d6f63d5d51 | |||
| c1cba72a19 | |||
| e80a169435 | |||
| 911e0238b7 | |||
| 5fe5551972 | |||
| 90631abe46 | |||
| ce88e7aaab | |||
| a339fcd137 | |||
| f74571e750 | |||
| 0f44b2b75c | |||
| 382272c51c | |||
| 78cddcafd7 | |||
| 594770bdf4 | |||
| 2dcdb4e23c | |||
| 76617f0440 | |||
| 192fa3ea2e | |||
| 72eef910d9 | |||
| 8508b92f98 | |||
| 839a3ddbf2 | |||
| 3904543a96 | |||
| af7cd960dd | |||
| b58b6ca9f3 | |||
| 7098fd6193 | |||
| 070f5e1cf4 | |||
| 8e05fd0a3f | |||
| 931f665bc7 | |||
| 7615a29095 | |||
| 1a01323002 | |||
| 724fea0aea | |||
| 13a3a5596c | |||
| e2857a1ffe | |||
| 8c39d2aca1 | |||
| 8c82b42338 | |||
| 24a0ec60bf | |||
| fc95d812dd | |||
| 8b9fd04c74 | |||
| df56bfe94e | |||
| 11617ca7e1 | |||
| 90281b8786 | |||
| 91b47be5a9 | |||
| 8146b4180e | |||
| f1fb885ca6 | |||
| cf42b834d7 | |||
| b2b2627817 | |||
| 8c56a40d38 | |||
| 9484f3d2ce | |||
| d835f03f15 | |||
| 81403edb00 | |||
| c75d3e6961 | |||
| 2c1687ce91 | |||
| 5ca4df1585 | |||
| 241955a317 | |||
| 193953f75d | |||
| c535e291d5 | |||
| d9b4e0791d | |||
| edc2194ead | |||
| 3d36ccf8dd | |||
| 65b621da9e | |||
| 0e0de8578c | |||
| 2241d77304 | |||
| 54e3801cfe | |||
| 9cc23c615a | |||
| 80a3447d20 | |||
| e07b13fd38 | |||
| da3e9a2fb2 | |||
| 8b79bc654b | |||
| f8c834db0f | |||
| 0596633a29 | |||
| c8190c8a5a | |||
| f315552825 | |||
| a8ade4bb39 | |||
| 530fc289f2 | |||
| 21a8d427e7 | |||
| 1be3dc91b9 | |||
| 74f8acca3e | |||
| a4d2957c54 | |||
| 112c9e1b7c | |||
| 908e44f9b9 | |||
| b22a6feed2 | |||
| 13a7f1bc80 | |||
| 24887f4ad6 | |||
| 5b1230a909 | |||
| 31566fb6eb | |||
| 183c5248f3 | |||
| 738ff474a6 | |||
| 81022c3089 | |||
| 2486f42c09 | |||
| 4fc21d08f2 | |||
| 8814eaa03b | |||
| 303cdffe36 | |||
| 27b7ce9479 | |||
| 39bed07622 | |||
| cb1082904b | |||
| ee5de3b491 | |||
| 5acab2b264 | |||
| 4c797162bf | |||
| 0a6826cb4c | |||
| 49e81d8952 | |||
| 4af2abf0b7 | |||
| 84bbeed4f0 | |||
| 6639f7da6d | |||
| 131ef532c7 | |||
| dc02c679d2 | |||
| 0fff56ea68 | |||
| e9054bbd41 | |||
| 36c3a7d505 | |||
| 05c04cc509 | |||
| 2e3ca273c8 | |||
| bc8c7cd7ca | |||
| 513337c1fa | |||
| 103386c66a | |||
| 74848a4794 | |||
| 32c901f7cd | |||
| 1d9709db08 | |||
| 5905b0c12f | |||
| e776c9bc9d | |||
| 3a691e8ddd | |||
| dc36da99c0 | |||
| b05464ffd1 | |||
| 28d3a5655c | |||
| 696ee80de7 | |||
| 8bf4222bdb | |||
| f58c656a08 | |||
| 391f346cc3 | |||
| 6c3118951b | |||
| c833141942 | |||
| 4f162fff64 | |||
| 1413772bca | |||
| bf59e8aad3 | |||
| d33e3d64d2 | |||
| a6c78f0039 | |||
| 97fee36fa6 | |||
| fbccae8a79 | |||
| 13bd448e01 |
14
.github/CONTRIBUTING.md
vendored
14
.github/CONTRIBUTING.md
vendored
@ -45,3 +45,17 @@ Note : If you have large portions of text, use [Github's Gist service](https://g
|
|||||||
|
|
||||||
## You want to fix a bug or to add a feature
|
## You want to fix a bug or to add a feature
|
||||||
Please fork wallabag and work with **the master branch**.
|
Please fork wallabag and work with **the master branch**.
|
||||||
|
|
||||||
|
## Run Tests and PHP formatter
|
||||||
|
|
||||||
|
All pull requests need to pass the tests and the code needs match the style guide.
|
||||||
|
|
||||||
|
To run the tests locally run:
|
||||||
|
|
||||||
|
- when testing using Docker: `docker-compose run --rm php make test`
|
||||||
|
- otherwise: `make test`
|
||||||
|
|
||||||
|
To run the PHP formatter:
|
||||||
|
|
||||||
|
- when testing using Docker: `docker-compose run --rm php bin/php-cs-fixer fix`
|
||||||
|
- otherwise: `php bin/php-cs-fixer fix`
|
||||||
|
|||||||
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
@ -7,6 +7,13 @@ updates:
|
|||||||
time: "04:00"
|
time: "04:00"
|
||||||
timezone: Europe/Paris
|
timezone: Europe/Paris
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
groups:
|
||||||
|
babel-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*babel*"
|
||||||
|
fontsource-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*fontsource*"
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: materialize-css
|
- dependency-name: materialize-css
|
||||||
versions:
|
versions:
|
||||||
@ -18,6 +25,10 @@ updates:
|
|||||||
time: "04:00"
|
time: "04:00"
|
||||||
timezone: Europe/Paris
|
timezone: Europe/Paris
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
|
groups:
|
||||||
|
symfony-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "symfony/*"
|
||||||
reviewers:
|
reviewers:
|
||||||
- j0k3r
|
- j0k3r
|
||||||
- tcitworld
|
- tcitworld
|
||||||
@ -26,6 +37,10 @@ updates:
|
|||||||
- dependency-name: lcobucci/jwt
|
- dependency-name: lcobucci/jwt
|
||||||
versions:
|
versions:
|
||||||
- ">= 4.2.0"
|
- ">= 4.2.0"
|
||||||
|
# until we add support for Symfony 5+
|
||||||
|
- dependency-name: symfony/*
|
||||||
|
versions:
|
||||||
|
- ">= 5.0.0"
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
44
.github/workflows/assets.yml
vendored
44
.github/workflows/assets.yml
vendored
@ -1,44 +0,0 @@
|
|||||||
name: "Assets"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- 2.*
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
js:
|
|
||||||
name: "Building assets"
|
|
||||||
runs-on: "ubuntu-20.04"
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: "actions/checkout@v3"
|
|
||||||
|
|
||||||
- name: "Install Node"
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: "Install dependencies with Yarn"
|
|
||||||
run: "yarn install"
|
|
||||||
|
|
||||||
- name: "Build dev assets"
|
|
||||||
run: "yarn run build:dev"
|
|
||||||
|
|
||||||
- name: "Build prod assets"
|
|
||||||
run: "yarn run build:prod"
|
|
||||||
|
|
||||||
- name: "Validate no change were created"
|
|
||||||
run: |
|
|
||||||
GITDIFF=`git diff`
|
|
||||||
if [ "$GITDIFF" == "" ]; then
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
7
.github/workflows/coding-standards.yml
vendored
7
.github/workflows/coding-standards.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v3"
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
- name: "Install PHP"
|
- name: "Install PHP"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
@ -49,3 +49,6 @@ jobs:
|
|||||||
|
|
||||||
- name: "Run TwigCS"
|
- name: "Run TwigCS"
|
||||||
run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle app/ src/ | cs2pr"
|
run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle app/ src/ | cs2pr"
|
||||||
|
|
||||||
|
- name: "Run ergebnis/composer-normalize"
|
||||||
|
run: "composer normalize --dry-run --no-check-lock"
|
||||||
|
|||||||
76
.github/workflows/continuous-integration.yml
vendored
76
.github/workflows/continuous-integration.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PGPASSWORD: wallabagrocks
|
PGPASSWORD: wallabagrocks
|
||||||
@ -33,6 +33,7 @@ jobs:
|
|||||||
- "8.0"
|
- "8.0"
|
||||||
- "8.1"
|
- "8.1"
|
||||||
- "8.2"
|
- "8.2"
|
||||||
|
- "8.3"
|
||||||
database:
|
database:
|
||||||
- "sqlite"
|
- "sqlite"
|
||||||
- "mysql"
|
- "mysql"
|
||||||
@ -40,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v3"
|
uses: "actions/checkout@v4"
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
|
|
||||||
@ -80,3 +81,74 @@ jobs:
|
|||||||
|
|
||||||
- name: "Run PHPUnit"
|
- name: "Run PHPUnit"
|
||||||
run: "php bin/simple-phpunit -v"
|
run: "php bin/simple-phpunit -v"
|
||||||
|
|
||||||
|
phpunit_no_prefix:
|
||||||
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
|
||||||
|
runs-on: "ubuntu-20.04"
|
||||||
|
services:
|
||||||
|
rabbitmq:
|
||||||
|
image: rabbitmq:3-alpine
|
||||||
|
ports:
|
||||||
|
- 5672:5672
|
||||||
|
redis:
|
||||||
|
image: redis:6-alpine
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
php:
|
||||||
|
- "8.2"
|
||||||
|
database:
|
||||||
|
- "sqlite"
|
||||||
|
- "mysql"
|
||||||
|
- "pgsql"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: "Install PHP"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
php-version: "${{ matrix.php }}"
|
||||||
|
coverage: none
|
||||||
|
tools: pecl
|
||||||
|
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||||
|
ini-values: "date.timezone=Europe/Paris"
|
||||||
|
|
||||||
|
- name: "Remove database prefix"
|
||||||
|
run: |
|
||||||
|
pip install --user yq
|
||||||
|
yq -Y --in-place '.parameters.database_table_prefix = ""' app/config/parameters.yml.dist
|
||||||
|
|
||||||
|
- name: "Setup MySQL"
|
||||||
|
if: "${{ matrix.database == 'mysql' }}"
|
||||||
|
run: |
|
||||||
|
sudo systemctl start mysql.service
|
||||||
|
sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test"
|
||||||
|
|
||||||
|
- name: "Setup PostgreSQL"
|
||||||
|
if: "${{ matrix.database == 'pgsql' }}"
|
||||||
|
run: |
|
||||||
|
sudo systemctl start postgresql
|
||||||
|
sudo -u postgres psql -d template1 -c "CREATE USER wallabag WITH PASSWORD 'wallabagrocks' CREATEDB"
|
||||||
|
createdb -h localhost -p 5432 -U wallabag wallabag_test
|
||||||
|
pg_isready -d wallabag_test -h localhost -p 5432 -U wallabag
|
||||||
|
|
||||||
|
- name: "Install dependencies with Composer"
|
||||||
|
uses: "ramsey/composer-install@v2"
|
||||||
|
with:
|
||||||
|
composer-options: "--optimize-autoloader --prefer-dist"
|
||||||
|
|
||||||
|
- name: "Prepare database"
|
||||||
|
run: "make prepare DB=${{ matrix.database }}"
|
||||||
|
|
||||||
|
- name: "Prepare fixtures"
|
||||||
|
run: "make fixtures"
|
||||||
|
|
||||||
|
- name: "Run PHPUnit"
|
||||||
|
run: "php bin/simple-phpunit -v"
|
||||||
|
|||||||
@ -12,7 +12,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Dependabot metadata
|
- name: Dependabot metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
uses: dependabot/fetch-metadata@v1.5.1
|
uses: dependabot/fetch-metadata@v1.6.0
|
||||||
with:
|
with:
|
||||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
- name: Approve and merge minor updates
|
- name: Approve and merge minor updates
|
||||||
|
|||||||
4
.github/workflows/translations.yml
vendored
4
.github/workflows/translations.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v3"
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
- name: "Install PHP"
|
- name: "Install PHP"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
|||||||
8
.github/workflows/upload-release-package.yml
vendored
8
.github/workflows/upload-release-package.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v3"
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
- name: "Install PHP"
|
- name: "Install PHP"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
@ -29,6 +29,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: "Install Node"
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: ".nvmrc"
|
||||||
|
cache: "yarn"
|
||||||
|
|
||||||
- name: Create the package
|
- name: Create the package
|
||||||
run: make release VERSION=${{ github.event.release.tag_name }}
|
run: make release VERSION=${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,6 +15,7 @@
|
|||||||
.php-cs-fixer.cache
|
.php-cs-fixer.cache
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
||||||
phpunit.xml
|
phpunit.xml
|
||||||
|
docker-compose.override.yml
|
||||||
|
|
||||||
# Parameters
|
# Parameters
|
||||||
/app/config/parameters.yml
|
/app/config/parameters.yml
|
||||||
@ -50,6 +51,7 @@ bin
|
|||||||
app/Resources/build/
|
app/Resources/build/
|
||||||
!/src/Wallabag/CoreBundle/Resources/public
|
!/src/Wallabag/CoreBundle/Resources/public
|
||||||
/src/Wallabag/CoreBundle/Resources/public/*
|
/src/Wallabag/CoreBundle/Resources/public/*
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
# Test-generated files
|
# Test-generated files
|
||||||
admin-export.json
|
admin-export.json
|
||||||
|
|||||||
92
CHANGELOG.md
92
CHANGELOG.md
@ -1,5 +1,97 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.6.7](https://github.com/wallabag/wallabag/tree/2.6.7)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.6...2.6.7)
|
||||||
|
|
||||||
|
### Security fix
|
||||||
|
* A user can disable her 2FA unintentionally by @kdecherf in https://github.com/wallabag/wallabag/commit/0cfdddc2eb0aee5ffb69bf499d377d75655ba157
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fix deprecated null tag parameter by @Simounet in https://github.com/wallabag/wallabag/pull/6985
|
||||||
|
* Full clickable card on mass action by @Simounet in https://github.com/wallabag/wallabag/pull/6991
|
||||||
|
* Add tag form submit button always displayed by @Simounet in https://github.com/wallabag/wallabag/pull/6986
|
||||||
|
|
||||||
|
## [2.6.6](https://github.com/wallabag/wallabag/tree/2.6.6)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.5...2.6.6)
|
||||||
|
|
||||||
|
### Security fix
|
||||||
|
* Force secure cookie on HTTPS connection by @j0k3r in https://github.com/wallabag/wallabag/pull/6924
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fix checkboxes pointer events issue by @Simounet in https://github.com/wallabag/wallabag/pull/6897
|
||||||
|
* Add Google mailer by @j0k3r in https://github.com/wallabag/wallabag/pull/6899
|
||||||
|
* Improve performance on homepage by @Simounet in https://github.com/wallabag/wallabag/pull/6909
|
||||||
|
* Mass action layout improved by @Simounet in https://github.com/wallabag/wallabag/pull/6912
|
||||||
|
|
||||||
|
## [2.6.5](https://github.com/wallabag/wallabag/tree/2.6.5)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.4...2.6.5)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* "Fix checkboxes pointer-events disabled" by @Simounet https://github.com/wallabag/wallabag/pull/6874
|
||||||
|
* "Fix nav input styles" by @Simounet https://github.com/wallabag/wallabag/pull/6877
|
||||||
|
* "Change domain status filters html types" by @Simounet https://github.com/wallabag/wallabag/pull/6888
|
||||||
|
|
||||||
|
## [2.6.4](https://github.com/wallabag/wallabag/tree/2.6.4)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fix API token generation by @nicosomb https://github.com/wallabag/wallabag/pull/6869
|
||||||
|
* Fix checkboxes which were broken by @nicosomb https://github.com/wallabag/wallabag/pull/6864
|
||||||
|
|
||||||
|
## [2.6.3](https://github.com/wallabag/wallabag/tree/2.6.3)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.2...2.6.3)
|
||||||
|
|
||||||
|
### Security fixes
|
||||||
|
* Replace GET way to POST way to reset data user by @nicosomb https://github.com/wallabag/wallabag/commit/78b0b55c40511e1f22d5bbb4897aa10fca68441c
|
||||||
|
* Replace GET way to POST way to delete API client by @nicosomb https://github.com/wallabag/wallabag/commit/ffcc5c9062fcc8cd922d7d6d65edbe5efae96806
|
||||||
|
|
||||||
|
### Improvement
|
||||||
|
* Add confirmation before reload entry by @nicosomb https://github.com/wallabag/wallabag/pull/6778
|
||||||
|
* Remove external dependencies on howto page by @viktoriussuwandi https://github.com/wallabag/wallabag/pull/6775
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Use Session instead of Referrer for Redirection by @Spoons https://github.com/wallabag/wallabag/pull/6119
|
||||||
|
* Reduce risk of collision for #content by @kdecherf https://github.com/wallabag/wallabag/pull/6829
|
||||||
|
* Update dependencies to fix vulnerabilities by @nicosomb https://github.com/wallabag/wallabag/pull/6783
|
||||||
|
* Fix failing randomly test by @nicosomb https://github.com/wallabag/wallabag/pull/6763
|
||||||
|
|
||||||
|
### Technical stuff
|
||||||
|
* Add check if git is installed by @nicosomb https://github.com/wallabag/wallabag/pull/6788
|
||||||
|
* Replace kernel.root_dir by kernel.project_dir by @yguedidi https://github.com/wallabag/wallabag/pull/6809
|
||||||
|
* Split symfony/symfony by @yguedidi https://github.com/wallabag/wallabag/pull/6817
|
||||||
|
* Make Crawler::extract get an array by @yguedidi https://github.com/wallabag/wallabag/pull/6812
|
||||||
|
* Use PSR-17 and PSR-18 by @yguedidi https://github.com/wallabag/wallabag/pull/6816
|
||||||
|
* Replace Client by KernelBrowser by @yguedidi https://github.com/wallabag/wallabag/pull/6813
|
||||||
|
* Replace Debug component by ErrorHandler component by @yguedidi https://github.com/wallabag/wallabag/pull/6810
|
||||||
|
* Make ImportController extends AbstractController by @yguedidi https://github.com/wallabag/wallabag/pull/6808
|
||||||
|
* Use Twig instead of templating by @yguedidi https://github.com/wallabag/wallabag/pull/6797
|
||||||
|
* Identify platforms by their class by @yguedidi https://github.com/wallabag/wallabag/pull/6799
|
||||||
|
* Move from transchoice to trans by @yguedidi https://github.com/wallabag/wallabag/pull/6800
|
||||||
|
* Replace GetResponseEvent by RequestEvent by @yguedidi https://github.com/wallabag/wallabag/pull/6811
|
||||||
|
* Ensure the kernel is shut down before calling createClient by @yguedidi https://github.com/wallabag/wallabag/pull/6803
|
||||||
|
* Ignore docker-compose.override.yml by @yguedidi https://github.com/wallabag/wallabag/pull/6814
|
||||||
|
* Add composer normalizer by @nicosomb https://github.com/wallabag/wallabag/pull/6762
|
||||||
|
|
||||||
|
## [2.6.2](https://github.com/wallabag/wallabag/tree/2.6.2)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.1...2.6.2)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fix mass action input on dark theme by @simounet https://github.com/wallabag/wallabag/pull/6673
|
||||||
|
* Fix undefined variable by @nicosomb https://github.com/wallabag/wallabag/pull/6672
|
||||||
|
* Fix table name in migration by @nicosomb https://github.com/wallabag/wallabag/pull/6653
|
||||||
|
|
||||||
|
### Technical stuff
|
||||||
|
* Add a new build to test when no database table prefix are defined by @j0k3r https://github.com/wallabag/wallabag/pull/6731
|
||||||
|
* Keep escaped table name while migrating by @Glandos https://github.com/wallabag/wallabag/pull/6710
|
||||||
|
* Remove twofactor_auth parameter by @nicosomb https://github.com/wallabag/wallabag/pull/6723
|
||||||
|
* ApiDoc: Add response description to UserRestController by @caspermeijn https://github.com/wallabag/wallabag/pull/6684
|
||||||
|
* ApiDoc: Add response description to WallabagRestController by @caspermeijn https://github.com/wallabag/wallabag/pull/6102
|
||||||
|
* Skip migration if the table was already renamed by @gramakri https://github.com/wallabag/wallabag/pull/6678
|
||||||
|
|
||||||
|
### Meta
|
||||||
|
* Document how to run tests and formatter for new contributors by @caspermeijn https://github.com/wallabag/wallabag/pull/6685
|
||||||
|
* Add link to wallabag ecosystem resources by @nicosomb https://github.com/wallabag/wallabag/pull/6700
|
||||||
|
|
||||||
## [2.6.1](https://github.com/wallabag/wallabag/tree/2.6.1)
|
## [2.6.1](https://github.com/wallabag/wallabag/tree/2.6.1)
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.0...2.6.1)
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.0...2.6.1)
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ ifdef DB
|
|||||||
endif
|
endif
|
||||||
-php bin/console doctrine:database:drop --force --env=test
|
-php bin/console doctrine:database:drop --force --env=test
|
||||||
php bin/console doctrine:database:create --env=test
|
php bin/console doctrine:database:create --env=test
|
||||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
php bin/console doctrine:migrations:migrate --no-interaction --env=test -vv
|
||||||
|
|
||||||
fixtures: ## Load fixtures into database
|
fixtures: ## Load fixtures into database
|
||||||
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||||
|
|||||||
@ -18,6 +18,7 @@ You can install it on your own server, or you can create an account on [wallabag
|
|||||||
* iOS app: [wallabag/ios-app](https://github.com/wallabag/ios-app)
|
* iOS app: [wallabag/ios-app](https://github.com/wallabag/ios-app)
|
||||||
* Browser extension: [wallabag/wallabagger](https://github.com/wallabag/wallabagger)
|
* Browser extension: [wallabag/wallabagger](https://github.com/wallabag/wallabagger)
|
||||||
* GNOME (Linux) app: [read-it-later](https://gitlab.gnome.org/World/read-it-later) (not maintained by this project)
|
* GNOME (Linux) app: [read-it-later](https://gitlab.gnome.org/World/read-it-later) (not maintained by this project)
|
||||||
|
* All resources about wallabag ecosystem are listed here: https://github.com/wallabag/wallabag/wiki/wallabag-ecosystem
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
@ -17,9 +17,8 @@ During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE` (li
|
|||||||
#### Create a new release on GitHub
|
#### Create a new release on GitHub
|
||||||
|
|
||||||
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new) by targetting the `master` branch or any appropriate branch (for instance backports).
|
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new) by targetting the `master` branch or any appropriate branch (for instance backports).
|
||||||
- Update [website](https://github.com/wallabag/website) to change the redirect rule for `/latest-v2-package` & `/latest-v2`. They both should redirect to the asset of the GitHub release.
|
- Update [website](https://github.com/wallabag/website) to change MD5 sum and create the release blog post (based on the changelog).
|
||||||
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
|
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
|
||||||
- Update [website](https://github.com/wallabag/website) website (downloads, MD5 sum, releases and new blog post)
|
|
||||||
- Put the next patch version suffixed with `-dev` in `app/config/wallabag.yml` (`wallabag_core.version`)
|
- Put the next patch version suffixed with `-dev` in `app/config/wallabag.yml` (`wallabag_core.version`)
|
||||||
- Drink a :beer:!
|
- Drink a :beer:!
|
||||||
|
|
||||||
|
|||||||
@ -62,11 +62,6 @@ class AppKernel extends Kernel
|
|||||||
return $bundles;
|
return $bundles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRootDir()
|
|
||||||
{
|
|
||||||
return __DIR__;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCacheDir()
|
public function getCacheDir()
|
||||||
{
|
{
|
||||||
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
|
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
|
||||||
@ -79,7 +74,7 @@ class AppKernel extends Kernel
|
|||||||
|
|
||||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||||
{
|
{
|
||||||
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
|
$loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml');
|
||||||
|
|
||||||
$loader->load(function ($container) {
|
$loader->load(function ($container) {
|
||||||
if ($container->getParameter('use_webpack_dev_server')) {
|
if ($container->getParameter('use_webpack_dev_server')) {
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -14,8 +17,10 @@ class Version20160401000000 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||||
@ -58,7 +63,7 @@ SQL
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||||
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||||
@ -91,7 +96,7 @@ SQL
|
|||||||
$this->addSql($query);
|
$this->addSql($query);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ class Version20160812120952 extends WallabagMigration
|
|||||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||||
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||||
// Can't use $clientsTable->addColumn('name', 'blob');
|
// Can't use $clientsTable->addColumn('name', 'blob');
|
||||||
// because of the error:
|
// because of the error:
|
||||||
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
|
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
|
||||||
@ -35,7 +36,7 @@ class Version20160812120952 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||||
|
|
||||||
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||||
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
|
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
|
||||||
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
|
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
|
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
|
||||||
|
|||||||
@ -3,6 +3,9 @@
|
|||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -13,11 +16,13 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
|
|
||||||
|
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
|
|
||||||
// remove all FK from entry_tag
|
// remove all FK from entry_tag
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
switch (true) {
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT CONSTRAINT_NAME
|
SELECT CONSTRAINT_NAME
|
||||||
FROM information_schema.key_column_usage
|
FROM information_schema.key_column_usage
|
||||||
@ -29,7 +34,7 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT conrelid::regclass AS table_from
|
SELECT conrelid::regclass AS table_from
|
||||||
@ -53,8 +58,8 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
|
|
||||||
// remove entry FK from annotation
|
// remove entry FK from annotation
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
switch (true) {
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT CONSTRAINT_NAME
|
SELECT CONSTRAINT_NAME
|
||||||
FROM information_schema.key_column_usage
|
FROM information_schema.key_column_usage
|
||||||
@ -68,7 +73,7 @@ class Version20161001072726 extends WallabagMigration
|
|||||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||||
$query = $this->connection->query("
|
$query = $this->connection->query("
|
||||||
SELECT conrelid::regclass AS table_from
|
SELECT conrelid::regclass AS table_from
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ class Version20161022134138 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
|
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ class Version20161022134138 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
|
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ class Version20161024212538 extends WallabagMigration
|
|||||||
|
|
||||||
$clientsTable->dropColumn('user_id', 'integer');
|
$clientsTable->dropColumn('user_id', 'integer');
|
||||||
|
|
||||||
if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) {
|
if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||||
$clientsTable->removeForeignKey($this->constraintName);
|
$clientsTable->removeForeignKey($this->constraintName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -16,18 +19,20 @@ class Version20161214094402 extends WallabagMigration
|
|||||||
|
|
||||||
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
|
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
|
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
|
||||||
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
|
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
|
||||||
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
|
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
|
||||||
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
|
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
|
||||||
$this->addSql('DROP TABLE __temp__wallabag_entry');
|
$this->addSql('DROP TABLE __temp__wallabag_entry');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,14 +43,16 @@ class Version20161214094402 extends WallabagMigration
|
|||||||
|
|
||||||
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
|
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
throw new SkipMigrationException('Too complex ...');
|
throw new SkipMigrationException('Too complex ...');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ class Version20170501115751 extends WallabagMigration
|
|||||||
$table->setPrimaryKey(['id']);
|
$table->setPrimaryKey(['id']);
|
||||||
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
|
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
|
||||||
|
|
||||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||||
$schema->dropSequence('site_credential_id_seq');
|
$schema->dropSequence('site_credential_id_seq');
|
||||||
$schema->createSequence('site_credential_id_seq');
|
$schema->createSequence('site_credential_id_seq');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -19,7 +20,7 @@ class Version20170510082609 extends WallabagMigration
|
|||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||||
|
|
||||||
foreach ($this->fields as $field) {
|
foreach ($this->fields as $field) {
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
|
||||||
@ -28,7 +29,7 @@ class Version20170510082609 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||||
|
|
||||||
foreach ($this->fields as $field) {
|
foreach ($this->fields as $field) {
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
||||||
|
|||||||
@ -3,6 +3,9 @@
|
|||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -13,8 +16,10 @@ class Version20170511211659 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$annotationTableName = $this->getTable('annotation', true);
|
$annotationTableName = $this->getTable('annotation', true);
|
||||||
$userTableName = $this->getTable('user', true);
|
$userTableName = $this->getTable('user', true);
|
||||||
$entryTableName = $this->getTable('entry', true);
|
$entryTableName = $this->getTable('entry', true);
|
||||||
@ -53,10 +58,10 @@ EOD
|
|||||||
);
|
);
|
||||||
$this->addSql('DROP TABLE __temp__wallabag_annotation');
|
$this->addSql('DROP TABLE __temp__wallabag_annotation');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
|
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -66,14 +71,16 @@ EOD
|
|||||||
{
|
{
|
||||||
$tableName = $this->getTable('annotation');
|
$tableName = $this->getTable('annotation');
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
throw new SkipMigrationException('Too complex ...');
|
throw new SkipMigrationException('Too complex ...');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
|
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,8 @@ class Version20170606155640 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
|
$this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Table already renamed');
|
||||||
|
|
||||||
$apiUserRegistration = $this->container
|
$apiUserRegistration = $this->container
|
||||||
->get('doctrine.orm.default_entity_manager')
|
->get('doctrine.orm.default_entity_manager')
|
||||||
->getConnection()
|
->getConnection()
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ class Version20170719231144 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
$this->skipIf($this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
|
|
||||||
// Find tags which need to be merged
|
// Find tags which need to be merged
|
||||||
$dupTags = $this->connection->query('
|
$dupTags = $this->connection->query('
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,14 +15,16 @@ class Version20171008195606 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
case 'mysql':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
|
||||||
break;
|
break;
|
||||||
@ -28,13 +33,15 @@ class Version20171008195606 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
|
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||||
case 'mysql':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ class Version20181128203230 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
||||||
@ -27,7 +28,7 @@ class Version20181128203230 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,8 +15,10 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||||
@ -28,13 +33,13 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||||
@ -45,8 +50,10 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||||
@ -59,13 +66,13 @@ final class Version20181202073750 extends WallabagMigration
|
|||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
|
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,8 +15,10 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
|
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
|
||||||
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
|
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
|
||||||
@ -22,11 +27,11 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
|
||||||
break;
|
break;
|
||||||
@ -35,8 +40,10 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
|
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
|
||||||
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
|
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
|
||||||
@ -45,11 +52,11 @@ final class Version20190425115043 extends WallabagMigration
|
|||||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
|
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -3,6 +3,9 @@
|
|||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -17,8 +20,10 @@ final class Version20190510141130 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
|
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
|
||||||
$this->addSql('DROP INDEX IDX_368A420919EB6921');
|
$this->addSql('DROP INDEX IDX_368A420919EB6921');
|
||||||
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
|
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
|
||||||
@ -60,7 +65,7 @@ final class Version20190510141130 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
|
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
|
||||||
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
|
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||||
|
|
||||||
@ -75,7 +80,7 @@ final class Version20190510141130 extends WallabagMigration
|
|||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ final class Version20190511165128 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||||
@ -22,7 +23,7 @@ final class Version20190511165128 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ final class Version20190619093534 extends WallabagMigration
|
|||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
||||||
|
|
||||||
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ final class Version20190619093534 extends WallabagMigration
|
|||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
||||||
|
|
||||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||||
$this->addSql('DROP INDEX created_at');
|
$this->addSql('DROP INDEX created_at');
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -18,8 +21,10 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX uid');
|
$this->addSql('DROP INDEX uid');
|
||||||
$this->addSql('DROP INDEX created_at');
|
$this->addSql('DROP INDEX created_at');
|
||||||
$this->addSql('DROP INDEX hashed_url_user_id');
|
$this->addSql('DROP INDEX hashed_url_user_id');
|
||||||
@ -44,7 +49,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
|
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
|
||||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
|
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
||||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||||
@ -53,7 +58,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
|
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
|
||||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
|
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
||||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||||
@ -67,8 +72,10 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||||
$this->addSql('DROP INDEX created_at');
|
$this->addSql('DROP INDEX created_at');
|
||||||
$this->addSql('DROP INDEX uid');
|
$this->addSql('DROP INDEX uid');
|
||||||
@ -93,7 +100,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
|
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
|
||||||
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
||||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||||
@ -102,7 +109,7 @@ final class Version20190806130304 extends WallabagMigration
|
|||||||
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
|
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
|
||||||
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
|
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
||||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,14 +15,16 @@ final class Version20190808124957 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -27,14 +32,16 @@ final class Version20190808124957 extends WallabagMigration
|
|||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
case 'sqlite':
|
|
||||||
|
switch (true) {
|
||||||
|
case $platform instanceof SqlitePlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
|
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
|
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ final class Version20190826204730 extends WallabagMigration
|
|||||||
$userTable->setPrimaryKey(['id']);
|
$userTable->setPrimaryKey(['id']);
|
||||||
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
|
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
|
||||||
|
|
||||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||||
$schema->dropSequence('ignore_origin_user_rule_id_seq');
|
$schema->dropSequence('ignore_origin_user_rule_id_seq');
|
||||||
$schema->createSequence('ignore_origin_user_rule_id_seq');
|
$schema->createSequence('ignore_origin_user_rule_id_seq');
|
||||||
}
|
}
|
||||||
@ -35,7 +36,7 @@ final class Version20190826204730 extends WallabagMigration
|
|||||||
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
|
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
|
||||||
$instanceTable->setPrimaryKey(['id']);
|
$instanceTable->setPrimaryKey(['id']);
|
||||||
|
|
||||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||||
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
|
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
|
||||||
$schema->createSequence('ignore_origin_instance_rule_id_seq');
|
$schema->createSequence('ignore_origin_instance_rule_id_seq');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
namespace Application\Migrations;
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
@ -12,48 +15,54 @@ final class Version20221221092957 extends WallabagMigration
|
|||||||
{
|
{
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$userTable = $this->getTable('user');
|
||||||
case 'sqlite':
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM wallabag_user');
|
|
||||||
$this->addSql('DROP TABLE wallabag_user');
|
switch (true) {
|
||||||
$this->addSql('CREATE TABLE "wallabag_user" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
case $platform instanceof SqlitePlatform:
|
||||||
|
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM ' . $userTable);
|
||||||
|
$this->addSql('DROP TABLE ' . $userTable);
|
||||||
|
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||||
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json)
|
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json)
|
||||||
, emailTwoFactor BOOLEAN NOT NULL)');
|
, emailTwoFactor BOOLEAN NOT NULL)');
|
||||||
$this->addSql('INSERT INTO wallabag_user (id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes) SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM __temp__wallabag_user');
|
$this->addSql('INSERT INTO ' . $userTable . ' (id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes) SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM __temp__wallabag_user');
|
||||||
$this->addSql('DROP TABLE __temp__wallabag_user');
|
$this->addSql('DROP TABLE __temp__wallabag_user');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON wallabag_user (username_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $userTable . ' (username_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE wallabag_user CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE wallabag_user ALTER backupcodes TYPE JSON USING backupcodes::json');
|
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
$userTable = $this->getTable('user');
|
||||||
case 'sqlite':
|
$platform = $this->connection->getDatabasePlatform();
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM "wallabag_user"');
|
|
||||||
$this->addSql('DROP TABLE "wallabag_user"');
|
switch (true) {
|
||||||
$this->addSql('CREATE TABLE "wallabag_user" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
case $platform instanceof SqlitePlatform:
|
||||||
|
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM ' . $userTable);
|
||||||
|
$this->addSql('DROP TABLE ' . $userTable);
|
||||||
|
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||||
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json_array)
|
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json_array)
|
||||||
, emailTwoFactor BOOLEAN NOT NULL)');
|
, emailTwoFactor BOOLEAN NOT NULL)');
|
||||||
$this->addSql('INSERT INTO "wallabag_user" (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM __temp__wallabag_user');
|
$this->addSql('INSERT INTO ' . $userTable . ' (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM __temp__wallabag_user');
|
||||||
$this->addSql('DROP TABLE __temp__wallabag_user');
|
$this->addSql('DROP TABLE __temp__wallabag_user');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $userTable . ' (username_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case $platform instanceof MySQLPlatform:
|
||||||
$this->addSql('ALTER TABLE `wallabag_user`CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case $platform instanceof PostgreSQLPlatform:
|
||||||
$this->addSql('ALTER TABLE "wallabag_user" ALTER backupCodes TYPE TEXT');
|
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
app/DoctrineMigrations/Version20230728085538.php
Normal file
26
app/DoctrineMigrations/Version20230728085538.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove demonstration mode settings.
|
||||||
|
*/
|
||||||
|
final class Version20230728085538 extends WallabagMigration
|
||||||
|
{
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'demo_mode_enabled';");
|
||||||
|
$this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'demo_mode_username';");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('demo_mode_enabled', '0', 'misc');");
|
||||||
|
$this->addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('demo_mode_username', 'wallabag', 'misc');");
|
||||||
|
}
|
||||||
|
}
|
||||||
24
app/DoctrineMigrations/Version20230728091417.php
Normal file
24
app/DoctrineMigrations/Version20230728091417.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove mobi export.
|
||||||
|
*/
|
||||||
|
final class Version20230728091417 extends WallabagMigration
|
||||||
|
{
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('DELETE FROM' . $this->getTable('internal_setting') . " WHERE name = 'export_mobi';");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('INSERT INTO ' . $this->getTable('internal_setting') . " (name, value, section) VALUES ('export_mobi', '1', 'export');");
|
||||||
|
}
|
||||||
|
}
|
||||||
50
app/DoctrineMigrations/Version20230728093912.php
Normal file
50
app/DoctrineMigrations/Version20230728093912.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add is_not_parsed field to entry table.
|
||||||
|
*/
|
||||||
|
final class Version20230728093912 extends WallabagMigration
|
||||||
|
{
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||||
|
|
||||||
|
$this->skipIf($entryTable->hasColumn('is_not_parsed'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
|
$entryTable->addColumn('is_not_parsed', 'boolean', [
|
||||||
|
'default' => 0,
|
||||||
|
'notnull' => false,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query to update entries where content is equal to `fetching_error_message`.
|
||||||
|
*/
|
||||||
|
public function postUp(Schema $schema): void
|
||||||
|
{
|
||||||
|
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||||
|
$this->skipIf(!$entryTable->hasColumn('is_not_parsed'), 'Unable to update is_not_parsed colum');
|
||||||
|
|
||||||
|
// Need to do a `LIKE` with a final percent to handle the new line character
|
||||||
|
$this->connection->executeQuery(
|
||||||
|
'UPDATE ' . $this->getTable('entry') . ' SET is_not_parsed = :isNotParsed WHERE content LIKE :content',
|
||||||
|
[
|
||||||
|
'isNotParsed' => true,
|
||||||
|
'content' => str_replace("\n", '', addslashes($this->container->getParameter('wallabag_core.fetching_error_message'))) . '%',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||||
|
$entryTable->dropColumn('is_not_parsed');
|
||||||
|
}
|
||||||
|
}
|
||||||
47
app/DoctrineMigrations/Version20230729093853.php
Normal file
47
app/DoctrineMigrations/Version20230729093853.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Application\Migrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add custom_css column to config table.
|
||||||
|
*/
|
||||||
|
final class Version20230729093853 extends WallabagMigration
|
||||||
|
{
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$configTable = $schema->getTable($this->getTable('config'));
|
||||||
|
|
||||||
|
$this->skipIf($configTable->hasColumn('custom_css'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
|
$configTable->addColumn('custom_css', 'text', [
|
||||||
|
'notnull' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$configTable->addColumn('font', 'text', [
|
||||||
|
'notnull' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$configTable->addColumn('fontsize', 'float', [
|
||||||
|
'notnull' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$configTable->addColumn('line_height', 'float', [
|
||||||
|
'notnull' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$configTable->addColumn('max_width', 'float', [
|
||||||
|
'notnull' => false,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$configTable = $schema->getTable($this->getTable('config'));
|
||||||
|
$configTable->dropColumn('custom_css');
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,13 +10,18 @@ import 'mathjax/es5/tex-svg';
|
|||||||
/* Fonts */
|
/* Fonts */
|
||||||
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
||||||
import 'lato-font/css/lato-font.css';
|
import 'lato-font/css/lato-font.css';
|
||||||
|
import 'open-dyslexic/open-dyslexic-regular.css';
|
||||||
|
import '@fontsource/atkinson-hyperlegible';
|
||||||
|
import '@fontsource/eb-garamond';
|
||||||
|
import '@fontsource/montserrat';
|
||||||
|
import '@fontsource/oswald';
|
||||||
import './global.scss';
|
import './global.scss';
|
||||||
|
|
||||||
/* Shortcuts */
|
/* Shortcuts */
|
||||||
import './js/shortcuts/entry';
|
import './js/shortcuts/entry';
|
||||||
import './js/shortcuts/main';
|
import './js/shortcuts/main';
|
||||||
|
|
||||||
/* Hightlight */
|
/* Highlight */
|
||||||
import './js/highlight';
|
import './js/highlight';
|
||||||
|
|
||||||
import { savePercent, retrievePercent } from './js/tools';
|
import { savePercent, retrievePercent } from './js/tools';
|
||||||
@ -26,7 +31,7 @@ import { savePercent, retrievePercent } from './js/tools';
|
|||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
if ($('article').length) {
|
if ($('#article').length) {
|
||||||
const app = new annotator.App();
|
const app = new annotator.App();
|
||||||
|
|
||||||
app.include(annotator.ui.main, {
|
app.include(annotator.ui.main, {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
Article
|
Article
|
||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
#article {
|
#article, #preview-article {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: 45em;
|
max-width: 45em;
|
||||||
@ -235,6 +235,12 @@
|
|||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags-add-form {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 640px) {
|
@media only screen and (max-width: 640px) {
|
||||||
.entry-info {
|
.entry-info {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
@ -258,4 +264,12 @@
|
|||||||
#article .entry-info .chip-action {
|
#article .entry-info .chip-action {
|
||||||
min-width: 40px;
|
min-width: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags-add-form {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tags-add-form-submit {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
========================================================================== */
|
========================================================================== */
|
||||||
|
|
||||||
main {
|
main {
|
||||||
#content {
|
div#content {
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,6 +324,12 @@ a.original:not(.waves-effect) {
|
|||||||
height: 3rem;
|
height: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings .settings-range-label {
|
||||||
|
position: absolute;
|
||||||
|
top: -14px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
.entries-row {
|
.entries-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
margin: 0.4rem 0 0;
|
margin: 0.4rem 0 0;
|
||||||
|
|||||||
@ -14,44 +14,54 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mass-action {
|
.mass-action {
|
||||||
margin: 10px 5px 10px 20px;
|
margin: 20px 5px 10px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mass-action-group {
|
.mass-action-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
gap: 10px;
|
align-items: center;
|
||||||
|
gap: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mass-action-button {
|
.mass-action-button {
|
||||||
height: 24px;
|
height: 36px;
|
||||||
line-height: 24px;
|
line-height: 36px;
|
||||||
padding: 0 0.5rem;
|
padding: 0 0.7rem;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-checkbox {
|
.mass-action-button--tags {
|
||||||
margin: 10px 15px 10px 5px;
|
border-radius: 2px 0 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.card & {
|
.card-stacked .entry-checkbox {
|
||||||
float: right;
|
margin: 10px 15px 10px 5px;
|
||||||
margin-right: 0;
|
}
|
||||||
padding: 10px;
|
|
||||||
}
|
.card .entry-checkbox {
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
padding: 10px;
|
||||||
|
inset: 0;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: start;
|
||||||
|
background-color: rgb(0 172 193 / 20%);
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entries .entry-checkbox-input,
|
.entries .entry-checkbox-input,
|
||||||
.mass-action .entry-checkbox-input {
|
.mass-action .entry-checkbox-input {
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 0;
|
|
||||||
width: 20px;
|
width: 20px;
|
||||||
min-height: 25px;
|
min-height: 25px;
|
||||||
height: 100%;
|
|
||||||
vertical-align: middle;
|
|
||||||
opacity: initial;
|
opacity: initial;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-checkbox:not(:checked) + .mass-action,
|
.toggle-checkbox:not(:checked) + .mass-action,
|
||||||
@ -63,11 +73,19 @@
|
|||||||
|
|
||||||
.mass-action-tags {
|
.mass-action-tags {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
margin-top: 10px;
|
||||||
gap: 10px;
|
|
||||||
|
|
||||||
.mass-action-tags-input {
|
.mass-action-tags-input.mass-action-tags-input {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
padding: 0 5px;
|
||||||
|
height: 34px;
|
||||||
|
background: white;
|
||||||
|
border-bottom: 3px solid #c5ebef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mass-action-tags-input.mass-action-tags-input.mass-action-tags-input:focus {
|
||||||
|
border-bottom: 3px solid $blue-accent-color;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,13 +105,16 @@
|
|||||||
|
|
||||||
.results {
|
.results {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 10px;
|
||||||
padding: 1rem 1rem 0;
|
padding: 1rem 1rem 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
.nb-results {
|
.nb-results {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
margin-bottom: 20px;
|
||||||
|
gap: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.results-item {
|
.results-item {
|
||||||
@ -172,9 +193,38 @@ footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 993px) {
|
@media screen and (min-width: 993px) {
|
||||||
|
.results {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-results {
|
||||||
|
margin-bottom: 0;
|
||||||
|
gap: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mass-action-button {
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mass-action-group {
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mass-action-tags {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-left: 7px;
|
||||||
|
flex-wrap: initial;
|
||||||
|
}
|
||||||
|
|
||||||
.mass-action {
|
.mass-action {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-top: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 30px;
|
|
||||||
|
.mass-action-tags-input.mass-action-tags-input {
|
||||||
|
height: 21px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 993px) {
|
@media screen and (min-width: 993px) {
|
||||||
.entry #content {
|
.entry main div#content {
|
||||||
padding-left: 70px;
|
padding-left: 70px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,7 @@ nav {
|
|||||||
|
|
||||||
.input-field input {
|
.input-field input {
|
||||||
display: block;
|
display: block;
|
||||||
|
font-size: 1.2rem;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
}
|
}
|
||||||
@ -79,6 +80,17 @@ nav {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* materializecss override */
|
||||||
|
.input-field.input-field input {
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-field.input-field input:focus {
|
||||||
|
border-bottom: none;
|
||||||
|
box-shadow: initial;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-panel-top {
|
.nav-panel-top {
|
||||||
|
|||||||
@ -15,6 +15,13 @@ div.settings div.file-field {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* override materializecss pointer-event disabled on checkboxes */
|
||||||
|
[type="checkbox"]:not(:checked),
|
||||||
|
[type="checkbox"]:checked,
|
||||||
|
.input-field label {
|
||||||
|
pointer-events: initial;
|
||||||
|
}
|
||||||
|
|
||||||
.input-field label.active {
|
.input-field label.active {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,9 @@ import 'materialize-css/dist/js/materialize';
|
|||||||
import '../_global/index';
|
import '../_global/index';
|
||||||
|
|
||||||
/* Tools */
|
/* Tools */
|
||||||
import { initExport, initFilters, initRandom } from './js/tools';
|
import {
|
||||||
|
initExport, initFilters, initRandom, initPreviewText,
|
||||||
|
} from './js/tools';
|
||||||
|
|
||||||
/* Import shortcuts */
|
/* Import shortcuts */
|
||||||
import './js/shortcuts/main';
|
import './js/shortcuts/main';
|
||||||
@ -177,6 +179,7 @@ $(document).ready(() => {
|
|||||||
initRandom();
|
initRandom();
|
||||||
stickyNav();
|
stickyNav();
|
||||||
articleScroll();
|
articleScroll();
|
||||||
|
initPreviewText();
|
||||||
|
|
||||||
const toggleNav = (toShow, toFocus) => {
|
const toggleNav = (toShow, toFocus) => {
|
||||||
$('.nav-panel-actions').hide(100);
|
$('.nav-panel-actions').hide(100);
|
||||||
@ -199,6 +202,29 @@ $(document).ready(() => {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#config_fontsize').on('input', () => {
|
||||||
|
const value = $('#config_fontsize').val();
|
||||||
|
const css = `${value}em`;
|
||||||
|
$('#preview-content').css('font-size', css);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#config_font').on('change', () => {
|
||||||
|
const value = $('#config_font').val();
|
||||||
|
$('#preview-content').css('font-family', value);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#config_lineHeight').on('input', () => {
|
||||||
|
const value = $('#config_lineHeight').val();
|
||||||
|
const css = `${value}em`;
|
||||||
|
$('#preview-content').css('line-height', css);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#config_maxWidth').on('input', () => {
|
||||||
|
const value = $('#config_maxWidth').val();
|
||||||
|
const css = `${value}em`;
|
||||||
|
$('#preview-article').css('max-width', css);
|
||||||
|
});
|
||||||
|
|
||||||
const materialAddForm = $('.nav-panel-add');
|
const materialAddForm = $('.nav-panel-add');
|
||||||
materialAddForm.on('submit', () => {
|
materialAddForm.on('submit', () => {
|
||||||
materialAddForm.addClass('disabled');
|
materialAddForm.addClass('disabled');
|
||||||
|
|||||||
@ -29,8 +29,25 @@ function initRandom() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initPreviewText() {
|
||||||
|
// no display if preview_text not available
|
||||||
|
if ($('div').is('#preview-article')) {
|
||||||
|
const defaultFontFamily = $('#config_font').val();
|
||||||
|
const defaultFontSize = $('#config_fontsize').val();
|
||||||
|
const defaultLineHeight = $('#config_lineHeight').val();
|
||||||
|
const defaultMaxWidth = $('#config_maxWidth').val();
|
||||||
|
const previewContent = $('#preview-content');
|
||||||
|
|
||||||
|
previewContent.css('font-family', defaultFontFamily);
|
||||||
|
previewContent.css('font-size', `${defaultFontSize}em`);
|
||||||
|
previewContent.css('line-height', `${defaultLineHeight}em`);
|
||||||
|
$('#preview-article').css('max-width', `${defaultMaxWidth}em`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
initExport,
|
initExport,
|
||||||
initFilters,
|
initFilters,
|
||||||
initRandom,
|
initRandom,
|
||||||
|
initPreviewText,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -23,14 +23,13 @@ framework:
|
|||||||
csrf_protection: ~
|
csrf_protection: ~
|
||||||
validation:
|
validation:
|
||||||
enable_annotations: true
|
enable_annotations: true
|
||||||
templating:
|
|
||||||
engines: ['twig']
|
|
||||||
default_locale: "%locale%"
|
default_locale: "%locale%"
|
||||||
trusted_hosts: ~
|
trusted_hosts: ~
|
||||||
session:
|
session:
|
||||||
# handler_id set to null will use default session handler from php.ini
|
# handler_id set to null will use default session handler from php.ini
|
||||||
handler_id: session.handler.native_file
|
handler_id: session.handler.native_file
|
||||||
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
|
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
|
||||||
|
cookie_secure: auto
|
||||||
fragments: ~
|
fragments: ~
|
||||||
http_method_override: true
|
http_method_override: true
|
||||||
assets: ~
|
assets: ~
|
||||||
@ -43,7 +42,6 @@ twig:
|
|||||||
strict_variables: "%kernel.debug%"
|
strict_variables: "%kernel.debug%"
|
||||||
form_themes:
|
form_themes:
|
||||||
- "@LexikFormFilter/Form/form_div_layout.html.twig"
|
- "@LexikFormFilter/Form/form_div_layout.html.twig"
|
||||||
exception_controller: Wallabag\CoreBundle\Controller\ExceptionController:showAction
|
|
||||||
globals:
|
globals:
|
||||||
registration_enabled: '%fosuser_registration%'
|
registration_enabled: '%fosuser_registration%'
|
||||||
|
|
||||||
@ -98,8 +96,6 @@ fos_rest:
|
|||||||
- 'application/pdf'
|
- 'application/pdf'
|
||||||
epub:
|
epub:
|
||||||
- 'application/epub+zip'
|
- 'application/epub+zip'
|
||||||
mobi:
|
|
||||||
- 'application/x-mobipocket-ebook'
|
|
||||||
view_response_listener: 'force'
|
view_response_listener: 'force'
|
||||||
formats:
|
formats:
|
||||||
xml: true
|
xml: true
|
||||||
@ -108,13 +104,12 @@ fos_rest:
|
|||||||
csv: true
|
csv: true
|
||||||
pdf: true
|
pdf: true
|
||||||
epub: true
|
epub: true
|
||||||
mobi: true
|
|
||||||
failed_validation: HTTP_BAD_REQUEST
|
failed_validation: HTTP_BAD_REQUEST
|
||||||
routing_loader: false
|
routing_loader: false
|
||||||
format_listener:
|
format_listener:
|
||||||
enabled: true
|
enabled: true
|
||||||
rules:
|
rules:
|
||||||
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false }
|
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false }
|
||||||
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
||||||
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
|
||||||
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener
|
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener
|
||||||
@ -201,15 +196,15 @@ scheb_two_factor:
|
|||||||
lifetime: 2592000
|
lifetime: 2592000
|
||||||
|
|
||||||
backup_codes:
|
backup_codes:
|
||||||
enabled: "%twofactor_auth%"
|
enabled: true
|
||||||
|
|
||||||
google:
|
google:
|
||||||
enabled: "%twofactor_auth%"
|
enabled: true
|
||||||
issuer: "%server_name%"
|
issuer: "%server_name%"
|
||||||
template: "@WallabagUser/Authentication/form.html.twig"
|
template: "@WallabagUser/Authentication/form.html.twig"
|
||||||
|
|
||||||
email:
|
email:
|
||||||
enabled: "%twofactor_auth%"
|
enabled: true
|
||||||
sender_email: "%twofactor_sender%"
|
sender_email: "%twofactor_sender%"
|
||||||
digits: 6
|
digits: 6
|
||||||
template: "@WallabagUser/Authentication/form.html.twig"
|
template: "@WallabagUser/Authentication/form.html.twig"
|
||||||
@ -279,6 +274,16 @@ old_sound_rabbit_mq:
|
|||||||
exchange_options:
|
exchange_options:
|
||||||
name: 'wallabag.import.chrome'
|
name: 'wallabag.import.chrome'
|
||||||
type: topic
|
type: topic
|
||||||
|
import_shaarli:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.shaarli'
|
||||||
|
type: topic
|
||||||
|
import_pocket_html:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.pocket_html'
|
||||||
|
type: topic
|
||||||
consumers:
|
consumers:
|
||||||
import_pocket:
|
import_pocket:
|
||||||
connection: default
|
connection: default
|
||||||
@ -370,6 +375,24 @@ old_sound_rabbit_mq:
|
|||||||
name: 'wallabag.import.chrome'
|
name: 'wallabag.import.chrome'
|
||||||
callback: wallabag_import.consumer.amqp.chrome
|
callback: wallabag_import.consumer.amqp.chrome
|
||||||
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
||||||
|
import_shaarli:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.shaarli'
|
||||||
|
type: topic
|
||||||
|
queue_options:
|
||||||
|
name: 'wallabag.import.shaarli'
|
||||||
|
callback: wallabag_import.consumer.amqp.shaarli
|
||||||
|
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
||||||
|
import_pocket_html:
|
||||||
|
connection: default
|
||||||
|
exchange_options:
|
||||||
|
name: 'wallabag.import.pocket_html'
|
||||||
|
type: topic
|
||||||
|
queue_options:
|
||||||
|
name: 'wallabag.import.pocket_html'
|
||||||
|
callback: wallabag_import.consumer.amqp.pocket_html
|
||||||
|
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
|
||||||
|
|
||||||
fos_js_routing:
|
fos_js_routing:
|
||||||
routes_to_expose:
|
routes_to_expose:
|
||||||
|
|||||||
@ -34,11 +34,10 @@ parameters:
|
|||||||
secret: CHANGE_ME_TO_SOMETHING_SECRET_AND_RANDOM
|
secret: CHANGE_ME_TO_SOMETHING_SECRET_AND_RANDOM
|
||||||
|
|
||||||
# two factor stuff
|
# two factor stuff
|
||||||
twofactor_auth: true
|
|
||||||
twofactor_sender: no-reply@wallabag.org
|
twofactor_sender: no-reply@wallabag.org
|
||||||
|
|
||||||
# fosuser stuff
|
# fosuser stuff
|
||||||
fosuser_registration: true
|
fosuser_registration: false
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
# how long the access token should live in seconds for the API
|
# how long the access token should live in seconds for the API
|
||||||
|
|||||||
@ -5,5 +5,5 @@ parameters:
|
|||||||
opera: https://addons.opera.com/en/extensions/details/wallabagger/?display=en
|
opera: https://addons.opera.com/en/extensions/details/wallabagger/?display=en
|
||||||
f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
|
f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
|
||||||
google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
|
google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
|
||||||
ios: https://itunes.apple.com/app/wallabag-2/id1170800946?mt=8
|
ios: https://apps.apple.com/app/wallabag-2/id1170800946?mt=8
|
||||||
windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
|
windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
|
||||||
|
|||||||
@ -8,3 +8,4 @@ parameters:
|
|||||||
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
||||||
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
||||||
test_database_charset: utf8
|
test_database_charset: utf8
|
||||||
|
fosuser_registration: true
|
||||||
|
|||||||
@ -12,7 +12,7 @@ services:
|
|||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
public: true
|
public: true
|
||||||
bind:
|
bind:
|
||||||
$rootDir: '%kernel.root_dir%'
|
$projectDir: '%kernel.project_dir%'
|
||||||
$debug: '%kernel.debug%'
|
$debug: '%kernel.debug%'
|
||||||
$defaultLocale: '%kernel.default_locale%'
|
$defaultLocale: '%kernel.default_locale%'
|
||||||
$wallabagUrl: '%domain_name%'
|
$wallabagUrl: '%domain_name%'
|
||||||
@ -30,6 +30,7 @@ services:
|
|||||||
$senderName: "%scheb_two_factor.email.sender_name%"
|
$senderName: "%scheb_two_factor.email.sender_name%"
|
||||||
$storeArticleHeaders: '@=service(''craue_config'').get(''store_article_headers'')'
|
$storeArticleHeaders: '@=service(''craue_config'').get(''store_article_headers'')'
|
||||||
$supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')'
|
$supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')'
|
||||||
|
$fonts: '%wallabag_core.fonts%'
|
||||||
|
|
||||||
Wallabag\AnnotationBundle\:
|
Wallabag\AnnotationBundle\:
|
||||||
resource: '../../src/Wallabag/AnnotationBundle/*'
|
resource: '../../src/Wallabag/AnnotationBundle/*'
|
||||||
@ -116,6 +117,16 @@ services:
|
|||||||
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer'
|
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer'
|
||||||
$redisProducer: '@wallabag_import.producer.redis.wallabag_v2'
|
$redisProducer: '@wallabag_import.producer.redis.wallabag_v2'
|
||||||
|
|
||||||
|
Wallabag\ImportBundle\Controller\ShaarliController:
|
||||||
|
arguments:
|
||||||
|
$rabbitMqProducer: '@old_sound_rabbit_mq.import_shaarli_producer'
|
||||||
|
$redisProducer: '@wallabag_import.producer.redis.shaarli'
|
||||||
|
|
||||||
|
Wallabag\ImportBundle\Controller\PocketHtmlController:
|
||||||
|
arguments:
|
||||||
|
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_html_producer'
|
||||||
|
$redisProducer: '@wallabag_import.producer.redis.pocket_html'
|
||||||
|
|
||||||
Wallabag\ImportBundle\:
|
Wallabag\ImportBundle\:
|
||||||
resource: '../../src/Wallabag/ImportBundle/*'
|
resource: '../../src/Wallabag/ImportBundle/*'
|
||||||
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
|
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
|
||||||
@ -172,6 +183,9 @@ services:
|
|||||||
MatomoTwigExtension\MatomoTwigExtension:
|
MatomoTwigExtension\MatomoTwigExtension:
|
||||||
public: false
|
public: false
|
||||||
|
|
||||||
|
ScssPhp\ScssPhp\Compiler:
|
||||||
|
public: false
|
||||||
|
|
||||||
Wallabag\CoreBundle\Event\Listener\UserLocaleListener:
|
Wallabag\CoreBundle\Event\Listener\UserLocaleListener:
|
||||||
tags:
|
tags:
|
||||||
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
|
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
|
||||||
@ -351,6 +365,14 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: wallabag_import.import, alias: chrome }
|
- { name: wallabag_import.import, alias: chrome }
|
||||||
|
|
||||||
|
Wallabag\ImportBundle\Import\ShaarliImport:
|
||||||
|
tags:
|
||||||
|
- { name: wallabag_import.import, alias: shaarli }
|
||||||
|
|
||||||
|
Wallabag\ImportBundle\Import\PocketHtmlImport:
|
||||||
|
tags:
|
||||||
|
- { name: wallabag_import.import, alias: pocket_html }
|
||||||
|
|
||||||
# to factorize the proximity and bypass translation for prev & next
|
# to factorize the proximity and bypass translation for prev & next
|
||||||
pagerfanta.view.default_wallabag:
|
pagerfanta.view.default_wallabag:
|
||||||
class: Pagerfanta\View\OptionableView
|
class: Pagerfanta\View\OptionableView
|
||||||
|
|||||||
@ -18,6 +18,8 @@ services:
|
|||||||
$pinboardConsumer: '@old_sound_rabbit_mq.import_pinboard_consumer'
|
$pinboardConsumer: '@old_sound_rabbit_mq.import_pinboard_consumer'
|
||||||
$deliciousConsumer: '@old_sound_rabbit_mq.import_delicious_consumer'
|
$deliciousConsumer: '@old_sound_rabbit_mq.import_delicious_consumer'
|
||||||
$elcuratorConsumer: '@old_sound_rabbit_mq.import_elcurator_consumer'
|
$elcuratorConsumer: '@old_sound_rabbit_mq.import_elcurator_consumer'
|
||||||
|
$shaarliConsumer: '@old_sound_rabbit_mq.import_shaarli_consumer'
|
||||||
|
$pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer'
|
||||||
|
|
||||||
wallabag_import.consumer.amqp.pocket:
|
wallabag_import.consumer.amqp.pocket:
|
||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
@ -68,3 +70,13 @@ services:
|
|||||||
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
||||||
|
|
||||||
|
wallabag_import.consumer.amqp.shaarli:
|
||||||
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
|
arguments:
|
||||||
|
$import: '@Wallabag\ImportBundle\Import\ShaarliImport'
|
||||||
|
|
||||||
|
wallabag_import.consumer.amqp.pocket_html:
|
||||||
|
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
|
||||||
|
arguments:
|
||||||
|
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'
|
||||||
|
|||||||
@ -164,3 +164,35 @@ services:
|
|||||||
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
||||||
arguments:
|
arguments:
|
||||||
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
|
||||||
|
|
||||||
|
# shaarli
|
||||||
|
wallabag_import.queue.redis.shaarli:
|
||||||
|
class: Simpleue\Queue\RedisQueue
|
||||||
|
arguments:
|
||||||
|
$queueName: "wallabag.import.shaarli"
|
||||||
|
|
||||||
|
wallabag_import.producer.redis.shaarli:
|
||||||
|
class: Wallabag\ImportBundle\Redis\Producer
|
||||||
|
arguments:
|
||||||
|
- "@wallabag_import.queue.redis.shaarli"
|
||||||
|
|
||||||
|
wallabag_import.consumer.redis.shaarli:
|
||||||
|
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
||||||
|
arguments:
|
||||||
|
$import: '@Wallabag\ImportBundle\Import\ShaarliImport'
|
||||||
|
|
||||||
|
# pocket html
|
||||||
|
wallabag_import.queue.redis.pocket_html:
|
||||||
|
class: Simpleue\Queue\RedisQueue
|
||||||
|
arguments:
|
||||||
|
$queueName: "wallabag.import.pocket_html"
|
||||||
|
|
||||||
|
wallabag_import.producer.redis.pocket_html:
|
||||||
|
class: Wallabag\ImportBundle\Redis\Producer
|
||||||
|
arguments:
|
||||||
|
- "@wallabag_import.queue.redis.pocket_html"
|
||||||
|
|
||||||
|
wallabag_import.consumer.redis.pocket_html:
|
||||||
|
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
|
||||||
|
arguments:
|
||||||
|
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'
|
||||||
|
|||||||
@ -8,3 +8,4 @@ parameters:
|
|||||||
test_database_path: ~
|
test_database_path: ~
|
||||||
env(TEST_DATABASE_PATH): ~
|
env(TEST_DATABASE_PATH): ~
|
||||||
test_database_charset: utf8mb4
|
test_database_charset: utf8mb4
|
||||||
|
fosuser_registration: true
|
||||||
|
|||||||
@ -8,3 +8,4 @@ parameters:
|
|||||||
test_database_path: ~
|
test_database_path: ~
|
||||||
env(TEST_DATABASE_PATH): ~
|
env(TEST_DATABASE_PATH): ~
|
||||||
test_database_charset: utf8
|
test_database_charset: utf8
|
||||||
|
fosuser_registration: true
|
||||||
|
|||||||
@ -5,8 +5,9 @@ parameters:
|
|||||||
test_database_name: ~
|
test_database_name: ~
|
||||||
test_database_user: ~
|
test_database_user: ~
|
||||||
test_database_password: ~
|
test_database_password: ~
|
||||||
# Using an environnement variable in order to avoid the error "attempt to write a readonly database"
|
# Using an environment variable in order to avoid the error "attempt to write a readonly database"
|
||||||
# when the schema is dropped then recreate
|
# when the schema is dropped then recreate
|
||||||
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
test_database_path: "%env(TEST_DATABASE_PATH)%"
|
||||||
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
|
||||||
test_database_charset: utf8
|
test_database_charset: utf8
|
||||||
|
fosuser_registration: true
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
wallabag_core:
|
wallabag_core:
|
||||||
version: 2.6.1
|
version: 2.6.7
|
||||||
paypal_url: "https://liberapay.com/wallabag/donate"
|
paypal_url: "https://liberapay.com/wallabag/donate"
|
||||||
languages:
|
languages:
|
||||||
en: 'English'
|
en: 'English'
|
||||||
@ -85,10 +85,6 @@ wallabag_core:
|
|||||||
name: export_epub
|
name: export_epub
|
||||||
value: 1
|
value: 1
|
||||||
section: export
|
section: export
|
||||||
-
|
|
||||||
name: export_mobi
|
|
||||||
value: 0
|
|
||||||
section: export
|
|
||||||
-
|
-
|
||||||
name: export_pdf
|
name: export_pdf
|
||||||
value: 1
|
value: 1
|
||||||
@ -129,14 +125,6 @@ wallabag_core:
|
|||||||
name: matomo_site_id
|
name: matomo_site_id
|
||||||
value: 1
|
value: 1
|
||||||
section: analytics
|
section: analytics
|
||||||
-
|
|
||||||
name: demo_mode_enabled
|
|
||||||
value: 0
|
|
||||||
section: misc
|
|
||||||
-
|
|
||||||
name: demo_mode_username
|
|
||||||
value: wallabag
|
|
||||||
section: misc
|
|
||||||
-
|
-
|
||||||
name: download_images_enabled
|
name: download_images_enabled
|
||||||
value: 0
|
value: 0
|
||||||
@ -165,7 +153,16 @@ wallabag_core:
|
|||||||
rule: host = "feeds.reuters.com"
|
rule: host = "feeds.reuters.com"
|
||||||
-
|
-
|
||||||
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
|
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
|
||||||
|
fonts:
|
||||||
|
- 'Sans-serif'
|
||||||
|
- 'Serif'
|
||||||
|
- 'Atkinson Hyperlegible'
|
||||||
|
- 'EB Garamond'
|
||||||
|
- 'Lato'
|
||||||
|
- 'Montserrat'
|
||||||
|
- 'OpenDyslexicRegular'
|
||||||
|
- 'Oswald'
|
||||||
|
|
||||||
wallabag_import:
|
wallabag_import:
|
||||||
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
|
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv', 'text/html']
|
||||||
resource_dir: "%kernel.project_dir%/web/uploads/import"
|
resource_dir: "%kernel.project_dir%/web/uploads/import"
|
||||||
|
|||||||
@ -2,16 +2,16 @@ const path = require('path');
|
|||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
||||||
|
|
||||||
const rootDir = path.resolve(__dirname, '../../../');
|
const projectDir = path.resolve(__dirname, '../../../');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
material: path.join(rootDir, './app/Resources/static/themes/material/index.js'),
|
material: path.join(projectDir, './app/Resources/static/themes/material/index.js'),
|
||||||
public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'),
|
public: path.join(projectDir, './app/Resources/static/themes/_global/share.js'),
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
path: path.resolve(rootDir, 'web/wallassets'),
|
path: path.resolve(projectDir, 'web/wallassets'),
|
||||||
publicPath: '',
|
publicPath: '',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
@ -31,7 +31,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'),
|
jquery: path.join(projectDir, 'node_modules/jquery/dist/jquery.js'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
use Symfony\Component\Debug\Debug;
|
use Symfony\Component\ErrorHandler\Debug;
|
||||||
|
|
||||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
||||||
|
|||||||
117
composer.json
117
composer.json
@ -1,33 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "wallabag/wallabag",
|
"name": "wallabag/wallabag",
|
||||||
"type": "project",
|
|
||||||
"description": "open source self hostable read-it-later web application",
|
"description": "open source self hostable read-it-later web application",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "project",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"poche",
|
"poche",
|
||||||
"wallabag",
|
"wallabag",
|
||||||
"read-it-later",
|
"read-it-later",
|
||||||
"read it later"
|
"read it later"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/wallabag/wallabag",
|
|
||||||
"license": "MIT",
|
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Nicolas Lœuillet",
|
"name": "Nicolas Lœuillet",
|
||||||
"email": "nicolas@loeuillet.org",
|
"email": "nicolas@loeuillet.org",
|
||||||
"homepage": "http://www.cdetc.fr",
|
"homepage": "https://nicolas.loeuillet.org",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Thomas Citharel",
|
"name": "Thomas Citharel",
|
||||||
"homepage": "http://tcit.fr",
|
"homepage": "https://tcit.fr",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Jérémy Benoist",
|
"name": "Jérémy Benoist",
|
||||||
"homepage": "https://www.j0k3r.net",
|
"homepage": "https://www.j0k3r.net",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Kevin Decherf",
|
||||||
|
"homepage": "https://kdecherf.com/",
|
||||||
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"homepage": "https://github.com/wallabag/wallabag",
|
||||||
"support": {
|
"support": {
|
||||||
"email": "hello@wallabag.org",
|
"email": "hello@wallabag.org",
|
||||||
"issues": "https://github.com/wallabag/wallabag/issues"
|
"issues": "https://github.com/wallabag/wallabag/issues"
|
||||||
@ -81,7 +86,6 @@
|
|||||||
"kphoen/rulerz": "^0.21",
|
"kphoen/rulerz": "^0.21",
|
||||||
"kphoen/rulerz-bundle": "~0.13",
|
"kphoen/rulerz-bundle": "~0.13",
|
||||||
"laminas/laminas-code": "^4.7",
|
"laminas/laminas-code": "^4.7",
|
||||||
"laminas/laminas-diactoros": "^2.3",
|
|
||||||
"lcobucci/jwt": "~4.1.5",
|
"lcobucci/jwt": "~4.1.5",
|
||||||
"lexik/form-filter-bundle": "^7.0",
|
"lexik/form-filter-bundle": "^7.0",
|
||||||
"mgargano/simplehtmldom": "~1.5",
|
"mgargano/simplehtmldom": "~1.5",
|
||||||
@ -110,19 +114,41 @@
|
|||||||
"scheb/2fa-google-authenticator": "^5.13",
|
"scheb/2fa-google-authenticator": "^5.13",
|
||||||
"scheb/2fa-qr-code": "^5.13",
|
"scheb/2fa-qr-code": "^5.13",
|
||||||
"scheb/2fa-trusted-device": "^5.13",
|
"scheb/2fa-trusted-device": "^5.13",
|
||||||
|
"scssphp/scssphp": "^1.11",
|
||||||
"sensio/framework-extra-bundle": "^6.2",
|
"sensio/framework-extra-bundle": "^6.2",
|
||||||
"sentry/sentry-symfony": "4.9.2",
|
"sentry/sentry-symfony": "4.12.0",
|
||||||
"stof/doctrine-extensions-bundle": "^1.2",
|
"stof/doctrine-extensions-bundle": "^1.2",
|
||||||
"symfony/dom-crawler": "^4.0",
|
"symfony/asset": "^4.4",
|
||||||
"symfony/mailer": "^4.0",
|
"symfony/config": "^4.4",
|
||||||
|
"symfony/console": "^4.4",
|
||||||
|
"symfony/debug": "^4.4",
|
||||||
|
"symfony/dependency-injection": "^4.4",
|
||||||
|
"symfony/doctrine-bridge": "^4.4",
|
||||||
|
"symfony/dom-crawler": "^4.4",
|
||||||
|
"symfony/error-handler": "^4.4",
|
||||||
|
"symfony/event-dispatcher": "^4.4",
|
||||||
|
"symfony/finder": "^4.4",
|
||||||
|
"symfony/form": "^4.4",
|
||||||
|
"symfony/framework-bundle": "^4.4",
|
||||||
|
"symfony/google-mailer": "^4.4",
|
||||||
|
"symfony/http-foundation": "^4.4",
|
||||||
|
"symfony/http-kernel": "^4.4",
|
||||||
|
"symfony/mailer": "^4.4",
|
||||||
|
"symfony/mime": "^4.4",
|
||||||
"symfony/monolog-bundle": "^3.1",
|
"symfony/monolog-bundle": "^3.1",
|
||||||
|
"symfony/options-resolver": "^4.4",
|
||||||
"symfony/proxy-manager-bridge": "^4.4",
|
"symfony/proxy-manager-bridge": "^4.4",
|
||||||
"symfony/symfony": "^4.0",
|
"symfony/routing": "^4.4",
|
||||||
|
"symfony/security-bundle": "^4.4",
|
||||||
|
"symfony/security-core": "^4.4",
|
||||||
|
"symfony/security-http": "^4.4",
|
||||||
|
"symfony/templating": "^4.4",
|
||||||
|
"symfony/twig-bundle": "^4.4",
|
||||||
|
"symfony/validator": "^4.4",
|
||||||
"tecnickcom/tcpdf": "^6.3.0",
|
"tecnickcom/tcpdf": "^6.3.0",
|
||||||
"twig/extra-bundle": "^3.4",
|
"twig/extra-bundle": "^3.4",
|
||||||
"twig/string-extra": "^3.4",
|
"twig/string-extra": "^3.4",
|
||||||
"twig/twig": "^3.4.3",
|
"twig/twig": "^3.4.3",
|
||||||
"wallabag/php-mobi": "~1.0",
|
|
||||||
"wallabag/phpepub": "^4.0.10",
|
"wallabag/phpepub": "^4.0.10",
|
||||||
"willdurand/hateoas": "^3.8",
|
"willdurand/hateoas": "^3.8",
|
||||||
"willdurand/hateoas-bundle": "~2.1"
|
"willdurand/hateoas-bundle": "~2.1"
|
||||||
@ -130,6 +156,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"dama/doctrine-test-bundle": "^7.1",
|
"dama/doctrine-test-bundle": "^7.1",
|
||||||
"doctrine/doctrine-fixtures-bundle": "~3.0",
|
"doctrine/doctrine-fixtures-bundle": "~3.0",
|
||||||
|
"ergebnis/composer-normalize": "^2.28",
|
||||||
"friendsofphp/php-cs-fixer": "~3.4",
|
"friendsofphp/php-cs-fixer": "~3.4",
|
||||||
"friendsoftwig/twigcs": "^6.0",
|
"friendsoftwig/twigcs": "^6.0",
|
||||||
"m6web/redis-mock": "^5.0",
|
"m6web/redis-mock": "^5.0",
|
||||||
@ -139,31 +166,20 @@
|
|||||||
"phpstan/phpstan-doctrine": "^1.3",
|
"phpstan/phpstan-doctrine": "^1.3",
|
||||||
"phpstan/phpstan-phpunit": "^1.1",
|
"phpstan/phpstan-phpunit": "^1.1",
|
||||||
"phpstan/phpstan-symfony": "^1.2",
|
"phpstan/phpstan-symfony": "^1.2",
|
||||||
|
"symfony/browser-kit": "^4.4",
|
||||||
|
"symfony/css-selector": "^4.4",
|
||||||
|
"symfony/debug-bundle": "^4.4",
|
||||||
"symfony/maker-bundle": "^1.18",
|
"symfony/maker-bundle": "^1.18",
|
||||||
"symfony/phpunit-bridge": "~6.0"
|
"symfony/phpunit-bridge": "~6.0",
|
||||||
|
"symfony/var-dumper": "^4.4",
|
||||||
|
"symfony/web-profiler-bundle": "^4.4",
|
||||||
|
"symfony/web-server-bundle": "^4.4"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"minimum-stability": "dev",
|
||||||
"post-cmd": [
|
"prefer-stable": true,
|
||||||
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
|
|
||||||
"bin/console cache:clear --no-warmup",
|
|
||||||
"bin/console assets:install web --symlink --relative"
|
|
||||||
],
|
|
||||||
"post-install-cmd": [
|
|
||||||
"@post-cmd"
|
|
||||||
],
|
|
||||||
"post-update-cmd": [
|
|
||||||
"@post-cmd"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"extra": {
|
|
||||||
"incenteev-parameters": {
|
|
||||||
"file": "app/config/parameters.yml"
|
|
||||||
},
|
|
||||||
"public-dir": "web"
|
|
||||||
},
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Wallabag\\": "src/Wallabag/"
|
"Wallabag\\": "src/Wallabag/"
|
||||||
@ -176,22 +192,41 @@
|
|||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tests\\": "tests/"
|
"Tests\\": "tests/"
|
||||||
},
|
}
|
||||||
"files": [
|
|
||||||
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"phpstan/extension-installer": true,
|
||||||
|
"php-http/discovery": true,
|
||||||
|
"ergebnis/composer-normalize": true
|
||||||
|
},
|
||||||
"bin-dir": "bin",
|
"bin-dir": "bin",
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "7.4.29"
|
"php": "7.4.29"
|
||||||
},
|
},
|
||||||
"sort-packages": true,
|
"sort-packages": true
|
||||||
"allow-plugins": {
|
},
|
||||||
"phpstan/extension-installer": true,
|
"extra": {
|
||||||
"php-http/discovery": true
|
"incenteev-parameters": {
|
||||||
|
"file": "app/config/parameters.yml"
|
||||||
|
},
|
||||||
|
"public-dir": "web",
|
||||||
|
"symfony": {
|
||||||
|
"allow-contrib": true,
|
||||||
|
"require": "4.4.*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"scripts": {
|
||||||
"prefer-stable": true
|
"post-install-cmd": [
|
||||||
|
"@post-cmd"
|
||||||
|
],
|
||||||
|
"post-update-cmd": [
|
||||||
|
"@post-cmd"
|
||||||
|
],
|
||||||
|
"post-cmd": [
|
||||||
|
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
|
||||||
|
"bin/console cache:clear --no-warmup",
|
||||||
|
"bin/console assets:install web --symlink --relative"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6148
composer.lock
generated
6148
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
FROM php:7.4-fpm AS rootless
|
FROM php:8.1-fpm AS rootless
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ARG NODE_VERSION=16
|
ARG NODE_VERSION=16
|
||||||
@ -33,7 +33,8 @@ RUN apt-get update && apt-get install -y \
|
|||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
git \
|
git \
|
||||||
build-essential \
|
build-essential \
|
||||||
nodejs
|
nodejs \
|
||||||
|
npm
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
||||||
RUN docker-php-ext-install -j "$(nproc)" \
|
RUN docker-php-ext-install -j "$(nproc)" \
|
||||||
bcmath \
|
bcmath \
|
||||||
|
|||||||
@ -6,7 +6,7 @@ parameters:
|
|||||||
database_name: ${DATABASE_NAME:-symfony}
|
database_name: ${DATABASE_NAME:-symfony}
|
||||||
database_user: ${DATABASE_USER:-root}
|
database_user: ${DATABASE_USER:-root}
|
||||||
database_password: ${DATABASE_PASSWORD:-~}
|
database_password: ${DATABASE_PASSWORD:-~}
|
||||||
database_path: '${DATABASE_PATH:-"%kernel.root_dir%/data/db/wallabag.sqlite"}'
|
database_path: '${DATABASE_PATH:-"%kernel.project_dir%/data/db/wallabag.sqlite"}'
|
||||||
database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_}
|
database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_}
|
||||||
database_socket: null
|
database_socket: null
|
||||||
database_charset: ${DATABASE_CHARSET:-utf8}
|
database_charset: ${DATABASE_CHARSET:-utf8}
|
||||||
@ -22,11 +22,10 @@ parameters:
|
|||||||
secret: ${SECRET:-~}
|
secret: ${SECRET:-~}
|
||||||
|
|
||||||
# two factor stuff
|
# two factor stuff
|
||||||
twofactor_auth: ${TWOFACTOR_AUTH:-true}
|
|
||||||
twofactor_sender: ${TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
twofactor_sender: ${TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
||||||
|
|
||||||
# fosuser stuff
|
# fosuser stuff
|
||||||
fosuser_registration: ${FOSUSER_REGISTRATION:-true}
|
fosuser_registration: ${FOSUSER_REGISTRATION:-false}
|
||||||
fosuser_confirmation: ${FOSUSER_CONFIRMATION:-true}
|
fosuser_confirmation: ${FOSUSER_CONFIRMATION:-true}
|
||||||
|
|
||||||
fos_oauth_server_access_token_lifetime: 3600
|
fos_oauth_server_access_token_lifetime: 3600
|
||||||
|
|||||||
60
package.json
60
package.json
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "wallabag",
|
"name": "wallabag",
|
||||||
"version": "2.5.0",
|
"version": "2.6.0",
|
||||||
"description": "wallabag is a self hostable application for saving web pages",
|
"description": "wallabag is a self hostable application for saving web pages",
|
||||||
"private": true,
|
"private": true,
|
||||||
"directories": {
|
"directories": {
|
||||||
"doc": "docs"
|
"doc": "docs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -17,17 +17,22 @@
|
|||||||
{
|
{
|
||||||
"name": "Nicolas Lœuillet",
|
"name": "Nicolas Lœuillet",
|
||||||
"email": "nicolas@loeuillet.org",
|
"email": "nicolas@loeuillet.org",
|
||||||
"homepage": "http://www.cdetc.fr",
|
"homepage": "https://nicolas.loeuillet.org",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Thomas Citharel",
|
"name": "Thomas Citharel",
|
||||||
"homepage": "http://tcit.fr",
|
"homepage": "https://tcit.fr",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Jérémy Benoist",
|
"name": "Jérémy Benoist",
|
||||||
"homepage": "http://www.j0k3r.net",
|
"homepage": "https://www.j0k3r.net",
|
||||||
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Kevin Decherf",
|
||||||
|
"homepage": "https://kdecherf.com/",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -36,53 +41,56 @@
|
|||||||
"url": "https://github.com/wallabag/wallabag/issues"
|
"url": "https://github.com/wallabag/wallabag/issues"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.22.5",
|
"@babel/core": "^7.23.3",
|
||||||
"@babel/eslint-parser": "^7.22.5",
|
"@babel/eslint-parser": "^7.23.3",
|
||||||
"@babel/preset-env": "^7.22.5",
|
"@babel/preset-env": "^7.23.3",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.16",
|
||||||
"babel-loader": "^9.1.2",
|
"babel-loader": "^9.1.3",
|
||||||
"css-loader": "^6.8.1",
|
"css-loader": "^6.8.1",
|
||||||
"eslint": "^8.43.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint-plugin-import": "^2.29.0",
|
||||||
"eslint-webpack-plugin": "^4.0.1",
|
"eslint-webpack-plugin": "^4.0.1",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"lato-font": "^3.0.0",
|
"lato-font": "^3.0.0",
|
||||||
"mini-css-extract-plugin": "^2.7.6",
|
"mini-css-extract-plugin": "^2.7.6",
|
||||||
"node-sass": "^9.0.0",
|
"postcss": "^8.4.31",
|
||||||
"postcss": "^8.4.24",
|
|
||||||
"postcss-loader": "^7.3.3",
|
"postcss-loader": "^7.3.3",
|
||||||
"postcss-scss": "^4.0.6",
|
"postcss-scss": "^4.0.9",
|
||||||
"sass": "^1.63.4",
|
"sass": "^1.69.5",
|
||||||
"sass-loader": "^13.3.2",
|
"sass-loader": "^13.3.2",
|
||||||
"style-loader": "^3.3.3",
|
"style-loader": "^3.3.3",
|
||||||
"stylelint": "^15.8.0",
|
"stylelint": "^15.11.0",
|
||||||
"stylelint-config-standard": "^33.0.0",
|
"stylelint-config-standard": "^34.0.0",
|
||||||
"stylelint-config-standard-scss": "^9.0.0",
|
"stylelint-config-standard-scss": "^11.1.0",
|
||||||
"stylelint-scss": "^5.0.1",
|
"stylelint-scss": "^5.3.1",
|
||||||
"stylelint-webpack-plugin": "^4.1.1",
|
"stylelint-webpack-plugin": "^4.1.1",
|
||||||
"terser-webpack-plugin": "^5.3.9",
|
"terser-webpack-plugin": "^5.3.9",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"webpack": "^5.87.0",
|
"webpack": "^5.89.0",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-dev-server": "^4.15.1",
|
"webpack-dev-server": "^4.15.1",
|
||||||
"webpack-manifest-plugin": "^5.0.0",
|
"webpack-manifest-plugin": "^5.0.0",
|
||||||
"webpack-merge": "^5.9.0"
|
"webpack-merge": "^5.10.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fontsource/atkinson-hyperlegible": "^5.0.17",
|
||||||
|
"@fontsource/eb-garamond": "^5.0.15",
|
||||||
|
"@fontsource/montserrat": "^5.0.15",
|
||||||
|
"@fontsource/oswald": "^5.0.17",
|
||||||
"annotator": "wallabag/annotator#master",
|
"annotator": "wallabag/annotator#master",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"highlight.js": "^11.8.0",
|
"highlight.js": "^11.9.0",
|
||||||
"icomoon-free-npm": "^0.0.0",
|
"icomoon-free-npm": "^0.0.0",
|
||||||
"jquery": "^3.7.0",
|
"jquery": "^3.7.1",
|
||||||
"jquery.cookie": "^1.4.1",
|
"jquery.cookie": "^1.4.1",
|
||||||
"jr-qrcode": "^1.0.7",
|
"jr-qrcode": "^1.0.7",
|
||||||
"material-design-icons-iconfont": "^6.7.0",
|
"material-design-icons-iconfont": "^6.7.0",
|
||||||
"materialize-css": "^0.98.1",
|
"materialize-css": "^0.100.2",
|
||||||
"mathjax": "^3.2.2",
|
"mathjax": "^3.2.2",
|
||||||
"mousetrap": "^1.6.0",
|
"mousetrap": "^1.6.0",
|
||||||
"ptsans-npm-webfont": "^0.0.4",
|
"open-dyslexic": "^1.0.3",
|
||||||
"roboto-fontface": "^0.10.0",
|
"roboto-fontface": "^0.10.0",
|
||||||
"waypoints": "^4.0.1"
|
"waypoints": "^4.0.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,10 +1,25 @@
|
|||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
|
-
|
||||||
|
message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:postAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<mixed\\>\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:putAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<null\\>\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#"
|
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser\\(\\) invoked with 2 parameters, 1 required\\.$#"
|
||||||
|
count: 6
|
||||||
|
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -40,27 +55,27 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
|
path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\UserBundle\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Wallabag/UserBundle/Mailer/UserMailer.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
|
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
|
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to method generate\\(\\) on an unknown class PHPUnit_Framework_MockObject_MockObject\\.$#"
|
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
|
||||||
count: 2
|
count: 1
|
||||||
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
|
||||||
count: 15
|
count: 16
|
||||||
path: src/*
|
path: src/*
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser()#"
|
|
||||||
count: 7
|
|
||||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ includes:
|
|||||||
- phpstan-baseline.neon
|
- phpstan-baseline.neon
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
level: 2
|
level: 3
|
||||||
paths:
|
paths:
|
||||||
- src
|
- src
|
||||||
- tests
|
- tests
|
||||||
|
|||||||
@ -10,6 +10,8 @@ ENV=$4
|
|||||||
rm -rf "${TMP_FOLDER:?}"/"$RELEASE_FOLDER"
|
rm -rf "${TMP_FOLDER:?}"/"$RELEASE_FOLDER"
|
||||||
mkdir "$TMP_FOLDER"/"$RELEASE_FOLDER"
|
mkdir "$TMP_FOLDER"/"$RELEASE_FOLDER"
|
||||||
git clone https://github.com/wallabag/wallabag.git --single-branch --depth 1 --branch $1 "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION"
|
git clone https://github.com/wallabag/wallabag.git --single-branch --depth 1 --branch $1 "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION"
|
||||||
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && yarn install --non-interactive
|
||||||
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && yarn run --non-interactive build:prod
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && SYMFONY_ENV="$ENV" COMPOSER_MEMORY_LIMIT=-1 composer install -n --no-dev
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && SYMFONY_ENV="$ENV" COMPOSER_MEMORY_LIMIT=-1 composer install -n --no-dev
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console wallabag:install --env="$ENV" -n
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console wallabag:install --env="$ENV" -n
|
||||||
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console assets:install --env="$ENV" --symlink --relative
|
cd "$TMP_FOLDER"/"$RELEASE_FOLDER"/"$VERSION" && php bin/console assets:install --env="$ENV" --symlink --relative
|
||||||
|
|||||||
@ -7,3 +7,9 @@ if [ ! -f composer.phar ]; then
|
|||||||
else
|
else
|
||||||
COMPOSER_COMMAND='./composer.phar'
|
COMPOSER_COMMAND='./composer.phar'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for git
|
||||||
|
command -v git >/dev/null 2>&1 ||
|
||||||
|
{ echo >&2 "git is not installed. We can't install wallabag";
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|||||||
@ -7,7 +7,9 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
|
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -16,8 +18,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$annotation1 = new Annotation($this->getReference('admin-user'));
|
$annotation1 = new Annotation($this->getReference('admin-user', User::class));
|
||||||
$annotation1->setEntry($this->getReference('entry1'));
|
$annotation1->setEntry($this->getReference('entry1', Entry::class));
|
||||||
$annotation1->setText('This is my annotation /o/');
|
$annotation1->setText('This is my annotation /o/');
|
||||||
$annotation1->setQuote('content');
|
$annotation1->setQuote('content');
|
||||||
|
|
||||||
@ -25,8 +27,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('annotation1', $annotation1);
|
$this->addReference('annotation1', $annotation1);
|
||||||
|
|
||||||
$annotation2 = new Annotation($this->getReference('admin-user'));
|
$annotation2 = new Annotation($this->getReference('admin-user', User::class));
|
||||||
$annotation2->setEntry($this->getReference('entry2'));
|
$annotation2->setEntry($this->getReference('entry2', Entry::class));
|
||||||
$annotation2->setText('This is my 2nd annotation /o/');
|
$annotation2->setText('This is my 2nd annotation /o/');
|
||||||
$annotation2->setQuote('content');
|
$annotation2->setQuote('content');
|
||||||
|
|
||||||
@ -34,8 +36,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('annotation2', $annotation2);
|
$this->addReference('annotation2', $annotation2);
|
||||||
|
|
||||||
$annotation3 = new Annotation($this->getReference('bob-user'));
|
$annotation3 = new Annotation($this->getReference('bob-user', User::class));
|
||||||
$annotation3->setEntry($this->getReference('entry3'));
|
$annotation3->setEntry($this->getReference('entry3', Entry::class));
|
||||||
$annotation3->setText('This is my first annotation !');
|
$annotation3->setText('This is my first annotation !');
|
||||||
$annotation3->setQuote('content');
|
$annotation3->setQuote('content');
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ class AnnotationRepository extends ServiceEntityRepository
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all annotations for a user id.
|
* Remove all annotations for a user id.
|
||||||
* Used when a user want to reset all informations.
|
* Used when a user wants to reset all information.
|
||||||
*
|
*
|
||||||
* @param int $userId
|
* @param int $userId
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,8 +4,8 @@ namespace Wallabag\ApiBundle\Controller;
|
|||||||
|
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
@ -36,7 +36,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{entry}.{_format}", methods={"GET"}, name="api_get_annotations", defaults={"_format": "json"})
|
* @Route("/api/annotations/{entry}.{_format}", methods={"GET"}, name="api_get_annotations", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function getAnnotationsAction(Entry $entry)
|
public function getAnnotationsAction(Entry $entry)
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{entry}.{_format}", methods={"POST"}, name="api_post_annotation", defaults={"_format": "json"})
|
* @Route("/api/annotations/{entry}.{_format}", methods={"POST"}, name="api_post_annotation", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function postAnnotationAction(Request $request, Entry $entry)
|
public function postAnnotationAction(Request $request, Entry $entry)
|
||||||
{
|
{
|
||||||
@ -138,7 +138,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{annotation}.{_format}", methods={"PUT"}, name="api_put_annotation", defaults={"_format": "json"})
|
* @Route("/api/annotations/{annotation}.{_format}", methods={"PUT"}, name="api_put_annotation", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function putAnnotationAction(int $annotation, Request $request)
|
public function putAnnotationAction(int $annotation, Request $request)
|
||||||
{
|
{
|
||||||
@ -174,7 +174,7 @@ class AnnotationRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @Route("/api/annotations/{annotation}.{_format}", methods={"DELETE"}, name="api_delete_annotation", defaults={"_format": "json"})
|
* @Route("/api/annotations/{annotation}.{_format}", methods={"DELETE"}, name="api_delete_annotation", defaults={"_format": "json"})
|
||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function deleteAnnotationAction(int $annotation)
|
public function deleteAnnotationAction(int $annotation)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,12 +69,16 @@ class DeveloperController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Remove a client.
|
* Remove a client.
|
||||||
*
|
*
|
||||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client", methods={"POST"})
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function deleteClientAction(Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
|
public function deleteClientAction(Request $request, Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
|
if (!$this->isCsrfTokenValid('delete-client', $request->request->get('token'))) {
|
||||||
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
|
}
|
||||||
|
|
||||||
if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) {
|
if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) {
|
||||||
throw $this->createAccessDeniedException('You can not access this client.');
|
throw $this->createAccessDeniedException('You can not access this client.');
|
||||||
}
|
}
|
||||||
@ -99,6 +103,9 @@ class DeveloperController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function howtoFirstAppAction()
|
public function howtoFirstAppAction()
|
||||||
{
|
{
|
||||||
return $this->render('@WallabagCore/Developer/howto_app.html.twig');
|
return $this->render('@WallabagCore/Developer/howto_app.html.twig',
|
||||||
|
[
|
||||||
|
'wallabag_url' => $this->getParameter('domain_name'),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,6 +176,17 @@ class EntryRestController extends WallabagRestController
|
|||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
* @OA\Parameter(
|
* @OA\Parameter(
|
||||||
|
* name="notParsed",
|
||||||
|
* in="query",
|
||||||
|
* description="filter by notParsed status. all entries by default",
|
||||||
|
* required=false,
|
||||||
|
* @OA\Schema(
|
||||||
|
* type="integer",
|
||||||
|
* enum={"1", "0"},
|
||||||
|
* default="0"
|
||||||
|
* )
|
||||||
|
* ),
|
||||||
|
* @OA\Parameter(
|
||||||
* name="sort",
|
* name="sort",
|
||||||
* in="query",
|
* in="query",
|
||||||
* description="sort entries by date.",
|
* description="sort entries by date.",
|
||||||
@ -286,6 +297,7 @@ class EntryRestController extends WallabagRestController
|
|||||||
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
||||||
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
|
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
|
||||||
$isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public');
|
$isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public');
|
||||||
|
$isNotParsed = (null === $request->query->get('notParsed')) ? null : (bool) $request->query->get('notParsed');
|
||||||
$sort = strtolower($request->query->get('sort', 'created'));
|
$sort = strtolower($request->query->get('sort', 'created'));
|
||||||
$order = strtolower($request->query->get('order', 'desc'));
|
$order = strtolower($request->query->get('order', 'desc'));
|
||||||
$page = (int) $request->query->get('page', 1);
|
$page = (int) $request->query->get('page', 1);
|
||||||
@ -307,7 +319,8 @@ class EntryRestController extends WallabagRestController
|
|||||||
$since,
|
$since,
|
||||||
$tags,
|
$tags,
|
||||||
$detail,
|
$detail,
|
||||||
$domainName
|
$domainName,
|
||||||
|
$isNotParsed
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new BadRequestHttpException($e->getMessage());
|
throw new BadRequestHttpException($e->getMessage());
|
||||||
@ -325,6 +338,7 @@ class EntryRestController extends WallabagRestController
|
|||||||
'archive' => $isArchived,
|
'archive' => $isArchived,
|
||||||
'starred' => $isStarred,
|
'starred' => $isStarred,
|
||||||
'public' => $isPublic,
|
'public' => $isPublic,
|
||||||
|
'notParsed' => $isNotParsed,
|
||||||
'sort' => $sort,
|
'sort' => $sort,
|
||||||
'order' => $order,
|
'order' => $order,
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
@ -397,7 +411,7 @@ class EntryRestController extends WallabagRestController
|
|||||||
* required=true,
|
* required=true,
|
||||||
* @OA\Schema(
|
* @OA\Schema(
|
||||||
* type="string",
|
* type="string",
|
||||||
* enum={"xml", "json", "txt", "csv", "pdf", "epub", "mobi"},
|
* enum={"xml", "json", "txt", "csv", "pdf", "epub"},
|
||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
|
|||||||
@ -8,6 +8,7 @@ use FOS\UserBundle\Event\UserEvent;
|
|||||||
use FOS\UserBundle\FOSUserEvents;
|
use FOS\UserBundle\FOSUserEvents;
|
||||||
use FOS\UserBundle\Model\UserManagerInterface;
|
use FOS\UserBundle\Model\UserManagerInterface;
|
||||||
use JMS\Serializer\SerializationContext;
|
use JMS\Serializer\SerializationContext;
|
||||||
|
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
@ -21,14 +22,15 @@ use Wallabag\UserBundle\Form\NewUserType;
|
|||||||
class UserRestController extends WallabagRestController
|
class UserRestController extends WallabagRestController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Retrieve current logged in user informations.
|
* Retrieve current logged in user information.
|
||||||
*
|
*
|
||||||
* @Operation(
|
* @Operation(
|
||||||
* tags={"User"},
|
* tags={"User"},
|
||||||
* summary="Retrieve current logged in user informations.",
|
* summary="Retrieve current logged in user information.",
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
* response="200",
|
* response="200",
|
||||||
* description="Returned when successful"
|
* description="Returned when successful",
|
||||||
|
* @Model(type=User::class, groups={"user_api"}))
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
@ -52,32 +54,45 @@ class UserRestController extends WallabagRestController
|
|||||||
* @OA\RequestBody(
|
* @OA\RequestBody(
|
||||||
* @OA\JsonContent(
|
* @OA\JsonContent(
|
||||||
* type="object",
|
* type="object",
|
||||||
* required={"username", "password", "email", "client_name"},
|
* required={"username", "password", "email"},
|
||||||
* @OA\Property(
|
* @OA\Property(
|
||||||
* property="username",
|
* property="username",
|
||||||
* description="The user's username",
|
* description="The user's username",
|
||||||
* @OA\Schema(type="string")
|
* type="string",
|
||||||
|
* example="wallabag",
|
||||||
* ),
|
* ),
|
||||||
* @OA\Property(
|
* @OA\Property(
|
||||||
* property="password",
|
* property="password",
|
||||||
* description="The user's password",
|
* description="The user's password",
|
||||||
* @OA\Schema(type="string")
|
* type="string",
|
||||||
|
* example="hidden_value",
|
||||||
* ),
|
* ),
|
||||||
* @OA\Property(
|
* @OA\Property(
|
||||||
* property="email",
|
* property="email",
|
||||||
* description="The user's email",
|
* description="The user's email",
|
||||||
* @OA\Schema(type="string")
|
* type="string",
|
||||||
|
* example="wallabag@wallabag.io",
|
||||||
* ),
|
* ),
|
||||||
* @OA\Property(
|
* @OA\Property(
|
||||||
* property="client_name",
|
* property="client_name",
|
||||||
* description="The client name (to be used by your app)",
|
* description="The client name (to be used by your app)",
|
||||||
* @OA\Schema(type="string")
|
* type="string",
|
||||||
|
* example="Fancy App",
|
||||||
* ),
|
* ),
|
||||||
* )
|
* )
|
||||||
* ),
|
* ),
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
* response="200",
|
* response="201",
|
||||||
* description="Returned when successful"
|
* description="Returned when successful",
|
||||||
|
* @Model(type=User::class, groups={"user_api_with_client"})),
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response="403",
|
||||||
|
* description="Server doesn't allow registrations"
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response="400",
|
||||||
|
* description="Request is incorrectly formatted"
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use FOS\RestBundle\Controller\AbstractFOSRestController;
|
use FOS\RestBundle\Controller\AbstractFOSRestController;
|
||||||
use JMS\Serializer\SerializationContext;
|
use JMS\Serializer\SerializationContext;
|
||||||
use JMS\Serializer\SerializerInterface;
|
use JMS\Serializer\SerializerInterface;
|
||||||
|
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||||
use OpenApi\Annotations as OA;
|
use OpenApi\Annotations as OA;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
@ -15,6 +16,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
|||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
use Wallabag\ApiBundle\Entity\ApplicationInfo;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class WallabagRestController extends AbstractFOSRestController
|
class WallabagRestController extends AbstractFOSRestController
|
||||||
@ -38,11 +40,16 @@ class WallabagRestController extends AbstractFOSRestController
|
|||||||
* Retrieve version number.
|
* Retrieve version number.
|
||||||
*
|
*
|
||||||
* @Operation(
|
* @Operation(
|
||||||
* tags={"Informations"},
|
* tags={"Information"},
|
||||||
* summary="Retrieve version number.",
|
* summary="Retrieve version number.",
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
* response="200",
|
* response="200",
|
||||||
* description="Returned when successful"
|
* description="Returned when successful",
|
||||||
|
* @OA\JsonContent(
|
||||||
|
* description="Version number of the application.",
|
||||||
|
* type="string",
|
||||||
|
* example="2.5.2",
|
||||||
|
* )
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
@ -61,14 +68,13 @@ class WallabagRestController extends AbstractFOSRestController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve information about the wallabag instance.
|
|
||||||
*
|
|
||||||
* @Operation(
|
* @Operation(
|
||||||
* tags={"Informations"},
|
* tags={"Information"},
|
||||||
* summary="Retrieve information about the wallabag instance.",
|
* summary="Retrieve information about the running wallabag application.",
|
||||||
* @OA\Response(
|
* @OA\Response(
|
||||||
* response="200",
|
* response="200",
|
||||||
* description="Returned when successful"
|
* description="Returned when successful",
|
||||||
|
* @Model(type=ApplicationInfo::class),
|
||||||
* )
|
* )
|
||||||
* )
|
* )
|
||||||
*
|
*
|
||||||
@ -78,11 +84,10 @@ class WallabagRestController extends AbstractFOSRestController
|
|||||||
*/
|
*/
|
||||||
public function getInfoAction(Config $craueConfig)
|
public function getInfoAction(Config $craueConfig)
|
||||||
{
|
{
|
||||||
$info = [
|
$info = new ApplicationInfo(
|
||||||
'appname' => 'wallabag',
|
$this->getParameter('wallabag_core.version'),
|
||||||
'version' => $this->getParameter('wallabag_core.version'),
|
$this->getParameter('fosuser_registration') && $craueConfig->get('api_user_registration'),
|
||||||
'allowed_registration' => $this->getParameter('fosuser_registration') && $craueConfig->get('api_user_registration'),
|
);
|
||||||
];
|
|
||||||
|
|
||||||
return (new JsonResponse())->setJson($this->serializer->serialize($info, 'json'));
|
return (new JsonResponse())->setJson($this->serializer->serialize($info, 'json'));
|
||||||
}
|
}
|
||||||
|
|||||||
44
src/Wallabag/ApiBundle/Entity/ApplicationInfo.php
Normal file
44
src/Wallabag/ApiBundle/Entity/ApplicationInfo.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Wallabag\ApiBundle\Entity;
|
||||||
|
|
||||||
|
use OpenApi\Annotations as OA;
|
||||||
|
|
||||||
|
class ApplicationInfo
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @OA\Property(
|
||||||
|
* description="Name of the application.",
|
||||||
|
* type="string",
|
||||||
|
* example="wallabag",
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public $appname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @OA\Property(
|
||||||
|
* description="Version number of the application.",
|
||||||
|
* type="string",
|
||||||
|
* example="2.5.2",
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public $version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
* @OA\Property(
|
||||||
|
* description="Indicates whether registration is allowed. See PUT /api/user.",
|
||||||
|
* type="boolean"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public $allowed_registration;
|
||||||
|
|
||||||
|
public function __construct($version, $allowed_registration)
|
||||||
|
{
|
||||||
|
$this->appname = 'wallabag';
|
||||||
|
$this->version = $version;
|
||||||
|
$this->allowed_registration = $allowed_registration;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,6 +7,7 @@ use FOS\OAuthServerBundle\Entity\Client as BaseClient;
|
|||||||
use JMS\Serializer\Annotation\Groups;
|
use JMS\Serializer\Annotation\Groups;
|
||||||
use JMS\Serializer\Annotation\SerializedName;
|
use JMS\Serializer\Annotation\SerializedName;
|
||||||
use JMS\Serializer\Annotation\VirtualProperty;
|
use JMS\Serializer\Annotation\VirtualProperty;
|
||||||
|
use OpenApi\Annotations as OA;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,6 +28,12 @@ class Client extends BaseClient
|
|||||||
*
|
*
|
||||||
* @ORM\Column(name="name", type="text", nullable=false)
|
* @ORM\Column(name="name", type="text", nullable=false)
|
||||||
*
|
*
|
||||||
|
* @OA\Property(
|
||||||
|
* description="Name of the API client",
|
||||||
|
* type="string",
|
||||||
|
* example="Default Client",
|
||||||
|
* )
|
||||||
|
*
|
||||||
* @Groups({"user_api_with_client"})
|
* @Groups({"user_api_with_client"})
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
@ -44,6 +51,12 @@ class Client extends BaseClient
|
|||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
|
* @OA\Property(
|
||||||
|
* description="Client secret used for authorization",
|
||||||
|
* type="string",
|
||||||
|
* example="2lmubx2m9vy80ss8c4wwcsg8ok44s88ocwcc8wo0w884oc8440",
|
||||||
|
* )
|
||||||
|
*
|
||||||
* @SerializedName("client_secret")
|
* @SerializedName("client_secret")
|
||||||
* @Groups({"user_api_with_client"})
|
* @Groups({"user_api_with_client"})
|
||||||
*/
|
*/
|
||||||
@ -94,6 +107,13 @@ class Client extends BaseClient
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @VirtualProperty
|
* @VirtualProperty
|
||||||
|
*
|
||||||
|
* @OA\Property(
|
||||||
|
* description="Client secret used for authorization",
|
||||||
|
* type="string",
|
||||||
|
* example="3_1lpybsn0od40css4w4ko8gsc8cwwskggs8kgg448ko0owo4c84",
|
||||||
|
* )
|
||||||
|
*
|
||||||
* @SerializedName("client_id")
|
* @SerializedName("client_id")
|
||||||
* @Groups({"user_api_with_client"})
|
* @Groups({"user_api_with_client"})
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,6 +4,9 @@ namespace Wallabag\CoreBundle\Command;
|
|||||||
|
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Doctrine\DBAL\Exception\DriverException;
|
use Doctrine\DBAL\Exception\DriverException;
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use FOS\UserBundle\Event\UserEvent;
|
use FOS\UserBundle\Event\UserEvent;
|
||||||
use FOS\UserBundle\FOSUserEvents;
|
use FOS\UserBundle\FOSUserEvents;
|
||||||
@ -112,7 +115,7 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
$rows[] = [sprintf($label, $this->databaseDriver), $status, $help];
|
$rows[] = [sprintf($label, $this->databaseDriver), $status, $help];
|
||||||
|
|
||||||
// testing if connection to the database can be etablished
|
// testing if connection to the database can be established
|
||||||
$label = '<comment>Database connection</comment>';
|
$label = '<comment>Database connection</comment>';
|
||||||
$status = '<info>OK!</info>';
|
$status = '<info>OK!</info>';
|
||||||
$help = '';
|
$help = '';
|
||||||
@ -138,7 +141,7 @@ class InstallCommand extends Command
|
|||||||
$help = '';
|
$help = '';
|
||||||
|
|
||||||
// now check if MySQL isn't too old to handle utf8mb4
|
// now check if MySQL isn't too old to handle utf8mb4
|
||||||
if ($conn->isConnected() && 'mysql' === $conn->getDatabasePlatform()->getName()) {
|
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof MySQLPlatform) {
|
||||||
$version = $conn->query('select version()')->fetchOne();
|
$version = $conn->query('select version()')->fetchOne();
|
||||||
$minimalVersion = '5.5.4';
|
$minimalVersion = '5.5.4';
|
||||||
|
|
||||||
@ -150,7 +153,7 @@ class InstallCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// testing if PostgreSQL > 9.1
|
// testing if PostgreSQL > 9.1
|
||||||
if ($conn->isConnected() && 'postgresql' === $conn->getDatabasePlatform()->getName()) {
|
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||||
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
|
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
|
||||||
$version = $conn->query('SELECT version();')->fetchOne();
|
$version = $conn->query('SELECT version();')->fetchOne();
|
||||||
|
|
||||||
@ -391,7 +394,7 @@ class InstallCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
||||||
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
|
if ($connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||||
$params = $connection->getParams();
|
$params = $connection->getParams();
|
||||||
|
|
||||||
if (isset($params['path']) && file_exists($params['path'])) {
|
if (isset($params['path']) && file_exists($params['path'])) {
|
||||||
@ -412,7 +415,7 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the schema is already created.
|
* Check if the schema is already created.
|
||||||
* If we found at least oen table, it means the schema exists.
|
* If we found at least one table, it means the schema exists.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use Doctrine\ORM\NoResultException;
|
|||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
@ -41,13 +42,19 @@ class ReloadEntryCommand extends Command
|
|||||||
->setDescription('Reload entries')
|
->setDescription('Reload entries')
|
||||||
->setHelp('This command reload entries')
|
->setHelp('This command reload entries')
|
||||||
->addArgument('username', InputArgument::OPTIONAL, 'Reload entries only for the given user')
|
->addArgument('username', InputArgument::OPTIONAL, 'Reload entries only for the given user')
|
||||||
;
|
->addOption(
|
||||||
|
'only-not-parsed',
|
||||||
|
null,
|
||||||
|
InputOption::VALUE_NONE,
|
||||||
|
'Only reload entries which have `is_not_parsed` set to `true`'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$io = new SymfonyStyle($input, $output);
|
$io = new SymfonyStyle($input, $output);
|
||||||
|
|
||||||
|
$onlyNotParsed = (bool) $input->getOption('only-not-parsed');
|
||||||
$userId = null;
|
$userId = null;
|
||||||
if ($username = $input->getArgument('username')) {
|
if ($username = $input->getArgument('username')) {
|
||||||
try {
|
try {
|
||||||
@ -61,7 +68,8 @@ class ReloadEntryCommand extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$entryIds = $this->entryRepository->findAllEntriesIdByUserId($userId);
|
$methodName = $onlyNotParsed ? 'findAllEntriesIdByUserIdAndNotParsed' : 'findAllEntriesIdByUserId';
|
||||||
|
$entryIds = $this->entryRepository->$methodName($userId);
|
||||||
|
|
||||||
$nbEntries = \count($entryIds);
|
$nbEntries = \count($entryIds);
|
||||||
if (!$nbEntries) {
|
if (!$nbEntries) {
|
||||||
|
|||||||
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Wallabag\CoreBundle\Command;
|
||||||
|
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||||
|
|
||||||
|
class UpdatePicturesPathCommand extends Command
|
||||||
|
{
|
||||||
|
private EntityManagerInterface $entityManager;
|
||||||
|
private EntryRepository $entryRepository;
|
||||||
|
private string $wallabagUrl;
|
||||||
|
|
||||||
|
public function __construct(EntityManagerInterface $entityManager, EntryRepository $entryRepository, $wallabagUrl)
|
||||||
|
{
|
||||||
|
$this->entityManager = $entityManager;
|
||||||
|
$this->entryRepository = $entryRepository;
|
||||||
|
$this->wallabagUrl = $wallabagUrl;
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
$this
|
||||||
|
->setName('wallabag:update-pictures-path')
|
||||||
|
->setDescription('Update the path of the pictures for each entry when you changed your wallabag instance URL.')
|
||||||
|
->addArgument(
|
||||||
|
'old-url',
|
||||||
|
InputArgument::REQUIRED,
|
||||||
|
'URL to replace'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
|
{
|
||||||
|
$io = new SymfonyStyle($input, $output);
|
||||||
|
|
||||||
|
$oldUrl = $input->getArgument('old-url');
|
||||||
|
|
||||||
|
$query = $this->entryRepository->createQueryBuilder('e')->getQuery();
|
||||||
|
$io->text('Retrieve existing entries');
|
||||||
|
$i = 1;
|
||||||
|
foreach ($query->toIterable() as $entry) {
|
||||||
|
$content = $entry->getContent();
|
||||||
|
if (null !== $content) {
|
||||||
|
$entry->setContent(str_replace($oldUrl, $this->wallabagUrl, $content));
|
||||||
|
}
|
||||||
|
|
||||||
|
$previewPicture = $entry->getPreviewPicture();
|
||||||
|
if (null !== $previewPicture) {
|
||||||
|
$entry->setPreviewPicture(str_replace($oldUrl, $this->wallabagUrl, $previewPicture));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 === ($i % 20)) {
|
||||||
|
$this->entityManager->flush();
|
||||||
|
}
|
||||||
|
++$i;
|
||||||
|
}
|
||||||
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
$io->success('Finished updating.');
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,6 +11,7 @@ use JMS\Serializer\SerializerBuilder;
|
|||||||
use PragmaRX\Recovery\Recovery as BackupCodes;
|
use PragmaRX\Recovery\Recovery as BackupCodes;
|
||||||
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -25,6 +26,7 @@ use Wallabag\CoreBundle\Entity\Config as ConfigEntity;
|
|||||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||||
use Wallabag\CoreBundle\Entity\RuleInterface;
|
use Wallabag\CoreBundle\Entity\RuleInterface;
|
||||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||||
|
use Wallabag\CoreBundle\Event\ConfigUpdatedEvent;
|
||||||
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
|
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
|
||||||
use Wallabag\CoreBundle\Form\Type\ConfigType;
|
use Wallabag\CoreBundle\Form\Type\ConfigType;
|
||||||
use Wallabag\CoreBundle\Form\Type\FeedType;
|
use Wallabag\CoreBundle\Form\Type\FeedType;
|
||||||
@ -48,15 +50,24 @@ class ConfigController extends AbstractController
|
|||||||
private TagRepository $tagRepository;
|
private TagRepository $tagRepository;
|
||||||
private AnnotationRepository $annotationRepository;
|
private AnnotationRepository $annotationRepository;
|
||||||
private ConfigRepository $configRepository;
|
private ConfigRepository $configRepository;
|
||||||
|
private EventDispatcherInterface $eventDispatcher;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $entityManager, UserManagerInterface $userManager, EntryRepository $entryRepository, TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository)
|
public function __construct(
|
||||||
{
|
EntityManagerInterface $entityManager,
|
||||||
|
UserManagerInterface $userManager,
|
||||||
|
EntryRepository $entryRepository,
|
||||||
|
TagRepository $tagRepository,
|
||||||
|
AnnotationRepository $annotationRepository,
|
||||||
|
ConfigRepository $configRepository,
|
||||||
|
EventDispatcherInterface $eventDispatcher
|
||||||
|
) {
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->userManager = $userManager;
|
$this->userManager = $userManager;
|
||||||
$this->entryRepository = $entryRepository;
|
$this->entryRepository = $entryRepository;
|
||||||
$this->tagRepository = $tagRepository;
|
$this->tagRepository = $tagRepository;
|
||||||
$this->annotationRepository = $annotationRepository;
|
$this->annotationRepository = $annotationRepository;
|
||||||
$this->configRepository = $configRepository;
|
$this->configRepository = $configRepository;
|
||||||
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,6 +83,7 @@ class ConfigController extends AbstractController
|
|||||||
$configForm->handleRequest($request);
|
$configForm->handleRequest($request);
|
||||||
|
|
||||||
if ($configForm->isSubmitted() && $configForm->isValid()) {
|
if ($configForm->isSubmitted() && $configForm->isValid()) {
|
||||||
|
$this->eventDispatcher->dispatch(new ConfigUpdatedEvent($config), ConfigUpdatedEvent::NAME);
|
||||||
$this->entityManager->persist($config);
|
$this->entityManager->persist($config);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
@ -90,14 +102,10 @@ class ConfigController extends AbstractController
|
|||||||
$pwdForm->handleRequest($request);
|
$pwdForm->handleRequest($request);
|
||||||
|
|
||||||
if ($pwdForm->isSubmitted() && $pwdForm->isValid()) {
|
if ($pwdForm->isSubmitted() && $pwdForm->isValid()) {
|
||||||
if ($craueConfig->get('demo_mode_enabled') && $craueConfig->get('demo_mode_username') === $user->getUsername()) {
|
$message = 'flashes.config.notice.password_updated';
|
||||||
$message = 'flashes.config.notice.password_not_updated_demo';
|
|
||||||
} else {
|
|
||||||
$message = 'flashes.config.notice.password_updated';
|
|
||||||
|
|
||||||
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
$user->setPlainPassword($pwdForm->get('new_password')->getData());
|
||||||
$this->userManager->updateUser($user, true);
|
$this->userManager->updateUser($user, true);
|
||||||
}
|
|
||||||
|
|
||||||
$this->addFlash('notice', $message);
|
$this->addFlash('notice', $message);
|
||||||
|
|
||||||
@ -246,7 +254,6 @@ class ConfigController extends AbstractController
|
|||||||
'username' => $user->getUsername(),
|
'username' => $user->getUsername(),
|
||||||
'token' => $config->getFeedToken(),
|
'token' => $config->getFeedToken(),
|
||||||
],
|
],
|
||||||
'twofactor_auth' => $this->getParameter('twofactor_auth'),
|
|
||||||
'wallabag_url' => $this->getParameter('domain_name'),
|
'wallabag_url' => $this->getParameter('domain_name'),
|
||||||
'enabled_users' => $userRepository->getSumEnabledUsers(),
|
'enabled_users' => $userRepository->getSumEnabledUsers(),
|
||||||
]);
|
]);
|
||||||
@ -255,12 +262,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Disable 2FA using email.
|
* Disable 2FA using email.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/email/disable", name="disable_otp_email")
|
* @Route("/config/otp/email/disable", name="disable_otp_email", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
public function disableOtpEmailAction()
|
public function disableOtpEmailAction(Request $request)
|
||||||
{
|
{
|
||||||
if (!$this->getParameter('twofactor_auth')) {
|
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||||
return $this->createNotFoundException('two_factor not enabled');
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
@ -279,12 +286,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Enable 2FA using email.
|
* Enable 2FA using email.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/email", name="config_otp_email")
|
* @Route("/config/otp/email", name="config_otp_email", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
public function otpEmailAction()
|
public function otpEmailAction(Request $request)
|
||||||
{
|
{
|
||||||
if (!$this->getParameter('twofactor_auth')) {
|
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||||
return $this->createNotFoundException('two_factor not enabled');
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
@ -306,12 +313,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Disable 2FA using OTP app.
|
* Disable 2FA using OTP app.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app/disable", name="disable_otp_app")
|
* @Route("/config/otp/app/disable", name="disable_otp_app", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
public function disableOtpAppAction()
|
public function disableOtpAppAction(Request $request)
|
||||||
{
|
{
|
||||||
if (!$this->getParameter('twofactor_auth')) {
|
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||||
return $this->createNotFoundException('two_factor not enabled');
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
@ -332,12 +339,12 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Enable 2FA using OTP app, user will need to confirm the generated code from the app.
|
* Enable 2FA using OTP app, user will need to confirm the generated code from the app.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app", name="config_otp_app")
|
* @Route("/config/otp/app", name="config_otp_app", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
public function otpAppAction(GoogleAuthenticatorInterface $googleAuthenticator)
|
public function otpAppAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||||
{
|
{
|
||||||
if (!$this->getParameter('twofactor_auth')) {
|
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||||
return $this->createNotFoundException('two_factor not enabled');
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
@ -374,13 +381,11 @@ class ConfigController extends AbstractController
|
|||||||
* Cancelling 2FA using OTP app.
|
* Cancelling 2FA using OTP app.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app/cancel", name="config_otp_app_cancel")
|
* @Route("/config/otp/app/cancel", name="config_otp_app_cancel")
|
||||||
|
*
|
||||||
|
* XXX: commented until we rewrite 2fa with a real two-steps activation
|
||||||
*/
|
*/
|
||||||
public function otpAppCancelAction()
|
/*public function otpAppCancelAction()
|
||||||
{
|
{
|
||||||
if (!$this->getParameter('twofactor_auth')) {
|
|
||||||
return $this->createNotFoundException('two_factor not enabled');
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$user->setGoogleAuthenticatorSecret(null);
|
$user->setGoogleAuthenticatorSecret(null);
|
||||||
$user->setBackupCodes(null);
|
$user->setBackupCodes(null);
|
||||||
@ -388,15 +393,19 @@ class ConfigController extends AbstractController
|
|||||||
$this->userManager->updateUser($user, true);
|
$this->userManager->updateUser($user, true);
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config') . '#set3');
|
return $this->redirect($this->generateUrl('config') . '#set3');
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate OTP code.
|
* Validate OTP code.
|
||||||
*
|
*
|
||||||
* @Route("/config/otp/app/check", name="config_otp_app_check")
|
* @Route("/config/otp/app/check", name="config_otp_app_check", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||||
{
|
{
|
||||||
|
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||||
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
|
}
|
||||||
|
|
||||||
$isValid = $googleAuthenticator->checkCode(
|
$isValid = $googleAuthenticator->checkCode(
|
||||||
$this->getUser(),
|
$this->getUser(),
|
||||||
$request->get('_auth_code')
|
$request->get('_auth_code')
|
||||||
@ -416,7 +425,12 @@ class ConfigController extends AbstractController
|
|||||||
'scheb_two_factor.code_invalid'
|
'scheb_two_factor.code_invalid'
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('config_otp_app'));
|
$this->addFlash(
|
||||||
|
'notice',
|
||||||
|
'scheb_two_factor.code_invalid'
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->redirect($this->generateUrl('config') . '#set3');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -544,12 +558,16 @@ class ConfigController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Remove all annotations OR tags OR entries for the current user.
|
* Remove all annotations OR tags OR entries for the current user.
|
||||||
*
|
*
|
||||||
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset")
|
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset", methods={"POST"})
|
||||||
*
|
*
|
||||||
* @return RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function resetAction(string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
||||||
{
|
{
|
||||||
|
if (!$this->isCsrfTokenValid('reset-area', $request->request->get('token'))) {
|
||||||
|
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||||
|
}
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'annotations':
|
case 'annotations':
|
||||||
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
||||||
@ -636,7 +654,7 @@ class ConfigController extends AbstractController
|
|||||||
$this->entityManager->persist($user);
|
$this->entityManager->persist($user);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
return $this->redirect($request->headers->get('referer'));
|
return $this->redirect($request->getSession()->get('prevUrl'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -128,7 +128,7 @@ class EntryController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -390,6 +390,7 @@ class EntryController extends AbstractController
|
|||||||
public function viewAction(Entry $entry)
|
public function viewAction(Entry $entry)
|
||||||
{
|
{
|
||||||
$this->checkUserAction($entry);
|
$this->checkUserAction($entry);
|
||||||
|
$this->get('session')->set('prevUrl', $this->generateUrl('view', ['id' => $entry->getId()]));
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'@WallabagCore/Entry/entry.html.twig',
|
'@WallabagCore/Entry/entry.html.twig',
|
||||||
@ -451,7 +452,7 @@ class EntryController extends AbstractController
|
|||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -481,7 +482,7 @@ class EntryController extends AbstractController
|
|||||||
$message
|
$message
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -517,8 +518,8 @@ class EntryController extends AbstractController
|
|||||||
);
|
);
|
||||||
|
|
||||||
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
|
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
|
||||||
$referer = $request->headers->get('referer');
|
$prev = $request->getSession()->get('prevUrl', '');
|
||||||
$to = (1 !== preg_match('#' . $url . '$#i', $referer) ? $referer : null);
|
$to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($to);
|
$redirectUrl = $this->redirectHelper->to($to);
|
||||||
|
|
||||||
@ -614,8 +615,9 @@ class EntryController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
private function showEntries($type, Request $request, $page)
|
private function showEntries($type, Request $request, $page)
|
||||||
{
|
{
|
||||||
$searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : '');
|
$searchTerm = (isset($request->get('search_entry')['term']) ? trim($request->get('search_entry')['term']) : '');
|
||||||
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
||||||
|
$request->getSession()->set('prevUrl', $request->getRequestUri());
|
||||||
|
|
||||||
$formOptions = [];
|
$formOptions = [];
|
||||||
|
|
||||||
@ -673,9 +675,6 @@ class EntryController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$nbEntriesUntagged = $this->entryRepository
|
|
||||||
->countUntaggedEntriesByUser($this->getUser()->getId());
|
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'@WallabagCore/Entry/entries.html.twig', [
|
'@WallabagCore/Entry/entries.html.twig', [
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
@ -683,7 +682,6 @@ class EntryController extends AbstractController
|
|||||||
'currentPage' => $page,
|
'currentPage' => $page,
|
||||||
'searchTerm' => $searchTerm,
|
'searchTerm' => $searchTerm,
|
||||||
'isFiltered' => $form->isSubmitted(),
|
'isFiltered' => $form->isSubmitted(),
|
||||||
'nbEntriesUntagged' => $nbEntriesUntagged,
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Controller;
|
|
||||||
|
|
||||||
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This controller allow us to customize the error template.
|
|
||||||
* The only modified line from the parent template is for "WallabagCoreBundle".
|
|
||||||
*/
|
|
||||||
class ExceptionController extends BaseExceptionController
|
|
||||||
{
|
|
||||||
protected function findTemplate(Request $request, $format, $code, $showException)
|
|
||||||
{
|
|
||||||
$name = $showException ? 'exception' : 'error';
|
|
||||||
if ($showException && 'html' === $format) {
|
|
||||||
$name = 'exception_full';
|
|
||||||
}
|
|
||||||
|
|
||||||
// For error pages, try to find a template for the specific HTTP status code and format
|
|
||||||
if (!$showException) {
|
|
||||||
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
|
|
||||||
if ($this->templateExists($template)) {
|
|
||||||
return $template;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// try to find a template for the given format
|
|
||||||
$template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format);
|
|
||||||
if ($this->templateExists($template)) {
|
|
||||||
return $template;
|
|
||||||
}
|
|
||||||
|
|
||||||
// default to a generic HTML exception
|
|
||||||
$request->setRequestFormat('html');
|
|
||||||
|
|
||||||
return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -21,7 +21,7 @@ class ExportController extends AbstractController
|
|||||||
* Gets one entry content.
|
* Gets one entry content.
|
||||||
*
|
*
|
||||||
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
||||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
* "format": "epub|pdf|json|xml|txt|csv",
|
||||||
* "id": "\d+"
|
* "id": "\d+"
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
@ -55,19 +55,27 @@ class ExportController extends AbstractController
|
|||||||
* Export all entries for current user.
|
* Export all entries for current user.
|
||||||
*
|
*
|
||||||
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
||||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
* "format": "epub|pdf|json|xml|txt|csv",
|
||||||
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
|
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
|
||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function downloadEntriesAction(Request $request, EntryRepository $entryRepository, TagRepository $tagRepository, EntriesExport $entriesExport, string $format, string $category)
|
public function downloadEntriesAction(Request $request, EntryRepository $entryRepository, TagRepository $tagRepository, EntriesExport $entriesExport, string $format, string $category, int $entry = 0)
|
||||||
{
|
{
|
||||||
$method = ucfirst($category);
|
$method = ucfirst($category);
|
||||||
$methodBuilder = 'getBuilderFor' . $method . 'ByUser';
|
$methodBuilder = 'getBuilderFor' . $method . 'ByUser';
|
||||||
$title = $method;
|
$title = $method;
|
||||||
|
|
||||||
if ('tag_entries' === $category) {
|
if ('same_domain' === $category) {
|
||||||
|
$entries = $entryRepository->getBuilderForSameDomainByUser(
|
||||||
|
$this->getUser()->getId(),
|
||||||
|
$request->get('entry')
|
||||||
|
)->getQuery()
|
||||||
|
->getResult();
|
||||||
|
|
||||||
|
$title = 'Same domain';
|
||||||
|
} elseif ('tag_entries' === $category) {
|
||||||
$tag = $tagRepository->findOneBySlug($request->query->get('tag'));
|
$tag = $tagRepository->findOneBySlug($request->query->get('tag'));
|
||||||
|
|
||||||
$entries = $entryRepository->findAllByTagId(
|
$entries = $entryRepository->findAllByTagId(
|
||||||
|
|||||||
@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Controller;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\Form;
|
use Symfony\Component\Form\Form;
|
||||||
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@ -138,7 +139,7 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param IgnoreOriginInstanceRule $ignoreOriginInstanceRule The ignore origin instance rule entity
|
* @param IgnoreOriginInstanceRule $ignoreOriginInstanceRule The ignore origin instance rule entity
|
||||||
*
|
*
|
||||||
* @return Form The form
|
* @return FormInterface The form
|
||||||
*/
|
*/
|
||||||
private function createDeleteForm(IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
|
private function createDeleteForm(IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,6 +6,7 @@ use Craue\ConfigBundle\Util\Config;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\Form;
|
use Symfony\Component\Form\Form;
|
||||||
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@ -173,7 +174,7 @@ class SiteCredentialController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param SiteCredential $siteCredential The site credential entity
|
* @param SiteCredential $siteCredential The site credential entity
|
||||||
*
|
*
|
||||||
* @return Form The form
|
* @return FormInterface The form
|
||||||
*/
|
*/
|
||||||
private function createDeleteForm(SiteCredential $siteCredential)
|
private function createDeleteForm(SiteCredential $siteCredential)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class TagController extends AbstractController
|
|||||||
$form = $this->createForm(NewTagType::class, new Tag());
|
$form = $this->createForm(NewTagType::class, new Tag());
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
$tags = $form->get('label')->getData();
|
$tags = $form->get('label')->getData() ?? '';
|
||||||
$tagsExploded = explode(',', $tags);
|
$tagsExploded = explode(',', $tags);
|
||||||
|
|
||||||
// avoid too much tag to be added
|
// avoid too much tag to be added
|
||||||
@ -104,7 +104,7 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ class TagController extends AbstractController
|
|||||||
$form = $this->createForm(RenameTagType::class, new Tag());
|
$form = $this->createForm(RenameTagType::class, new Tag());
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$newTag = new Tag();
|
$newTag = new Tag();
|
||||||
@ -257,7 +257,7 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirect($this->redirectHelper->to($request->headers->get('referer'), '', true));
|
return $this->redirect($this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -279,8 +279,7 @@ class TagController extends AbstractController
|
|||||||
$this->entityManager->remove($tag);
|
$this->entityManager->remove($tag);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
}
|
}
|
||||||
|
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
|
||||||
|
|
||||||
return $this->redirect($redirectUrl);
|
return $this->redirect($redirectUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -15,7 +16,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$adminConfig = new Config($this->getReference('admin-user'));
|
$adminConfig = new Config($this->getReference('admin-user', User::class));
|
||||||
|
|
||||||
$adminConfig->setItemsPerPage(30);
|
$adminConfig->setItemsPerPage(30);
|
||||||
$adminConfig->setReadingSpeed(200);
|
$adminConfig->setReadingSpeed(200);
|
||||||
@ -29,7 +30,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('admin-config', $adminConfig);
|
$this->addReference('admin-config', $adminConfig);
|
||||||
|
|
||||||
$bobConfig = new Config($this->getReference('bob-user'));
|
$bobConfig = new Config($this->getReference('bob-user', User::class));
|
||||||
$bobConfig->setItemsPerPage(10);
|
$bobConfig->setItemsPerPage(10);
|
||||||
$bobConfig->setReadingSpeed(200);
|
$bobConfig->setReadingSpeed(200);
|
||||||
$bobConfig->setLanguage('fr');
|
$bobConfig->setLanguage('fr');
|
||||||
@ -42,7 +43,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$this->addReference('bob-config', $bobConfig);
|
$this->addReference('bob-config', $bobConfig);
|
||||||
|
|
||||||
$emptyConfig = new Config($this->getReference('empty-user'));
|
$emptyConfig = new Config($this->getReference('empty-user', User::class));
|
||||||
$emptyConfig->setItemsPerPage(10);
|
$emptyConfig->setItemsPerPage(10);
|
||||||
$emptyConfig->setReadingSpeed(100);
|
$emptyConfig->setReadingSpeed(100);
|
||||||
$emptyConfig->setLanguage('en');
|
$emptyConfig->setLanguage('en');
|
||||||
|
|||||||
@ -6,7 +6,9 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
|
|||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class EntryFixtures extends Fixture implements DependentFixtureInterface
|
class EntryFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -15,6 +17,8 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
|
$now = new \DateTime();
|
||||||
|
|
||||||
$entries = [
|
$entries = [
|
||||||
'entry1' => [
|
'entry1' => [
|
||||||
'user' => 'admin-user',
|
'user' => 'admin-user',
|
||||||
@ -70,6 +74,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
'content' => 'This is my content /o/',
|
'content' => 'This is my content /o/',
|
||||||
'language' => 'fr',
|
'language' => 'fr',
|
||||||
'starred' => true,
|
'starred' => true,
|
||||||
|
'starred_at' => $now,
|
||||||
'preview' => 'http://0.0.0.0/image.jpg',
|
'preview' => 'http://0.0.0.0/image.jpg',
|
||||||
],
|
],
|
||||||
'entry6' => [
|
'entry6' => [
|
||||||
@ -82,12 +87,14 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
'content' => 'This is my content /o/',
|
'content' => 'This is my content /o/',
|
||||||
'language' => 'de',
|
'language' => 'de',
|
||||||
'archived' => true,
|
'archived' => true,
|
||||||
|
'archived_at' => $now,
|
||||||
'tags' => ['bar-tag'],
|
'tags' => ['bar-tag'],
|
||||||
|
'is_not_parsed' => true,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($entries as $reference => $item) {
|
foreach ($entries as $reference => $item) {
|
||||||
$entry = new Entry($this->getReference($item['user']));
|
$entry = new Entry($this->getReference($item['user'], User::class));
|
||||||
$entry->setUrl($item['url']);
|
$entry->setUrl($item['url']);
|
||||||
$entry->setReadingTime($item['reading_time']);
|
$entry->setReadingTime($item['reading_time']);
|
||||||
$entry->setDomainName($item['domain']);
|
$entry->setDomainName($item['domain']);
|
||||||
@ -98,7 +105,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
if (isset($item['tags'])) {
|
if (isset($item['tags'])) {
|
||||||
foreach ($item['tags'] as $tag) {
|
foreach ($item['tags'] as $tag) {
|
||||||
$entry->addTag($this->getReference($tag));
|
$entry->addTag($this->getReference($tag, Tag::class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,14 +117,26 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
$entry->setStarred($item['starred']);
|
$entry->setStarred($item['starred']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($item['starred_at'])) {
|
||||||
|
$entry->setStarredAt($item['starred_at']);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($item['archived'])) {
|
if (isset($item['archived'])) {
|
||||||
$entry->setArchived($item['archived']);
|
$entry->setArchived($item['archived']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($item['archived_at'])) {
|
||||||
|
$entry->setArchivedAt($item['archived_at']);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($item['preview'])) {
|
if (isset($item['preview'])) {
|
||||||
$entry->setPreviewPicture($item['preview']);
|
$entry->setPreviewPicture($item['preview']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($item['is_not_parsed'])) {
|
||||||
|
$entry->setNotParsed($item['is_not_parsed']);
|
||||||
|
}
|
||||||
|
|
||||||
$manager->persist($entry);
|
$manager->persist($entry);
|
||||||
$this->addReference($reference, $entry);
|
$this->addReference($reference, $entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
@ -17,7 +18,7 @@ class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureIn
|
|||||||
{
|
{
|
||||||
$rule = new IgnoreOriginUserRule();
|
$rule = new IgnoreOriginUserRule();
|
||||||
$rule->setRule('host = "example.fr"');
|
$rule->setRule('host = "example.fr"');
|
||||||
$rule->setConfig($this->getReference('admin-user')->getConfig());
|
$rule->setConfig($this->getReference('admin-user', User::class)->getConfig());
|
||||||
|
|
||||||
$manager->persist($rule);
|
$manager->persist($rule);
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||||
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
||||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
|
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
|
||||||
{
|
{
|
||||||
@ -28,14 +29,14 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
|
|||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
$credential = new SiteCredential($this->getReference('admin-user'));
|
$credential = new SiteCredential($this->getReference('admin-user', User::class));
|
||||||
$credential->setHost('.super.com');
|
$credential->setHost('.super.com');
|
||||||
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
|
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
|
||||||
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
||||||
|
|
||||||
$manager->persist($credential);
|
$manager->persist($credential);
|
||||||
|
|
||||||
$credential = new SiteCredential($this->getReference('admin-user'));
|
$credential = new SiteCredential($this->getReference('admin-user', User::class));
|
||||||
$credential->setHost('paywall.example.com');
|
$credential->setHost('paywall.example.com');
|
||||||
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
|
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
|
||||||
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
||||||
|
|||||||
@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\DataFixtures;
|
|||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||||
|
|
||||||
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||||
@ -17,14 +18,14 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
$tr1 = new TaggingRule();
|
$tr1 = new TaggingRule();
|
||||||
$tr1->setRule('content matches "spurs"');
|
$tr1->setRule('content matches "spurs"');
|
||||||
$tr1->setTags(['sport']);
|
$tr1->setTags(['sport']);
|
||||||
$tr1->setConfig($this->getReference('admin-config'));
|
$tr1->setConfig($this->getReference('admin-config', Config::class));
|
||||||
|
|
||||||
$manager->persist($tr1);
|
$manager->persist($tr1);
|
||||||
|
|
||||||
$tr2 = new TaggingRule();
|
$tr2 = new TaggingRule();
|
||||||
$tr2->setRule('content matches "basket"');
|
$tr2->setRule('content matches "basket"');
|
||||||
$tr2->setTags(['sport']);
|
$tr2->setTags(['sport']);
|
||||||
$tr2->setConfig($this->getReference('admin-config'));
|
$tr2->setConfig($this->getReference('admin-config', Config::class));
|
||||||
|
|
||||||
$manager->persist($tr2);
|
$manager->persist($tr2);
|
||||||
|
|
||||||
@ -32,28 +33,28 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
|||||||
|
|
||||||
$tr3->setRule('title matches "wallabag"');
|
$tr3->setRule('title matches "wallabag"');
|
||||||
$tr3->setTags(['wallabag']);
|
$tr3->setTags(['wallabag']);
|
||||||
$tr3->setConfig($this->getReference('admin-config'));
|
$tr3->setConfig($this->getReference('admin-config', Config::class));
|
||||||
|
|
||||||
$manager->persist($tr3);
|
$manager->persist($tr3);
|
||||||
|
|
||||||
$tr4 = new TaggingRule();
|
$tr4 = new TaggingRule();
|
||||||
$tr4->setRule('content notmatches "basket"');
|
$tr4->setRule('content notmatches "basket"');
|
||||||
$tr4->setTags(['foot']);
|
$tr4->setTags(['foot']);
|
||||||
$tr4->setConfig($this->getReference('admin-config'));
|
$tr4->setConfig($this->getReference('admin-config', Config::class));
|
||||||
|
|
||||||
$manager->persist($tr4);
|
$manager->persist($tr4);
|
||||||
|
|
||||||
$tr5 = new TaggingRule();
|
$tr5 = new TaggingRule();
|
||||||
$tr5->setRule('readingTime <= 5');
|
$tr5->setRule('readingTime <= 5');
|
||||||
$tr5->setTags(['shortread']);
|
$tr5->setTags(['shortread']);
|
||||||
$tr5->setConfig($this->getReference('empty-config'));
|
$tr5->setConfig($this->getReference('empty-config', Config::class));
|
||||||
|
|
||||||
$manager->persist($tr5);
|
$manager->persist($tr5);
|
||||||
|
|
||||||
$tr6 = new TaggingRule();
|
$tr6 = new TaggingRule();
|
||||||
$tr6->setRule('readingTime > 5');
|
$tr6->setRule('readingTime > 5');
|
||||||
$tr6->setTags(['longread']);
|
$tr6->setTags(['longread']);
|
||||||
$tr6->setConfig($this->getReference('empty-config'));
|
$tr6->setConfig($this->getReference('empty-config', Config::class));
|
||||||
|
|
||||||
$manager->persist($tr6);
|
$manager->persist($tr6);
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,9 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
|
->arrayNode('fonts')
|
||||||
|
->prototype('scalar')->end()
|
||||||
|
->end()
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ class WallabagCoreExtension extends Extension
|
|||||||
$container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
|
$container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']);
|
||||||
$container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
|
$container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']);
|
||||||
$container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
|
$container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
|
||||||
|
$container->setParameter('wallabag_core.fonts', $config['fonts']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAlias()
|
public function getAlias()
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Wallabag\CoreBundle\Doctrine;
|
namespace Wallabag\CoreBundle\Doctrine;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
@ -49,7 +50,7 @@ abstract class WallabagMigration extends AbstractMigration implements ContainerA
|
|||||||
}
|
}
|
||||||
|
|
||||||
// escape table name is handled using " on postgresql
|
// escape table name is handled using " on postgresql
|
||||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||||
return '"' . $table . '"';
|
return '"' . $table . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -126,18 +126,65 @@ class Config
|
|||||||
*/
|
*/
|
||||||
private $displayThumbnails;
|
private $displayThumbnails;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="font", type="text", nullable=true)
|
||||||
|
*
|
||||||
|
* @Groups({"config_api"})
|
||||||
|
*/
|
||||||
|
private $font;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="fontsize", type="float", nullable=true)
|
||||||
|
*
|
||||||
|
* @Groups({"config_api"})
|
||||||
|
*/
|
||||||
|
private $fontsize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="line_height", type="float", nullable=true)
|
||||||
|
*
|
||||||
|
* @Groups({"config_api"})
|
||||||
|
*/
|
||||||
|
private $lineHeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="max_width", type="float", nullable=true)
|
||||||
|
*
|
||||||
|
* @Groups({"config_api"})
|
||||||
|
*/
|
||||||
|
private $maxWidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="custom_css", type="text", nullable=true)
|
||||||
|
*/
|
||||||
|
private $customCSS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
||||||
*/
|
*/
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @var ArrayCollection<TaggingRule>
|
||||||
|
*
|
||||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
||||||
* @ORM\OrderBy({"id" = "ASC"})
|
* @ORM\OrderBy({"id" = "ASC"})
|
||||||
*/
|
*/
|
||||||
private $taggingRules;
|
private $taggingRules;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@var ArrayCollection<IgnoreOriginUserRule>
|
||||||
|
|
||||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
|
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
|
||||||
* @ORM\OrderBy({"id" = "ASC"})
|
* @ORM\OrderBy({"id" = "ASC"})
|
||||||
*/
|
*/
|
||||||
@ -371,12 +418,9 @@ class Config
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function getDisplayThumbnails(): bool
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function getDisplayThumbnails(): ?bool
|
|
||||||
{
|
{
|
||||||
return $this->displayThumbnails;
|
return (bool) $this->displayThumbnails;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -384,7 +428,94 @@ class Config
|
|||||||
*/
|
*/
|
||||||
public function setDisplayThumbnails(bool $displayThumbnails)
|
public function setDisplayThumbnails(bool $displayThumbnails)
|
||||||
{
|
{
|
||||||
$this->displayThumbnails = $displayThumbnails;
|
$this->displayThumbnails = $displayThumbnails ? 1 : 0;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFont(): ?string
|
||||||
|
{
|
||||||
|
return $this->font;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setFont(string $font): self
|
||||||
|
{
|
||||||
|
$this->font = $font;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
public function getFontsize(): ?float
|
||||||
|
{
|
||||||
|
return $this->fontsize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setFontsize(float $fontsize): self
|
||||||
|
{
|
||||||
|
$this->fontsize = $fontsize;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
public function getLineHeight(): ?float
|
||||||
|
{
|
||||||
|
return $this->lineHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setLineHeight(float $lineHeight): self
|
||||||
|
{
|
||||||
|
$this->lineHeight = $lineHeight;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
public function getMaxWidth(): ?float
|
||||||
|
{
|
||||||
|
return $this->maxWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setMaxWidth(float $maxWidth): self
|
||||||
|
{
|
||||||
|
$this->maxWidth = $maxWidth;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCustomCSS(): ?string
|
||||||
|
{
|
||||||
|
return $this->customCSS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setCustomCSS(?string $customCSS): self
|
||||||
|
{
|
||||||
|
$this->customCSS = $customCSS;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user