Compare commits

...

302 Commits
2.3.0 ... 2.3.7

Author SHA1 Message Date
9796a3aac4 Release wallabag 2.3.7 2019-03-04 13:25:30 +01:00
36fd8e5fde Merge pull request #3895 from wallabag/prepare-2.3.7
Prepare 2.3.7 release
2019-03-04 12:06:22 +01:00
f2aa373054 Prepare 2.3.7 release 2019-03-04 09:32:26 +01:00
4ae4fa7b89 Merge pull request #3894 from wallabag/issue-3851
material: hide creation date from card actions on specific sizes
2019-03-03 20:22:30 +01:00
6640a922d1 material: update prod assets
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-03-03 19:24:34 +01:00
246cc9ac93 material: add media queries to hide creation date from card actions
Hide the creation date from card actions on specific sizes when there's
not enough space for all parts.

Fixes #3851

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-03-03 19:22:32 +01:00
f1f1efb5de material: wrap card actions, remove class hiding of creation date
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-03-03 19:22:32 +01:00
806635f7d5 Merge pull request #3893 from wallabag/issue-3877
material: fix left padding of content on medium screens
2019-03-03 19:22:03 +01:00
05232afe32 material: fix left padding of content on medium screens
Fixes #3877

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-03-02 23:46:00 +01:00
fb7dedf36c material: move a media query from cards to dedicated scss file
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-03-02 22:48:43 +01:00
1e9c710fdd Merge pull request #3885 from mart-e/script-ignore-root
Allow optional --ignore-root-warning
2019-03-01 20:22:22 +01:00
d5154ee2ae Merge pull request #3886 from wallabag/issue-3602
epub export: fix missing cover image, only for exports of one article
2019-02-25 14:03:41 +01:00
4de99d1ab1 Merge pull request #3887 from wallabag/issue-3711
Add support of expect parameter to change return object when deleting entry
2019-02-25 10:56:07 +01:00
12a97c3522 tests: fix broken session clients for rest entry deletion tests
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-02-20 15:57:56 +01:00
508302042f EntryRestController: add support of expect parameter to delete action
The expect parameter enables an application to request the whole entry
or only the id when requesting its deletion.

`expects` defaults to `entry` to prevent any API breakage.

Fixes #3711

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-02-20 15:57:50 +01:00
9a7a0e1e6b epub export: fix missing cover image, only for exports of one article
Fixes #3602

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-02-18 00:16:05 +01:00
4e0ed3368d tests: create entry for testDeleteEntry, fix missing id
When using the entity manager to retrieve an already stored entry, the
id disapears from $entry after the first delete call. This leads to
testing a nonexistent endpoint (api/entries/.json) during the second
delete call.

This change now creates an entry specifically for the test.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-02-17 15:25:21 +01:00
c01bda038e Allow optional --ignore-root-warning
Now both
./install prod --ignore-root-warning
./install --ignore-root-warning prod

will work

$1 was both used for the environment and the root flag

Fixes wallabag/wallabag#3884
2019-02-14 16:42:57 +05:30
b1992b340e Merge pull request #3882 from wallabag/fix/cors
Fix CORS for API
2019-02-13 15:05:57 +01:00
44560c7767 CS 2019-02-13 14:06:57 +01:00
0182cdaec4 CS 2019-02-11 11:57:52 +01:00
a9f61d3dbb CORS repare for api 2019-02-11 11:57:52 +01:00
47e4784110 Merge pull request #3869 from itsthejb/fix-2factor-email-image
Fix broken 2 factor auth logo image
2019-02-01 12:58:31 +01:00
7e04bd4ca4 Fix broken 2 factor auth logo image 2019-01-31 22:14:53 +01:00
755753e3ef Merge pull request #3819 from stan3/pocket-import
Fix read & starred status in Pocket import
2019-01-28 11:34:37 +01:00
8d082488e9 Improve checks & add tests 2019-01-28 06:03:16 +01:00
a2e60dd393 status and favourite are actually strings in the import so use == 2019-01-27 18:39:26 +01:00
b992522d85 Merge pull request #3861 from wallabag/fix/siteconfig-email
Add dedicated email for site config issue
2019-01-18 13:20:38 +01:00
293730656d Add dedicated email for site config issue
Instead of sending an email to the devs, it now creates an issue on GitHub using a zap from zapier.
2019-01-18 11:15:23 +01:00
6b32cf0c73 Merge pull request #3853 from techexo/patch-2
Update composer.json to add php-tidy (ext-tidy)
2019-01-17 12:09:07 +01:00
1ec44a346b Update composer.json to add php-tidy (ext-tidy)
Should fix https://github.com/wallabag/wallabag/issues/3844 for milestone https://github.com/wallabag/wallabag/milestone/63.
2019-01-16 21:54:38 +01:00
f6b9e883c0 Merge pull request #3841 from wallabag/fix/bad-order-api
Fix bad order parameter in the API
2019-01-14 22:24:40 +01:00
78e3fafa3f Avoid error when a bad order parameter is given
Only allowed parameter are asc & desc
2019-01-14 17:01:21 +01:00
a5e9a98aa3 Come back to stable version
Previous one was used because some PHPUnit version where deleted and tests can't be run anymore.
2019-01-14 17:00:32 +01:00
f083836cc4 Merge pull request #3837 from wallabag/2.3.7-dev
Jump to 2.3.7-dev
2019-01-12 11:19:19 +01:00
314f647238 Jump to 2.3.7-dev 2019-01-11 22:17:48 +01:00
c17d1ab033 Merge pull request #3835 from wallabag/prepare-2.3.6
Prepare 2.3.6 release
2019-01-11 17:12:13 +01:00
3bed2e440e Prepare 2.3.6 release 2019-01-11 14:16:41 +01:00
3625833b2c Merge pull request #3826 from wallabag/epub-toc
Rework of EPUB/PDF exports
2019-01-11 13:34:38 +01:00
03663530ed Merge pull request #3831 from wallabag/fix/api-bad-client-id
Cast client id to avoid PG error
2019-01-10 17:03:03 +01:00
ca990600da Merge pull request #3833 from techexo/patch-1
Fix settings field inverted
2019-01-10 10:02:34 +01:00
bb8ad42b27 Update entries.html.twig
Should fix https://github.com/wallabag/wallabag/issues/3832
2019-01-10 04:25:51 +01:00
d4466a37fe Update entries.html.twig
Should fix https://github.com/wallabag/wallabag/issues/3832
2019-01-10 04:23:08 +01:00
3a2d4cf9fd Cast client id to avoid PG error
If someone send a malformated client_id when trying to authenticate using the API we got a 500 if wallabag use postgres because the request send a string instead of an integer.
2019-01-09 23:31:14 +01:00
5e1f27767b EntriesExport: avoid else on $authors
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-09 16:26:19 +01:00
dac93644e8 EntriesExport: sanitize filename and fix tests
Filename will now only use a-zA-Z0-9-' and space.

Fixes remaining filename issue on #3811

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-08 15:13:35 +01:00
ad5ef8bca0 EntriesExport/pdf: move notice to the end, add metadata cover
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 23:36:41 +01:00
af83d05ce2 Add translations
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 23:06:02 +01:00
4944703edc EntriesExport/epub: add metadata to each entry's cover
Add metadata to the cover of each entry:

- Publishers
- Estimated reading time
- Date of creation ("Added on")
- Address (URL)

Related to #2821

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:44:14 +01:00
f810834623 EntriesExport: change authors and title when not single entry export
Change '{method} authors' (which gives 'Tag_entries authors' when
exporting a tag) to 'Various authors'.

When exporting a tag (tag_entries), change the title from 'Tag_entries
articles' to 'Tag {tag} articles'.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:44:14 +01:00
30cf72bf55 EntriesExport/epub: revert c779373f, move exportinfo to the end of the book
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:43:16 +01:00
edd1825b58 EntriesExport/epub: use sha1 sums for filenames, fix and rename title chapters
This commit renames entry chapters file using a sha1 sum of their title
for simplicity. Also we fix the 'Title' chapter duplicate issue by using
the hash of the related entry and the suffix '_title'.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:41:12 +01:00
063d5e7bda EntriesExport/epub: remove TOC page
This change only remove the rendered page of the TOC at the end of the
book, the TOC remains available to readers.

Fixes #3603

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-07 21:11:05 +01:00
5de17117a1 Merge pull request #3827 from wallabag/epub-quote
EntriesExport/epub: replace epub identifier with unique urn
2019-01-07 11:59:38 +01:00
d2aec7096d Merge pull request #3820 from lizyn/bugfix/incorrect-calculation-of-CJK-characters-in-reading-time-estimation
Fix incorrect reading time calculation for entries with CJK characters
2019-01-07 10:17:29 +01:00
bf22266a62 EntriesExport/epub: replace epub identifier with unique urn
We replace the title used as the unique identifier of the epub file with
a urn following the format:

  urn:wallabag:{sha1("wallabagUrl:listOfEntryIdsSeparatedByComma")}

This format is repeatable: it always gives the same uid for the same
list of entries.

Fixes #3811

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-01-06 23:29:32 +01:00
7f8630b91c Counting two characters together as a word in CJK 2019-01-06 01:21:13 +08:00
35983eb9bb Improve reading time tests 2019-01-04 11:23:33 +01:00
8f5c4b083c Merge pull request #3816 from wallabag/validate-import-entry
Validate imported entry to avoid error on import
2019-01-04 11:06:53 +01:00
9f8f188d92 Validate imported entry to avoid error on import
We got some imports with a missing `url` field generating some errors while trying to retrieve an existing entry with that url.
Introducing the `validateEntry` allow us to dismiss a message when it doesn't have an url (or other missing stuff in the future)
2019-01-03 09:42:06 +01:00
2378fd6347 Merge pull request #3823 from wallabag/fix-tag-api-leak
Fix tag API leak
2019-01-03 09:14:26 +01:00
6c40d7fc85 TagRestController: fix test for tag without entries
As the deletion now requires that at least one entry for the user must
be linked to the given tag, we fix the test testDeleteUserTag by linking
it to an entry.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:49 +01:00
2a0e0a47d8 TagRestController: rewrite delete actions to only retrieve tags related to the user
Fixes #3815

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:49 +01:00
0ee9848231 TagRestController: add tests to ensure that other user's tags are unreachable
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:49 +01:00
6708bf238d TagRepository: refactor query builder for queries by userId
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:44 +01:00
bafb9744c8 fixtures: refactor EntryData, TagData, add a new tag
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-29 19:22:05 +01:00
5becf260fa fix incorrect reading time calculation for entries with CJK characters 2018-12-25 15:31:44 +08:00
4d0c632c70 Merge pull request #3814 from wallabag/2.3.6-dev
Jump to 2.3.6-dev and update release process
2018-12-17 09:34:15 +01:00
4fd5f670fe Jump to 2.3.6-dev and update release process
Fix release archive in `release.sh` and also fix a typo in the release process
2018-12-15 08:14:47 +01:00
45e26a7fc8 Merge pull request #3812 from wallabag/prepare-2.3.5
Prepare 2.3.5 release
2018-12-14 22:53:07 +01:00
a1272ab84d Prepare 2.3.5 release 2018-12-14 20:59:16 +01:00
4840d618c2 Merge pull request #3810 from wallabag/remove-guzzle-site-authenticator-dev
No more dev for guzzle-site-authenticator
2018-12-14 10:46:44 +01:00
ac20dc6155 Merge pull request #3781 from wallabag/yarn-up
build: upgrade yarn dependencies, update prod assets
2018-12-13 22:13:34 +01:00
8bb381e78c No more dev for guzzle-site-authenticator 2018-12-13 22:12:21 +01:00
63fb9d6f07 build: upgrade yarn dependencies, update prod assets
Production assets are rebuilt against new dependency versions.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-10 22:56:20 +01:00
20898d5ef4 Merge pull request #3783 from wallabag/issue-3780
material: decrease size of tags on list view
2018-11-26 18:45:38 +01:00
72efc8ceeb Merge pull request #3782 from wallabag/issue-3779
material: fix missing thumbnail on list view
2018-11-26 18:45:12 +01:00
6f2287da69 Merge pull request #3784 from giuppi/master
Fix Android app login issue
2018-11-26 13:57:16 +01:00
8896f0f988 Merge pull request #3765 from burkemw3/patch-2
Remove preview picture from single entry view page for #1875
2018-11-26 13:51:00 +01:00
bf483b628e Merge pull request #3778 from wallabag/better-release
Jump to 2.3.5-dev and update release process
2018-11-25 22:21:19 +01:00
b34b489cfd Fix Android app login issue
class and alt tags must be in the correct order for the android app to recognize the wallabag server
2018-11-25 16:07:08 +01:00
13d94929ec material: decrease size of tags on list view
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-11-25 15:38:17 +01:00
e5de9917fd material: fix missing thumbnail on list view
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-11-25 15:00:08 +01:00
a03c4d90b2 Jump to 2.3.5-dev and update release process
After the latest release, I update the documentation about it so it’s more clear
2018-11-25 09:43:21 +01:00
038fccd244 Remove preview picture from single entry view page for #1875
Showing the preview picture usually leads to showing a duplicate
image, and frequently leads to showing duplicate images directly
adjacent to each other.
2018-11-24 19:29:58 -05:00
bffe65478d Merge pull request #3775 from wallabag/prepare-2.3.4
Prepare 2.3.4 release
2018-11-24 21:13:03 +01:00
5a4cbf5b70 Create a custom swap to avoid error 2018-11-23 22:11:10 +01:00
ea60d76e60 Use latest bridge to avoid PHPUnit break
Because branch 4.8 & 5.7 have been removed
2018-11-23 22:11:10 +01:00
d470f817ac Use new Travis infra 2018-11-23 22:11:04 +01:00
dc90eab32b Prepare 2.3.4 release 2018-11-23 08:34:13 +01:00
e01b00298a Merge pull request #3774 from Simounet/feature/card-ui
Card no preview replaced by wallabag logo
2018-11-21 20:56:09 +01:00
2daae77094 Card no preview replaced by wallabag logo 2018-11-21 18:51:44 +01:00
59a31ed07f Merge pull request #3772 from techexo/patch-1
Update translation when marking as read
2018-11-16 14:34:41 +01:00
060f3ce34c Update messages.en.yml 2018-11-16 14:16:38 +01:00
ccc3b0a531 Update messages.fr.yml 2018-11-16 01:45:16 +01:00
0ddfb2956c Update messages.fr.yml
Modification pour éclaircir le sens de l'option
2018-11-16 01:37:53 +01:00
b3bcc6aa06 Merge pull request #3769 from burkemw3/patch-4
Add rel=noopener to target=_blank links
2018-11-09 16:08:27 +01:00
a22b8043b4 Add rel=noopener to target=_blank links
From https://developers.google.com/web/tools/lighthouse/audits/noopener:
- new pages will run in separate processes, avoiding any performance
  intermingling impacts
- new pages won't have access to current page's window object via JavaScript
2018-11-07 20:34:54 -05:00
078d54411b Merge pull request #3766 from merwan/patch-1
Fix link to wallabag requirements in documentation
2018-11-06 05:20:28 +00:00
c7e9610b3f Fix link to wallabag requirements in documentation 2018-11-05 10:17:50 +01:00
3a69628007 Merge pull request #3764 from shtrom/fix-matches-notmatches-language
Fix documentation wording for matches/notmatches tagging rules
2018-11-01 12:04:55 +01:00
3f0dd0f0bc fixup! fixup! Fix documentation wording for matches/notmatches tagging rules 2018-11-01 19:40:17 +11:00
da7b8e256f fixup! Fix documentation wording for matches/notmatches tagging rules 2018-11-01 19:26:06 +11:00
0452e869ec Fix documentation wording for matches/notmatches tagging rules
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2018-10-31 19:56:48 +11:00
385dac6d31 Merge pull request #3763 from wallabag/ghpr-template-update
Add note on GitHub PR template to auto-close issues
2018-10-27 06:15:03 +00:00
96823682f9 misc: add note on GitHub PR template to auto-close issues
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-26 23:50:55 +02:00
a6e4e83809 Merge pull request #3553 from wallabag/url-3529
Swap entry url with origin url if graby provides an updated one
2018-10-26 11:31:41 +02:00
1b220426e2 phpcs
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-24 22:33:32 +02:00
6059967951 updateOriginUrl: remove 'query string' case from ignore list
Two urls with a different query string may refer to two different pages
so keep them both.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-24 22:27:27 +02:00
44e63667d9 updateOriginUrl: add comment blocks for the parse_url diff check
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-24 22:13:03 +02:00
5ba5e22a09 updateOriginUrl: rewrite some if, resolving feedbacks from PR
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-24 21:54:09 +02:00
b49c87acf1 ignoreOriginUrl: add initial support of ignore lists
Add the ability to specify hosts and patterns lists to ignore the given
entry url and replace it with the fetched content url without touching
to origin_url.

This initial support should be reworked in the following months to move
the hardcoded ignore lists in the database.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-22 23:42:09 +02:00
fc040c749d updateOriginUrl: add behavior when diff is fragment and query
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-22 23:08:58 +02:00
e07fadea76 Refactor updateOriginUrl to include new behaviors behaviors
- Leave origin_url unchanged if difference is an ending slash
- Leave origin_url unchanged if difference is scheme
- Ignore (noop) if difference is query string or fragment

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-22 23:01:16 +02:00
781864b954 ContentProxy: swap entry url to origin_url and set new url according to graby content
Closes #3529

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-21 16:15:31 +02:00
4a81360efc ContentProxy: fix a corner case when entry.url is empty in updateEntry
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-10-21 16:13:20 +02:00
ae4f7dceec Merge pull request #3733 from Deuchnord/root-abort-update
Abort running install and update script if root
2018-10-17 11:26:12 +02:00
c2bd272cf3 Added argument to ignore the warning. 2018-10-16 20:34:28 +02:00
0658ce4f11 Merge pull request #3745 from burkemw3/patch-3
Add placeholder image to card-based gallery entries page
2018-10-16 07:45:22 +00:00
cefbe6a87f Add placeholder image to card-based gallery entries page for #3651
I referenced https://css-tricks.com/using-svg/ for using the SVG icon.
The icon has a black foreground and white background, which doesn't
look very good as a placeholder. So, using the background-image style
to show the svg and the inversion filter to make it white on gray.

With the image always present, there isn't much difference between
the with and without image preview templates, so I merged them.

Tested on Chrome, Firefox, and Safari on OSX.
2018-10-15 23:59:39 -04:00
fbdc665487 Merge pull request #3606 from mritzmann/master
add manifest.json for android pwa
2018-10-15 08:30:26 +00:00
0ebf595c11 Merge pull request #3706 from shtrom/fix/gnu-make-bash
Makefile fixes for non GNU systems
2018-10-14 20:07:42 +02:00
ba69c04c27 Merge pull request #3743 from burkemw3/patch-1
Show tags on non-image gallery preview card
2018-10-13 12:00:00 +00:00
78ef840eda Merge pull request #3734 from davidmohamedfr/fix-dockerfile-php72
Fix dockerfile php72
2018-10-13 06:30:10 +00:00
d73bfdbddb Show tags on non-image gallery preview card
Tags and images aren't coupled, so they shouldn't be coupled in
the UI, either. This also makes the titles and source domains show
up consistently for image and non-image entry cards.
2018-10-11 19:47:48 -04:00
f5c862640b libpng12-dev was rename as libpng-dev 2018-10-06 14:15:59 +02:00
9e83c3bdf0 remove mcrypt since openssl is included in php 7.2
mcrypt extension doesn't exist anymore
2018-10-06 14:15:01 +02:00
23aa47d828 Abort running install and update script if root (closes #3590) 2018-10-06 12:23:40 +02:00
0f5c15d543 Merge pull request #3725 from Tobi823/master
Bugfix: Sanitize the title of a saved webpage from invalid UTF-8 characters.
2018-09-24 18:34:16 +02:00
28cc645b93 Run php-cs-fixer for fixing coding standard issues (on ContentProxyTest) 2018-09-23 23:42:05 +02:00
83f1c3274f Run php-cs-fixer for fixing coding standard issues 2018-09-23 22:20:43 +02:00
d64139d812 Make helper methods strToHex and hexToStr in ContentProxyTest.php private
to prevent misusage (from outside this class)
2018-09-21 13:31:28 +02:00
7a65c2017b Override the value of the given parameter ($title) with the (hopefully)
correct (to UTF-8) converted PDF title
2018-09-21 13:23:39 +02:00
c01d953292 Add tests for logic
Try to translate the title of a PDF from UTF-8 (then UTF-16BE, then WINDOWS-1252) to UTF-8
2018-09-21 13:15:00 +02:00
f80f16dfc8 Try to detect the character encoding in PDFs and try to translate
the title from the PDF to UTF-8
2018-09-21 13:15:00 +02:00
8648f0c005 Remove type declaration for PHP 5 compatibility 2018-09-21 13:15:00 +02:00
d76a5a6d60 Bugfix: Sanitize the title of a saved webpage from invalid UTF-8 characters 2018-09-21 13:15:00 +02:00
759c91940b Merge pull request #3726 from wallabag/fix-tests
Liberation goes https
2018-09-21 08:16:27 +00:00
84b3bdaac0 Liberation goes https 2018-09-21 09:07:40 +02:00
8013f35d96 Merge pull request #3719 from wallabag/fix-sort-parameters
Fix sort parameters
2018-09-07 17:02:39 +02:00
c0b65ad1c9 Updating node to 6.10
Same as defined in .travis.yml
2018-09-07 15:18:00 +02:00
4408ebd40a Fix tests 2018-09-07 15:18:00 +02:00
8d109df851 Jump to the new Scrutinizer PHP analysis engine 2018-09-07 15:18:00 +02:00
17476f4d8d Add missing parameters
Parameters weren’t passed to the sub function.
2018-09-07 13:56:14 +02:00
495f83c925 Merge pull request #3712 from wallabag/refactor-entry-queries
Rename getBuilderByUser and refactor query for untagged entries
2018-09-07 11:43:07 +00:00
eb5e3f1d1d Merge pull request #3717 from wallabag/php-72
PHP 7.2 shouldn't fail
2018-09-06 11:28:57 +02:00
04f85fd9a8 PHP 7.2 shouldn't fail 2018-09-06 07:58:26 +02:00
b8115ff46b php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
0636697289 EntryRepository: refactor getBuilderForUntaggedByUser
Improve SQL performance by replacing size(e.tags) with a left join and a
null condition

Move the QueryBuilder logic into getRawBuilderForUntaggedByUser

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
b7c5fda512 EntryRepository: refactor getBuilderByUser
We refactor getBuilderByUser to separate QueryBuilder getter and the
orderBy(). The previous code of getBuilderByUser() has been moved to
getSortedQueryBuilderByUser(). getBuildByUser() now returns a
QueryBuilder without the call to orderBy().

A new method named sortQueryBuilder() returns a given QueryBuilder with
an orderBy() call using given sort parameters.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
69b563948d AnnotationRepository: rename getBuilderByUser
We rename getBuilderByUser to getSortedQueryBuilderByUser as long as the
method currently returns a QueryBuilder with an orderBy()

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 18:44:08 +02:00
ada5d5b269 Merge pull request #3716 from wallabag/csfixer
php-cs-fixer: native_function_invocation
2018-09-05 16:38:20 +00:00
2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
685a5d745e Merge pull request #3707 from wallabag/fix-test-de-at
Removing failing test from Travis
2018-08-19 18:15:11 +02:00
72efc80fdc Removing failing test from Travis 2018-08-19 16:38:48 +02:00
fea06d19f3 Merge pull request #3705 from wallabag/update-release
Update release script
2018-08-19 09:17:40 +02:00
681e04b060 Makefile fixes for non GNU systems
* Move `Makefile` to `GNUmakefile`, which GNU `make` picks first
* Add `Makefile` so other `make`s forward to `gmake`
* Set the `SHELL` variable and let `make` handle the shell

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2018-08-18 18:50:18 +10:00
2bf568ff46 Update release script 2018-08-17 14:40:06 +02:00
1421236800 Merge pull request #3702 from aleksandar-todorovic/patch-1
Fixes a typo
2018-08-16 14:45:23 +02:00
e0a9791412 Fixes another typo 2018-08-10 20:28:48 +02:00
7fd4ad6564 Fixes a typo 2018-08-10 20:15:46 +02:00
d29b18e82e Merge pull request #3690 from Simounet/fix/srcset-attribute
More robust srcset image attribute handling
2018-07-23 16:24:20 +00:00
e6f12c0734 More robust srcset image attribute handling
Linked to HTMLawed PR https://github.com/kesar/HTMLawed/pull/17
2018-07-12 14:29:30 +02:00
0f36a88e16 Merge pull request #3692 from Simounet/feature/svg-logo
Feature/svg logo
2018-07-12 11:31:30 +00:00
e93f37206a wallabag logo (side-nav) replaced by an SVG one 2018-07-11 21:57:53 +02:00
4c78612eb4 wallabag logo with typo replaced by an SVG one 2018-07-11 21:51:52 +02:00
2fdd512488 Fake wallabag logo data image replaced by real SVG 2018-07-11 21:25:46 +02:00
9b12f822e1 Merge pull request #3691 from Simounet/feature/login-username-autofocus
Autofocus the username field on the login page
2018-07-11 18:49:38 +00:00
d02e6850c2 Autofocus the username field on the login page 2018-07-11 20:10:51 +02:00
6337b46e80 Merge pull request #3678 from anmol26s/patch-1
Propose YunoHost badge for installing
2018-07-06 05:40:03 +00:00
9216bab8c9 Merge pull request #3683 from Simounet/fix/iframe-video-width-shared
Fix mobile viewport on big iframe and video elements
2018-07-06 05:38:39 +00:00
9bc086071a Merge pull request #3686 from wallabag/remove-trusted-proxies
Remove remaining deprecation notices
2018-07-06 05:38:02 +00:00
80336f77fd The 'framework.trusted_proxies' configuration key has been deprecated in Symfony 3.3 2018-07-05 21:01:45 +02:00
200392b462 Merge pull request #3685 from wallabag/fix-random-failing-test
Replace SO url by lemonde.fr to avoid random failing test
2018-07-05 13:37:28 +00:00
9c48053b14 Replace SO url by lemonde
Looks like we got a lot of random failing while grabing SO content, replacing it might fix the problem.
2018-07-05 14:50:27 +02:00
18167b9a24 Merge pull request #3684 from Simounet/fix/empty-image-download-error
Fix image downloading on null image path
2018-07-05 12:15:50 +00:00
3fbbe0d9f1 Fix image downloading on null image path 2018-07-05 11:40:51 +02:00
6cf7f21dcb Fix mobile viewport on big iframe and video elements 2018-06-28 15:22:51 +02:00
8d09f57c0d Propose YunoHost badge for installing
The YunoHost have working Wallabag package with working install,remove,update,backup and restore scripts. YunoHost makes self -hosting easy for the end users. Please add the this badge so that people can find this solution.
2018-06-22 02:43:43 +05:30
e586d65b64 Merge pull request #3675 from wallabag/prepare-2.3.3
Prepare 2.3.3 release
2018-06-19 07:44:48 +00:00
7ddba67745 Prepare 2.3.3 release 2018-06-19 06:50:13 +02:00
7ebd4bdcf7 Merge pull request #3538 from wallabag/fix-migrations-dash
Fixed migrations with dash into db names
2018-06-15 05:25:44 +00:00
49b4c87598 We should able to get the table name unescaped
When we want to perform complex queries to retrieve metadata from the database
2018-06-14 14:15:07 +02:00
bfe7a69226 Fixed migrations with dash into db name 2018-06-14 13:43:09 +02:00
36054f5dd4 Merge pull request #3636 from flozz/syntax-highlight
Highlight code in articles using highlight.js
2018-06-07 06:22:14 +00:00
c00a691019 Merge pull request #3668 from wallabag/fix-tests
Fix tests
2018-06-07 06:21:06 +00:00
778543311f Fix tests 2018-06-06 17:34:20 +02:00
a550a64c84 Merge pull request #3614 from comradekingu/patch-3
Spelling: GitHub, Log out, of the dev
2018-06-06 14:26:40 +00:00
def73759ae Merge pull request #3664 from Simounet/fix/entry-attributes-encoding
Fix authors and preview alt encoding display
2018-06-05 04:33:37 +00:00
03f2cacb58 Fix authors and preview alt encoding display 2018-06-04 12:04:37 +02:00
fea68d1a72 Merge pull request #3646 from Quenty31/master
[i18n] Occitan update
2018-06-01 14:53:49 +02:00
8fe73e076c Merge pull request #3661 from Simounet/fix/2981-srcset-image
Fix srcset attribute on images downloaded
2018-06-01 14:53:04 +02:00
c15bb5ad72 Fix srcset attribute on images downloaded 2018-06-01 13:49:16 +02:00
9707ac4661 Merge pull request #3653 from Simounet/fix/firefox-mobile-unneeded-resize
Fix/firefox mobile unneeded resize
2018-05-24 21:36:51 +02:00
53ec80be94 Fix missing generated CSS 2018-05-24 11:57:22 +02:00
f136d288d6 Fix Firefox mobile unneeded resize
Before that, on Firefox Mobile, when you were moving to the top or to
the bottom of the page, you were stopped before to go to the opposite
side.
2018-05-24 09:04:02 +02:00
1d770f9867 Merge pull request #3652 from Simounet/fix/overflow-wrap
Fix overflow wrap issue
2018-05-24 07:16:36 +02:00
a6e5637507 Fix overflow wrap issue 2018-05-21 19:47:28 +02:00
65f499b4ac Update wallabag_user.oc.yml 2018-05-06 12:36:55 +02:00
4745ca3fde Update CraueConfigBundle.oc.yml 2018-05-05 21:16:20 +02:00
7c3184376c Update wallabag_user.oc.yml
Mens dialectal, mai estandard
2018-05-05 21:15:01 +02:00
609adaca9b Update messages.oc.yml 2018-05-05 21:13:55 +02:00
9562a8aca8 Update CraueConfigBundle.oc.yml 2018-05-05 21:09:00 +02:00
b2e7b8b600 Highlight code in articles using highlight.js 2018-04-23 19:11:24 +02:00
11f15430ff Merge pull request #3615 from notFloran/3612-login-by-email
Allow login by email
2018-04-03 22:08:42 +02:00
a0f126b973 Merge pull request #3616 from notFloran/3404-bookmarklet-encoding
Better encoding of the URI for the bookmarklet
2018-04-03 22:07:52 +02:00
08d6bedcaa Allow login by email 2018-04-01 20:57:10 +02:00
8e5b91180e Better encoding of the URI for the bookmarklet 2018-04-01 20:55:45 +02:00
3b46d0f947 Merge pull request #3619 from notFloran/fix-tests
Fix tests
2018-04-01 11:12:32 +02:00
80d4260a8e Fix CS in UtilsTest.php 2018-03-31 12:55:27 +02:00
739a4024fa Replace zataz url 2018-03-30 23:09:03 +02:00
3be96dcb17 Use https instead of http for bild.de to fix tests 2018-03-29 22:58:40 +02:00
f400aa1281 GitHub, Log out, of the dev 2018-03-25 04:31:22 +02:00
ed148f6685 add 512x512 appicon 2018-03-20 08:43:46 +01:00
10f31ac572 change href link for manifest.json 2018-03-19 08:32:33 +01:00
35ce4d5e5f add manifest.json for android pwa 2018-03-18 19:58:34 +01:00
727880c950 Merge pull request #3597 from wallabag/fix-tests
Fix tests
2018-03-17 13:28:10 +01:00
2ff26deaf8 Merge pull request #3592 from Simounet/fix/html-entities-on-default-title
Fix title card HTML parsing
2018-02-24 22:24:24 +01:00
ad77c3451f Looked UserBundle again.
See https://github.com/FriendsOfSymfony/FOSUserBundle/compare/v2.0.2...v2.1.0#diff-8a79d0e62995dd549be4e463c35a8cc3

It generate an error about a variable called `registration_enabled` which can not be found.
So I guess we are in the case of “such usage” about BC in UserBundle. Don’t want to loose time finding how to fix it. Rollback to the working version.
2018-02-24 22:12:48 +01:00
bf283db8e6 20 Minutes is now https 2018-02-24 22:02:52 +01:00
228d317204 Merge pull request #3573 from shulard/fix/unknown-withremove-variable
Fix error when withRemove variable is not defined.
2018-02-24 21:52:56 +01:00
4d9128ded9 Fix title card HTML parsing 2018-02-12 22:19:15 +01:00
cc09434ea4 Fix error when withRemove variable is not defined.
Since the withRemove variable is a template flag, it can be undefined.

In the Entry\Card\_content.html.twig template for example, the withRemove variable is not defined.
2018-01-23 18:51:52 +01:00
f24e9bfab0 Merge pull request #3568 from wallabag/prepare-2.3.2
Prepare 2.3.2 release
2018-01-22 11:10:12 +01:00
ac1811f83e Prepare 2.3.2 release 2018-01-22 10:06:31 +01:00
fd637b9a5a Merge pull request #3541 from Simounet/feature/nav-label-replaced-by-buttons
Nav actions updated
2018-01-12 23:10:21 +01:00
5614df19cf Fixed tests 2018-01-12 11:19:11 +01:00
91f5992423 Close add entry and search nav JS action improved 2018-01-12 10:07:46 +01:00
2831e77cce Nav close button alignment and nav boxes improved 2018-01-12 10:07:46 +01:00
63771b9ae3 Fix nav new entry and search form alignment 2018-01-12 10:07:46 +01:00
f86c2b5fa6 Label replaced by a button on the nav search form 2018-01-12 10:07:46 +01:00
e9e3f93805 Label replaced by a button on the nav new entry form 2018-01-12 10:07:46 +01:00
99e8c2785b Merge pull request #3546 from Strubbl/fix-2957-abort-update-on-error
add `set -eu` to update.sh
2018-01-03 21:00:43 +01:00
410216f435 Merge pull request #3536 from wallabag/tag-link-3534
Fix broken link to remove tags from entries
2018-01-03 20:37:57 +01:00
f3e71b5dd5 add set -eu to update.sh
fixes #2957
2018-01-03 05:34:29 +01:00
b8568662bd php-cs
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-31 13:19:26 +01:00
e0a862b626 Add test to prevent regression for #3534
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-31 00:56:40 +01:00
2679eb9d84 Merge pull request #3539 from wallabag/wallabag/new-client-button
Replaced Create new client link with a button
2017-12-28 11:12:06 +01:00
8fa6d62197 Replaced Create new client link with a button 2017-12-28 10:21:28 +01:00
8e15ece7df Fix broken link to remove tags from entries
Fixes #3534

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-27 22:53:03 +01:00
3473e600b1 Merge pull request #3525 from Simounet/fix/empty-card-title-link
Fix empty card title link
2017-12-26 16:00:58 +01:00
c04bde29a3 Added default value for title on entry view 2017-12-26 15:40:38 +01:00
11ed735c09 Merge pull request #3532 from wallabag/prepare-231
Prepared wallabag 2.3.1
2017-12-26 10:13:11 +01:00
f83e9e32fc Prepared wallabag 2.3.1 2017-12-26 09:15:39 +01:00
8ffcee8aff Updated baggy theme for the no-title fix 2017-12-26 09:07:28 +01:00
5e0c44a2ac Using new 'entry.default_title' as translation key 2017-12-26 09:02:00 +01:00
49fb9e7cab Card tags template shared 2017-12-26 09:02:00 +01:00
a8541089be Useless span removed from the card's title 2017-12-26 09:00:33 +01:00
ac8489f5f7 Default card title 2017-12-26 08:55:23 +01:00
3c9548257c Content card template shared 2017-12-26 08:55:23 +01:00
726e2cf3c6 Merge pull request #3524 from wallabag/fix-assets-sub
Fix assets for subfolder install
2017-12-26 08:49:59 +01:00
0d9c8081fe cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-20 22:18:26 +01:00
575d1d03d9 Update prod assets
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-20 21:55:34 +01:00
e8694faad6 Remove fixed relative path for assets 2017-12-20 21:53:48 +01:00
887073dedc Merge pull request #3521 from wallabag/mruminski-patch-1
Update messages.pl.yml
2017-12-19 10:02:52 +01:00
a9d274424f Update messages.pl.yml
add polish translation for 'provided by' and 'origin url'
2017-12-18 21:01:22 +01:00
ef5c8a7d01 Merge pull request #3515 from wallabag/php-7.2
Add PHP 7.2 compatibility
2017-12-18 14:32:21 +01:00
01ea7f5855 Merge pull request #3348 from pmichelazzo/master
Update PT translations
2017-12-18 13:34:01 +01:00
ad880894a8 Update CHANGELOG 2017-12-18 13:30:03 +01:00
acc0a80179 Add missing assertion in tests 2017-12-18 13:29:34 +01:00
5661e8d42a Fix countable in tests 2017-12-18 13:29:34 +01:00
7185fbff62 Update dama/doctrine-test-bundle
Because:

PHP Fatal error:  Class 'PHPUnit_Framework_BaseTestListener' not found in /home/travis/build/wallabag/wallabag/vendor/dama/doctrine-test-bundle/src/DAMA/DoctrineTestBundle/PHPUnit/LegacyPHPUnitListener.php on line 7
2017-12-18 13:29:34 +01:00
4b6942d2d8 Add missing TestCase namespace 2017-12-18 13:29:33 +01:00
26e2f07419 Fix typo 2017-12-18 13:29:33 +01:00
eb3754509d Add missing parameter for test 2017-12-18 13:29:33 +01:00
bd91bd5c32 Use namespaced PHPUnit classes 2017-12-18 13:29:33 +01:00
3ccf086391 Merge pull request #3516 from wallabag/delete-id
api: copy entry object before sending, to keep id
2017-12-18 12:33:05 +01:00
9e89bf7aca Removed duplicated line 2017-12-17 21:20:23 +01:00
f5ea67e4cf api: copy entry object before sending, to keep id
Workaround for https://github.com/wallabag/android-app/issues/646

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-17 21:07:46 +01:00
a5849ac956 Update PT translations 2017-12-17 10:57:17 +01:00
d1f260e2d7 Merge pull request #3504 from aaa2000/fix-initial-migration-with-table-prefix
Fix initial migration when using custom table prefix
2017-12-16 22:24:06 +01:00
ccb52fb461 Use getTable() to retrieve prefixed table name 2017-12-16 22:08:00 +01:00
d1224bf9f6 Merge pull request #3513 from wallabag/icons-3437
material: replace exit_to_app, redo and autorenew icons
2017-12-16 21:35:32 +01:00
b10be65ec7 Merge pull request #3511 from wallabag/install-command-note
command: replace note regarding server:run --env=prod
2017-12-16 20:16:13 +01:00
65d885da00 material: replace exit_to_app, redo and autorenew icons
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-16 20:07:11 +01:00
f565e10817 command: replace note regarding server:run --env=prod
server:run --env=prod does not exist anymore
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-16 19:14:25 +01:00
64e7c90ae9 Merge pull request #3507 from wallabag/fix-lowercase-migration
Fixed lower case tags migration
2017-12-16 09:02:56 +01:00
9b606725fe Merge pull request #3510 from wallabag/update-robotstxt
Updated robots.txt to prevent crawling
2017-12-16 09:02:40 +01:00
e4ae6b976f Updated robots.txt to prevent crawling 2017-12-15 21:51:12 +01:00
caf719f163 Fixed lower case tags migration 2017-12-15 13:59:02 +01:00
f1f2cf2bce Fix initial migration when using custom table prefix
Fix #3503
2017-12-14 19:14:10 +01:00
a68a80f654 Merge pull request #3442 from wallabag/empty-entry
Fix empty title and domain_name when exception is thrown during fetch
2017-12-14 11:19:44 +01:00
b457d7bd32 Update CHANGELOG
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-13 22:52:30 +01:00
300f293cb1 Add test on EntryControllerTest for #3442
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-13 22:44:31 +01:00
af29e1bf07 Fix empty title and domain_name when exception is thrown during fetch
Add a new helper to set a default title when it's empty:
1/ use basename part of entry's path, if any
2/ or use domain name

Fixes #2053

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-13 22:44:31 +01:00
70265817ae Merge pull request #3488 from wallabag/pg-10
Add custom driver & schema manager for PostgreSQL 10
2017-12-13 13:50:15 +01:00
08d6497c9c Merge pull request #3495 from wallabag/wallabag/remove-make-run-readme
Removed "make run" in the README
2017-12-13 12:06:38 +01:00
cef72d87a6 Removed "make run" in the README 2017-12-12 20:52:05 +01:00
d80e9931f5 Merge pull request #3492 from bdunogier/fix-3484-disable_share_link
Fix 3484: hide the share toggle button if no service is enabled
2017-12-12 20:24:36 +01:00
71318d6103 Merge pull request #3490 from wallabag/fix-rss-unread-icon
Displayed the RSS icon on homepage route
2017-12-12 20:20:52 +01:00
1f198256ed Merge pull request #3487 from wallabag/initial-migration
Change the way to check for initial migration
2017-12-12 20:20:31 +01:00
0ef1ffbf71 Fix #3484: hide the share toggle button if no service is enabled 2017-12-12 18:36:24 +01:00
629f913b8d Displayed the RSS icon on homepage route 2017-12-12 15:42:49 +01:00
3fadf42a1c CS 2017-12-12 14:30:22 +01:00
ad46f2fb46 Use hasTable instead of try/catch 2017-12-12 13:41:44 +01:00
2e9747a59a Fix tests 2017-12-12 13:34:06 +01:00
a1661af17c Add custom driver & schema manager for PostgreSQL 10 2017-12-12 12:14:40 +01:00
43e1711eb6 Change the way to check for initial migration 2017-12-12 11:17:16 +01:00
f209798368 Merge pull request #3481 from wallabag/fix-make-run
Replaced env by dev for make run
2017-12-12 09:50:33 +01:00
60f53cf46f Replaced env by dev for make run
The symfony server:run command can only be used in dev environment
2017-12-12 08:55:18 +01:00
cabadf169b Merge pull request #3478 from odolbeau/patch-1
Update README.md
2017-12-12 07:42:53 +01:00
63e6ee1293 Update README.md
Be ready for next year!
2017-12-11 22:32:39 +00:00
251 changed files with 13731 additions and 3571 deletions

View File

@ -8,9 +8,15 @@
| Documentation | yes/no
| Translation | yes/no
| CHANGELOG.md | yes/no
| Fixed tickets | #...
| License | MIT
<!--
Please list the issues your PR fixes using special keywords, see
https://help.github.com/articles/closing-issues-using-keywords/
Fixes #…
-->
<!--
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.

View File

@ -26,3 +26,18 @@ tools:
checks:
php:
code_rating: true
# use the new PHP analysis engine
# https://scrutinizer-ci.com/docs/tools/php/php-analyzer/guides/migrate_to_new_php_analysis
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
dependencies:
override:
- npm install -g 'yarn'
- yarn install --force
- COMPOSER_MEMORY_LIMIT=-1 composer install -o --no-interaction --no-progress --prefer-dist

View File

@ -1,17 +1,14 @@
language: php
services:
- rabbitmq
- redis
# faster builds on docker-container setup
sudo: false
- rabbitmq
- redis
# used for HHVM
addons:
apt:
packages:
- tidy
apt:
packages:
- tidy
# cache vendor dirs
cache:
@ -44,7 +41,6 @@ matrix:
- php: 7.0
env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite
allow_failures:
- php: 7.2
- php: nightly
# exclude v1 branches
@ -52,6 +48,14 @@ branches:
except:
- legacy
before_install:
- if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
install:
- if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.10; fi;
- if [[ $ASSETS = build ]]; then npm install -g yarn@latest; fi;
- if [[ $ASSETS = build ]]; then yarn install; fi;
before_script:
- PHP=$TRAVIS_PHP_VERSION
- if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
@ -59,17 +63,17 @@ before_script:
- if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
- composer self-update --no-progress
- if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
install:
- if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.10; fi;
- if [[ $ASSETS = build ]]; then npm install -g yarn@latest; fi;
- if [[ $ASSETS = build ]]; then yarn install; fi;
before_install:
- if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
# increase swap to avoid "proc_open(): fork failed - Cannot allocate memory"
# this should be removed when no more PHP 5 build will be defined
- sudo swapon -s
- sudo fallocate -l 4G /swapfile
- sudo chmod 600 /swapfile
- sudo mkswap /swapfile
- sudo swapon /swapfile
- sudo swapon -s
script:
- travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
- travis_wait bash composer update -o --no-interaction --no-progress --prefer-dist
- echo "travis_fold:start:prepare"
- make prepare DB=$DB
- echo "travis_fold:end:prepare"

View File

@ -1,6 +1,147 @@
# Changelog
## [2.3.0](https://github.com/wallabag/wallabag/tree/2.3.0) (2017-10-21)
## [2.3.7](https://github.com/wallabag/wallabag/tree/2.3.7)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.6...2.3.7)
### Fixes
- Jump to 2.3.7-dev [#3837](https://github.com/wallabag/wallabag/pull/3837)
- Fix bad order parameter in the API [#3841](https://github.com/wallabag/wallabag/pull/3841)
- Update composer.json to add php-tidy (ext-tidy) [#3853](https://github.com/wallabag/wallabag/pull/3853)
- Add dedicated email for site config issue [#3861](https://github.com/wallabag/wallabag/pull/3861)
- Fix read & starred status in Pocket import [#3819](https://github.com/wallabag/wallabag/pull/3819)
- Fix broken 2 factor auth logo image [#3869](https://github.com/wallabag/wallabag/pull/3869)
- Fix CORS for API [#3882](https://github.com/wallabag/wallabag/pull/3882)
- Add support of expect parameter to change return object when deleting entry [#3887](https://github.com/wallabag/wallabag/pull/3887)
- epub export: fix missing cover image, only for exports of one article [#3886](https://github.com/wallabag/wallabag/pull/3886)
- Allow optional --ignore-root-warning [#3885](https://github.com/wallabag/wallabag/pull/3885)
- material: fix left padding of content on medium screens [#3893](https://github.com/wallabag/wallabag/pull/3893)
- material: hide creation date from card actions on specific sizes [#3894](https://github.com/wallabag/wallabag/pull/3894)
## [2.3.6](https://github.com/wallabag/wallabag/tree/2.3.6)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.5...2.3.6)
### Fixes
- Jump to 2.3.6-dev and update release process [#3814](https://github.com/wallabag/wallabag/pull/3814)
- Fix tag API leak [#3823](https://github.com/wallabag/wallabag/pull/3823)
- Validate imported entry to avoid error on import [#3816](https://github.com/wallabag/wallabag/pull/3816)
- Fix incorrect reading time calculation for entries with CJK characters [#3820](https://github.com/wallabag/wallabag/pull/3820)
- EntriesExport/epub: replace epub identifier with unique urn [#3827](https://github.com/wallabag/wallabag/pull/3827)
- Fix settings field inverted [#3833](https://github.com/wallabag/wallabag/pull/3833)
- Cast client id to avoid PG error [#3831](https://github.com/wallabag/wallabag/pull/3831)
- Rework of EPUB/PDF exports [#3826](https://github.com/wallabag/wallabag/pull/3826)
## [2.3.5](https://github.com/wallabag/wallabag/tree/2.3.5)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.4...2.3.5)
### Fixes
- Jump to 2.3.5-dev and update release process [#3778](https://github.com/wallabag/wallabag/pull/3778)
- Remove preview picture from single entry view page [#3765](https://github.com/wallabag/wallabag/pull/3765)
- Fix Android app login issue [#3784](https://github.com/wallabag/wallabag/pull/3784)
- material: fix missing thumbnail on list view [#3782](https://github.com/wallabag/wallabag/pull/3782)
- material: decrease size of tags on list view [#3783](https://github.com/wallabag/wallabag/pull/3783)
- build: upgrade yarn dependencies, update prod assets [#3781](https://github.com/wallabag/wallabag/pull/3781)
- No more dev for guzzle-site-authenticator [#3810](https://github.com/wallabag/wallabag/pull/3810)
## [2.3.4](https://github.com/wallabag/wallabag/tree/2.3.4)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.3...2.3.4)
### Fixes
- Fix image downloading on null image path [#3684](https://github.com/wallabag/wallabag/pull/3684)
- Remove remaining deprecation notices [#3686](https://github.com/wallabag/wallabag/pull/3686)
- Fix mobile viewport on big iframe and video elements [#3683](https://github.com/wallabag/wallabag/pull/3683)
- Autofocus the username field on the login page [#3691](https://github.com/wallabag/wallabag/pull/3691)
- Feature/svg logo [#3692](https://github.com/wallabag/wallabag/pull/3692)
- Fixes a typo [#3702](https://github.com/wallabag/wallabag/pull/3702)
- Update release script [#3705](https://github.com/wallabag/wallabag/pull/3705)
- Removing failing test from Travis [#3707](https://github.com/wallabag/wallabag/pull/3707)
- Replace SO url by lemonde.fr to avoid random failing test [#3685](https://github.com/wallabag/wallabag/pull/3685)
- php-cs-fixer: native_function_invocation [#3716](https://github.com/wallabag/wallabag/pull/3716)
- PHP 7.2 shouldn't fail [#3717](https://github.com/wallabag/wallabag/pull/3717)
- Liberation goes https [#3726](https://github.com/wallabag/wallabag/pull/3726)
- Bugfix: Sanitize the title of a saved webpage from invalid UTF-8 characters. [#3725](https://github.com/wallabag/wallabag/pull/3725)
- Fix dockerfile php72 [#3734](https://github.com/wallabag/wallabag/pull/3734)
- Fix sort parameters [#3719](https://github.com/wallabag/wallabag/pull/3719)
- Add note on GitHub PR template to auto-close issues [#3763](https://github.com/wallabag/wallabag/pull/3763)
- Fix link to wallabag requirements in documentation [#3766](https://github.com/wallabag/wallabag/pull/3766)
- Update translation when marking as read [#3772](https://github.com/wallabag/wallabag/pull/3772)
- Makefile fixes for non GNU systems [#3706](https://github.com/wallabag/wallabag/pull/3706)
- Card no preview replaced by wallabag logo [#3774](https://github.com/wallabag/wallabag/pull/3774)
### Changes
- Propose YunoHost badge for installing [#3678](https://github.com/wallabag/wallabag/pull/3678)
- More robust srcset image attribute handling [#3690](https://github.com/wallabag/wallabag/pull/3690)
- Rename getBuilderByUser and refactor query for untagged entries [#3712](https://github.com/wallabag/wallabag/pull/3712)
- Show tags on non-image gallery preview card [#3743](https://github.com/wallabag/wallabag/pull/3743)
- add manifest.json for android pwa [#3606](https://github.com/wallabag/wallabag/pull/3606)
- Add placeholder image to card-based gallery entries page [#3745](https://github.com/wallabag/wallabag/pull/3745)
- Abort running install and update script if root [#3733](https://github.com/wallabag/wallabag/pull/3733)
- Swap entry url with origin url if graby provides an updated one [#3553](https://github.com/wallabag/wallabag/pull/3553)
## [2.3.3](https://github.com/wallabag/wallabag/tree/2.3.3)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.2...2.3.3)
### Fixes
- Fix error when withRemove variable is not defined. [#3573](https://github.com/wallabag/wallabag/pull/3573)
- Fix title card HTML parsing [#3592](https://github.com/wallabag/wallabag/pull/3592)
- Fix tests [#3597](https://github.com/wallabag/wallabag/pull/3597)
- Fix tests [#3619](https://github.com/wallabag/wallabag/pull/3619)
- Better encoding of the URI for the bookmarklet [#3616](https://github.com/wallabag/wallabag/pull/3616)
- Fix overflow wrap issue [#3652](https://github.com/wallabag/wallabag/pull/3652)
- Fix/firefox mobile unneeded resize [#3653](https://github.com/wallabag/wallabag/pull/3653)
- Fix srcset attribute on images downloaded [#3661](https://github.com/wallabag/wallabag/pull/3661)
- Fix authors and preview alt encoding display [#3664](https://github.com/wallabag/wallabag/pull/3664)
- Spelling: GitHub, Log out, of the dev [#3614](https://github.com/wallabag/wallabag/pull/3614)
- Fix tests [#3668](https://github.com/wallabag/wallabag/pull/3668)
- Fixed migrations with dash into db names [#3538](https://github.com/wallabag/wallabag/pull/3538)
### Changes
- Allow login by email [#3615](https://github.com/wallabag/wallabag/pull/3615)
- Occitan update [#3646](https://github.com/wallabag/wallabag/pull/3646)
- Highlight code in articles using highlight.js [#3636](https://github.com/wallabag/wallabag/pull/3636)
## [2.3.2](https://github.com/wallabag/wallabag/tree/2.3.2)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.1...2.3.2)
### Fixes
- Add `set -eu` to update.sh [#3546](https://github.com/wallabag/wallabag/pull/3546)
- Fix broken link to remove tags from entries [#3536](https://github.com/wallabag/wallabag/pull/3536)
### Changes
- Nav actions updated [#3541](https://github.com/wallabag/wallabag/pull/3541)
- Replaced Create new client link with a button [#3539](https://github.com/wallabag/wallabag/pull/3539)
## [2.3.1](https://github.com/wallabag/wallabag/tree/2.3.1)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.0...2.3.1)
### Fixes
- Changed the way to check for initial migration [#3487](https://github.com/wallabag/wallabag/pull/3487)
- Displayed the RSS icon on homepage route [#3490](https://github.com/wallabag/wallabag/pull/3490)
- Hided the share toggle button if no service is enabled [#3492](https://github.com/wallabag/wallabag/pull/3492)
- Updated robots.txt to prevent crawling [#3510](https://github.com/wallabag/wallabag/pull/3510)
- Fixed lower case tags migration [#3507](https://github.com/wallabag/wallabag/pull/3507)
- Fixed initial migration when using custom table prefix [#3504](https://github.com/wallabag/wallabag/pull/3504)
- Fixed assets for subfolder install [#3524](https://github.com/wallabag/wallabag/pull/3524)
- Fixed empty card title link [#3525](https://github.com/wallabag/wallabag/pull/3525)
- Fixed empty title and domain_name when exception is thrown during fetch [#3442](https://github.com/wallabag/wallabag/pull/3442)
- API: copied entry object before sending, to keep id [#3516](https://github.com/wallabag/wallabag/pull/3516)
### Changes
- Added custom driver & schema manager for PostgreSQL 10 [#3488](https://github.com/wallabag/wallabag/pull/3488)
- Replaced exit_to_app, redo and autorenew icons [#3513](https://github.com/wallabag/wallabag/pull/3513)
- Added PHP 7.2 compatibility [#3515](https://github.com/wallabag/wallabag/pull/3515)
## [2.3.0](https://github.com/wallabag/wallabag/tree/2.3.0) (2017-12-11)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.2.3...2.3.0)
### API
@ -32,7 +173,7 @@
### Features
- Share articles to Scuttle (https://github.com/scronide/scuttle) instance [#2999](https://github.com/wallabag/wallabag/pull/2999)
- Allow to remove all archived entries [#3020](https://github.com/wallabag/wallabag/pull/3020)
- Allow to remove all archived entries [#3020](https://github.com/wallabag/wallabag/pull/3020)
- Added publication date and author [#3024](https://github.com/wallabag/wallabag/pull/3024)
- Added `notmatches` operator for automatic tagging rule [#3047](https://github.com/wallabag/wallabag/pull/3047)
- Search & paginate users [#3060](https://github.com/wallabag/wallabag/pull/3060)
@ -55,7 +196,7 @@
- Changed default value for list mode (grid instead of list) [#3014](https://github.com/wallabag/wallabag/pull/3014)
- Remove `isPublic` from Entry entity [#3030](https://github.com/wallabag/wallabag/pull/3030)
- Use username to import [#3080](https://github.com/wallabag/wallabag/pull/3080)
- Adds Webpack support and remove Grunt [#3022](https://github.com/wallabag/wallabag/pull/3022)
- Adds Webpack support and remove Grunt [#3022](https://github.com/wallabag/wallabag/pull/3022)
- Improved Guzzle subscribers extensibility [#2751](https://github.com/wallabag/wallabag/pull/2751)
- Added logger when we match Tagging rules [#3110](https://github.com/wallabag/wallabag/pull/3110)
- unify Download/Export wording. [#3130](https://github.com/wallabag/wallabag/pull/3130)

53
GNUmakefile Executable file
View File

@ -0,0 +1,53 @@
SHELL=bash
TMP_FOLDER=/tmp
RELEASE_FOLDER=wllbg-release
ENV ?= prod
help: ## Display this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Clear the application cache
rm -rf var/cache/*
install: ## Install wallabag with the latest version
@./scripts/install.sh $(ENV)
update: ## Update the wallabag installation to the latest version
@./scripts/update.sh $(ENV)
dev: ## Install the latest dev version
@./scripts/dev.sh
run: ## Run the wallabag built-in server
@php bin/console server:run --env=dev
build: ## Run webpack
@npm run build:$(ENV)
prepare: clean ## Prepare database for testsuite
ifdef DB
cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
endif
-php bin/console doctrine:database:drop --force --env=test
php bin/console doctrine:database:create --env=test
php bin/console doctrine:migrations:migrate --no-interaction --env=test
fixtures: ## Load fixtures into database
php bin/console doctrine:fixtures:load --no-interaction --env=test
test: prepare fixtures ## Launch wallabag testsuite
bin/simple-phpunit -v
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION
$(error VERSION is not set)
endif
@./scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
deploy: ## Deploy wallabag
@bundle exec cap staging deploy
.PHONY: help clean prepare install fixtures update build test release deploy run dev
.DEFAULT_GOAL := install

54
Makefile Executable file → Normal file
View File

@ -1,52 +1,2 @@
TMP_FOLDER=/tmp
RELEASE_FOLDER=wllbg-release
ENV ?= prod
help: ## Display this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Clear the application cache
rm -rf var/cache/*
install: ## Install wallabag with the latest version
@sh scripts/install.sh $(ENV)
update: ## Update the wallabag installation to the latest version
@sh scripts/update.sh $(ENV)
dev: ## Install the latest dev version
@sh scripts/dev.sh
run: ## Run the wallabag built-in server
@php bin/console server:run --env=$(ENV)
build: ## Run webpack
@npm run build:$(ENV)
prepare: clean ## Prepare database for testsuite
ifdef DB
cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
endif
-php bin/console doctrine:database:drop --force --env=test
php bin/console doctrine:database:create --env=test
php bin/console doctrine:migrations:migrate --no-interaction --env=test
fixtures: ## Load fixtures into database
php bin/console doctrine:fixtures:load --no-interaction --env=test
test: prepare fixtures ## Launch wallabag testsuite
bin/simple-phpunit -v
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION
$(error VERSION is not set)
endif
@sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
deploy: ## Deploy wallabag
@bundle exec cap staging deploy
.PHONY: help clean prepare install fixtures update build test release deploy run dev
.DEFAULT_GOAL := install
.DEFAULT:
gmake $@

View File

@ -13,17 +13,23 @@ If you do not have your own server, consider [the wallabag.it hosting solution](
![wallabag logo](https://raw.githubusercontent.com/wallabag/logo/master/_default/typo-horizontal/png/sm/logo-typo-horizontal-black-no-bg-no-border-sm.png)
# Install wallabag
Please read [the documentation to see the wallabag requirements](http://doc.wallabag.org/en/master/user/installation.html#requirements).
Please read [the documentation to see the wallabag requirements](https://doc.wallabag.org/en/admin/installation/requirements.html).
Then you can install wallabag by executing the following commands:
```
git clone https://github.com/wallabag/wallabag.git
cd wallabag && make install
make run
cd wallabag && make install
```
Now, [configure a virtual host](https://doc.wallabag.org/en/admin/installation/virtualhosts.html) to use your wallabag.
# Run on YunoHost
[![Install Wallabag with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=wallabag2)
Wallabag app for [YunoHost](https://yunohost.org). See [here](https://github.com/YunoHost-Apps/wallabag2_ynh)
# License
Copyright © 2013-2017 Nicolas Lœuillet <nicolas@loeuillet.org>
Copyright © 2013-2018 Nicolas Lœuillet <nicolas@loeuillet.org>
This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the COPYING file for more details.

View File

@ -4,14 +4,17 @@ A release is mostly a git tag of http://github.com/wallabag/wallabag, following
### Steps to release
During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE`.
During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE` (like 2.3.4).
#### Files to edit
#### Prepare the release
- `app/config/wallabag.yml` (`wallabag_core.version`)
- `CHANGELOG.md`
- Update these files with new information
- `app/config/wallabag.yml` (`wallabag_core.version`)
- `CHANGELOG.md`
- Create a PR named "Prepare $LAST_WALLABAG_RELEASE release".
- Wait for test to be ok, merge it.
#### Create release on GitHub
#### Create a new release on GitHub
- Run these commands to create the tag:
@ -26,8 +29,8 @@ SYMFONY_ENV=prod composer up --no-dev
```diff
script:
- - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
+ - travis_wait composer update --no-interaction --no-progress
- - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
+ - travis_wait bash composer update -o --no-interaction --no-progress --prefer-dist
```
- Then continue with these commands:
@ -42,16 +45,15 @@ git push origin release-$LAST_WALLABAG_RELEASE
- Run these command to create the package:
```
make release master /tmp wllbg-release prod
make release VERSION=$LAST_WALLABAG_RELEASE
```
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new). You have to upload on this page the package.
- Delete the `release-$LAST_WALLABAG_RELEASE` branch and close the pull request (**DO NOT MERGE IT**).
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new) by targetting the `release-$LAST_WALLABAG_RELEASE` branch. You have to upload the package (generated previously).
- Close the previously created pull request (**DO NOT MERGE IT**) and delete the `release-$LAST_WALLABAG_RELEASE` branch.
- Update the URL shortener (used on `wllbg.org` to generate links like `https://wllbg.org/latest-v2-package` or `http://wllbg.org/latest-v2`)
- Update [the downloads page](https://github.com/wallabag/wallabag.org/blob/master/content/pages/download.md) on the website (MD5 sum, release date)
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
- Update wallabag.org website (downloads, releases and new blog post)
- Put the next patch version suffixed with `-dev` in `app/config/config.yml` (`wallabag_core.version`)
- Update wallabag.org 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`)
- Drink a :beer:!
### `composer.lock`

View File

@ -78,6 +78,12 @@ class AppKernel extends Kernel
'base_url' => 'http://localhost:8080/',
],
]);
} else {
$container->loadFromExtension('framework', [
'assets' => [
'base_url' => $container->getParameter('domain_name'),
],
]);
}
});
}

View File

@ -2,60 +2,57 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Initial database structure.
*/
class Version20160401000000 extends AbstractMigration
class Version20160401000000 extends WallabagMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
if ($this->version->getConfiguration()->getNumberOfExecutedMigrations() > 0) {
$this->version->markMigrated();
$this->skipIf(true, 'Database already initialized');
}
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$sql = <<<'SQL'
CREATE TABLE wallabag_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 wallabag_craue_config_setting (name);
CREATE TABLE "wallabag_tagging_rule" (id INTEGER NOT NULL, config_id INTEGER DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);
CREATE TABLE "wallabag_tag" (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);
CREATE TABLE "wallabag_entry" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, is_public BOOLEAN DEFAULT '0', PRIMARY KEY(id), CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);
CREATE TABLE wallabag_entry_tag (entry_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, PRIMARY KEY(entry_id, tag_id), CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);
CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);
CREATE TABLE "wallabag_config" (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);
CREATE TABLE wallabag_oauth2_refresh_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);
CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);
CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);
CREATE TABLE wallabag_oauth2_access_tokens (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);
CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);
CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);
CREATE TABLE wallabag_oauth2_auth_codes (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri CLOB NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);
CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);
CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);
CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types CLOB NOT NULL, PRIMARY KEY(id));
CREATE TABLE "wallabag_user" (id INTEGER 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) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);
CREATE TABLE wallabag_annotation (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, entry_id INTEGER DEFAULT NULL, text CLOB NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);
$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 UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
CREATE TABLE {$this->getTable('tagging_rule')} (id INTEGER NOT NULL, config_id INTEGER DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES {$this->getTable('config')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_2D9B3C5424DB0683 ON {$this->getTable('tagging_rule')} (config_id);
CREATE TABLE {$this->getTable('tag')} (id INTEGER NOT NULL, label CLOB NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON {$this->getTable('tag')} (slug);
CREATE TABLE {$this->getTable('entry')} (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, title CLOB DEFAULT NULL, url CLOB DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL, language CLOB DEFAULT NULL, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL, preview_picture CLOB DEFAULT NULL, is_public BOOLEAN DEFAULT '0', PRIMARY KEY(id), CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_F4D18282A76ED395 ON {$this->getTable('entry')} (user_id);
CREATE TABLE {$this->getTable('entry_tag')} (entry_id INTEGER NOT NULL, tag_id INTEGER NOT NULL, PRIMARY KEY(entry_id, tag_id), CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES {$this->getTable('tag')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_C9F0DD7CBA364942 ON {$this->getTable('entry_tag')} (entry_id);
CREATE INDEX IDX_C9F0DD7CBAD26311 ON {$this->getTable('entry_tag')} (tag_id);
CREATE TABLE {$this->getTable('config')} (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON {$this->getTable('config')} (user_id);
CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON {$this->getTable('oauth2_refresh_tokens')} (token);
CREATE INDEX IDX_20C9FB2419EB6921 ON {$this->getTable('oauth2_refresh_tokens')} (client_id);
CREATE INDEX IDX_20C9FB24A76ED395 ON {$this->getTable('oauth2_refresh_tokens')} (user_id);
CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON {$this->getTable('oauth2_access_tokens')} (token);
CREATE INDEX IDX_368A420919EB6921 ON {$this->getTable('oauth2_access_tokens')} (client_id);
CREATE INDEX IDX_368A4209A76ED395 ON {$this->getTable('oauth2_access_tokens')} (user_id);
CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INTEGER NOT NULL, client_id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri CLOB NOT NULL, expires_at INTEGER DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON {$this->getTable('oauth2_auth_codes')} (token);
CREATE INDEX IDX_EE52E3FA19EB6921 ON {$this->getTable('oauth2_auth_codes')} (client_id);
CREATE INDEX IDX_EE52E3FAA76ED395 ON {$this->getTable('oauth2_auth_codes')} (user_id);
CREATE TABLE {$this->getTable('oauth2_clients')} (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris CLOB NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types CLOB NOT NULL, PRIMARY KEY(id));
CREATE TABLE {$this->getTable('user')} (id INTEGER 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) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON {$this->getTable('user')} (username_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON {$this->getTable('user')} (email_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON {$this->getTable('user')} (confirmation_token);
CREATE TABLE {$this->getTable('annotation')} (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, entry_id INTEGER DEFAULT NULL, text CLOB NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges CLOB NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE);
CREATE INDEX IDX_A7AED006A76ED395 ON {$this->getTable('annotation')} (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON {$this->getTable('annotation')} (entry_id);
SQL
;
@ -65,32 +62,32 @@ SQL
break;
case 'mysql':
$sql = <<<'SQL'
CREATE TABLE wallabag_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 `wallabag_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 wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `wallabag_config` (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `wallabag_tagging_rule` (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `wallabag_tag` (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE wallabag_oauth2_clients (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE wallabag_oauth2_access_tokens (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE wallabag_oauth2_refresh_tokens (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE wallabag_oauth2_auth_codes (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE `wallabag_user` (id INT AUTO_INCREMENT 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 TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE wallabag_annotation (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE `wallabag_entry` ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id);
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES `wallabag_tag` (id);
ALTER TABLE `wallabag_config` ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
ALTER TABLE `wallabag_tagging_rule` ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES `wallabag_config` (id);
ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id);
ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES `wallabag_user` (id);
ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES `wallabag_entry` (id);
$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('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_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_C9F0DD7CBA364942 (entry_id), INDEX IDX_C9F0DD7CBAD26311 (tag_id), PRIMARY KEY(entry_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('config')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_87E64C53A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('tagging_rule')} (id INT AUTO_INCREMENT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)', INDEX IDX_2D9B3C5424DB0683 (config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('tag')} (id INT AUTO_INCREMENT NOT NULL, `label` LONGTEXT NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_4CA58A8C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_clients')} (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT '(DC2Type:array)', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT '(DC2Type:array)', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_368A42095F37A13B (token), INDEX IDX_368A420919EB6921 (client_id), INDEX IDX_368A4209A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_20C9FB245F37A13B (token), INDEX IDX_20C9FB2419EB6921 (client_id), INDEX IDX_20C9FB24A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_EE52E3FA5F37A13B (token), INDEX IDX_EE52E3FA19EB6921 (client_id), INDEX IDX_EE52E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('user')} (id INT AUTO_INCREMENT 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 TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, name LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication TINYINT(1) NOT NULL, trusted LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json_array)', UNIQUE INDEX UNIQ_1D63E7E592FC23A8 (username_canonical), UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_1D63E7E5C05FB297 (confirmation_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('annotation')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, quote VARCHAR(255) NOT NULL, ranges LONGTEXT NOT NULL COMMENT '(DC2Type:array)', INDEX IDX_A7AED006A76ED395 (user_id), INDEX IDX_A7AED006BA364942 (entry_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE {$this->getTable('entry')} ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES {$this->getTable('tag')} (id);
ALTER TABLE {$this->getTable('config')} ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('tagging_rule')} ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES {$this->getTable('config')} (id);
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id);
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id);
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id);
SQL
;
foreach (explode("\n", $sql) as $query) {
@ -98,46 +95,46 @@ SQL
}
break;
case 'postgresql':
$sql = <<<'SQL'
CREATE TABLE wallabag_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 wallabag_craue_config_setting (name);
CREATE TABLE "wallabag_entry" (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN DEFAULT 'false', PRIMARY KEY(id));
CREATE INDEX IDX_F4D18282A76ED395 ON "wallabag_entry" (user_id);
CREATE TABLE wallabag_entry_tag (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id));
CREATE INDEX IDX_C9F0DD7CBA364942 ON wallabag_entry_tag (entry_id);
CREATE INDEX IDX_C9F0DD7CBAD26311 ON wallabag_entry_tag (tag_id);
CREATE TABLE "wallabag_config" (id INT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "wallabag_config" (user_id);
CREATE TABLE "wallabag_tagging_rule" (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id));
CREATE INDEX IDX_2D9B3C5424DB0683 ON "wallabag_tagging_rule" (config_id);
COMMENT ON COLUMN "wallabag_tagging_rule".tags IS '(DC2Type:simple_array)';
CREATE TABLE "wallabag_tag" (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON "wallabag_tag" (slug);
CREATE TABLE wallabag_oauth2_clients (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types TEXT NOT NULL, PRIMARY KEY(id));
COMMENT ON COLUMN wallabag_oauth2_clients.redirect_uris IS '(DC2Type:array)';
COMMENT ON COLUMN wallabag_oauth2_clients.allowed_grant_types IS '(DC2Type:array)';
CREATE TABLE wallabag_oauth2_access_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON wallabag_oauth2_access_tokens (token);
CREATE INDEX IDX_368A420919EB6921 ON wallabag_oauth2_access_tokens (client_id);
CREATE INDEX IDX_368A4209A76ED395 ON wallabag_oauth2_access_tokens (user_id);
CREATE TABLE wallabag_oauth2_refresh_tokens (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON wallabag_oauth2_refresh_tokens (token);
CREATE INDEX IDX_20C9FB2419EB6921 ON wallabag_oauth2_refresh_tokens (client_id);
CREATE INDEX IDX_20C9FB24A76ED395 ON wallabag_oauth2_refresh_tokens (user_id);
CREATE TABLE wallabag_oauth2_auth_codes (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON wallabag_oauth2_auth_codes (token);
CREATE INDEX IDX_EE52E3FA19EB6921 ON wallabag_oauth2_auth_codes (client_id);
CREATE INDEX IDX_EE52E3FAA76ED395 ON wallabag_oauth2_auth_codes (user_id);
CREATE TABLE "wallabag_user" (id INT 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) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token);
COMMENT ON COLUMN "wallabag_user".roles IS '(DC2Type:array)';
COMMENT ON COLUMN "wallabag_user".trusted IS '(DC2Type:json_array)';
CREATE TABLE wallabag_annotation (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id));
CREATE INDEX IDX_A7AED006A76ED395 ON wallabag_annotation (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON wallabag_annotation (entry_id);
COMMENT ON COLUMN wallabag_annotation.ranges IS '(DC2Type:array)';
$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 UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
CREATE TABLE {$this->getTable('entry')} (id INT NOT NULL, user_id INT DEFAULT NULL, title TEXT DEFAULT NULL, url TEXT DEFAULT NULL, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, mimetype TEXT DEFAULT NULL, language TEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name TEXT DEFAULT NULL, preview_picture TEXT DEFAULT NULL, is_public BOOLEAN DEFAULT 'false', PRIMARY KEY(id));
CREATE INDEX IDX_F4D18282A76ED395 ON {$this->getTable('entry')} (user_id);
CREATE TABLE {$this->getTable('entry_tag')} (entry_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY(entry_id, tag_id));
CREATE INDEX IDX_C9F0DD7CBA364942 ON {$this->getTable('entry_tag')} (entry_id);
CREATE INDEX IDX_C9F0DD7CBAD26311 ON {$this->getTable('entry_tag')} (tag_id);
CREATE TABLE {$this->getTable('config')} (id INT NOT NULL, user_id INT DEFAULT NULL, theme VARCHAR(255) NOT NULL, items_per_page INT NOT NULL, language VARCHAR(255) NOT NULL, rss_token VARCHAR(255) DEFAULT NULL, rss_limit INT DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON {$this->getTable('config')} (user_id);
CREATE TABLE {$this->getTable('tagging_rule')} (id INT NOT NULL, config_id INT DEFAULT NULL, rule VARCHAR(255) NOT NULL, tags TEXT NOT NULL, PRIMARY KEY(id));
CREATE INDEX IDX_2D9B3C5424DB0683 ON {$this->getTable('tagging_rule')} (config_id);
COMMENT ON COLUMN {$this->getTable('tagging_rule')}.tags IS '(DC2Type:simple_array)';
CREATE TABLE {$this->getTable('tag')} (id INT NOT NULL, label TEXT NOT NULL, slug VARCHAR(128) NOT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_4CA58A8C989D9B62 ON {$this->getTable('tag')} (slug);
CREATE TABLE {$this->getTable('oauth2_clients')} (id INT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris TEXT NOT NULL, secret VARCHAR(255) NOT NULL, allowed_grant_types TEXT NOT NULL, PRIMARY KEY(id));
COMMENT ON COLUMN {$this->getTable('oauth2_clients')}.redirect_uris IS '(DC2Type:array)';
COMMENT ON COLUMN {$this->getTable('oauth2_clients')}.allowed_grant_types IS '(DC2Type:array)';
CREATE TABLE {$this->getTable('oauth2_access_tokens')} (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_368A42095F37A13B ON {$this->getTable('oauth2_access_tokens')} (token);
CREATE INDEX IDX_368A420919EB6921 ON {$this->getTable('oauth2_access_tokens')} (client_id);
CREATE INDEX IDX_368A4209A76ED395 ON {$this->getTable('oauth2_access_tokens')} (user_id);
CREATE TABLE {$this->getTable('oauth2_refresh_tokens')} (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_20C9FB245F37A13B ON {$this->getTable('oauth2_refresh_tokens')} (token);
CREATE INDEX IDX_20C9FB2419EB6921 ON {$this->getTable('oauth2_refresh_tokens')} (client_id);
CREATE INDEX IDX_20C9FB24A76ED395 ON {$this->getTable('oauth2_refresh_tokens')} (user_id);
CREATE TABLE {$this->getTable('oauth2_auth_codes')} (id INT NOT NULL, client_id INT NOT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri TEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_EE52E3FA5F37A13B ON {$this->getTable('oauth2_auth_codes')} (token);
CREATE INDEX IDX_EE52E3FA19EB6921 ON {$this->getTable('oauth2_auth_codes')} (client_id);
CREATE INDEX IDX_EE52E3FAA76ED395 ON {$this->getTable('oauth2_auth_codes')} (user_id);
CREATE TABLE {$this->getTable('user')} (id INT 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) NOT NULL, password VARCHAR(255) NOT NULL, last_login TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, locked BOOLEAN NOT NULL, expired BOOLEAN NOT NULL, expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, roles TEXT NOT NULL, credentials_expired BOOLEAN NOT NULL, credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, name TEXT DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, authCode INT DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted TEXT DEFAULT NULL, PRIMARY KEY(id));
CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON {$this->getTable('user')} (username_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON {$this->getTable('user')} (email_canonical);
CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON {$this->getTable('user')} (confirmation_token);
COMMENT ON COLUMN {$this->getTable('user')}.roles IS '(DC2Type:array)';
COMMENT ON COLUMN {$this->getTable('user')}.trusted IS '(DC2Type:json_array)';
CREATE TABLE {$this->getTable('annotation')} (id INT NOT NULL, user_id INT DEFAULT NULL, entry_id INT DEFAULT NULL, text TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, quote VARCHAR(255) NOT NULL, ranges TEXT NOT NULL, PRIMARY KEY(id));
CREATE INDEX IDX_A7AED006A76ED395 ON {$this->getTable('annotation')} (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON {$this->getTable('annotation')} (entry_id);
COMMENT ON COLUMN {$this->getTable('annotation')}.ranges IS '(DC2Type:array)';
CREATE SEQUENCE "entry_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE "config_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE "tagging_rule_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
@ -148,19 +145,19 @@ CREATE SEQUENCE oauth2_refresh_tokens_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE oauth2_auth_codes_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1;
CREATE SEQUENCE annotation_id_seq INCREMENT BY 1 MINVALUE 1 START 1;
ALTER TABLE "wallabag_entry" ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES "wallabag_tag" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE "wallabag_config" ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE "wallabag_tagging_rule" ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES "wallabag_config" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_oauth2_access_tokens ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('entry')} ADD CONSTRAINT FK_F4D18282A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('entry_tag')} ADD CONSTRAINT FK_C9F0DD7CBAD26311 FOREIGN KEY (tag_id) REFERENCES {$this->getTable('tag')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('config')} ADD CONSTRAINT FK_87E64C53A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('tagging_rule')} ADD CONSTRAINT FK_2D9B3C5424DB0683 FOREIGN KEY (config_id) REFERENCES {$this->getTable('config')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A420919EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('oauth2_access_tokens')} ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB2419EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('oauth2_refresh_tokens')} ADD CONSTRAINT FK_20C9FB24A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES {$this->getTable('oauth2_clients')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('oauth2_auth_codes')} ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$this->getTable('user')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
ALTER TABLE {$this->getTable('annotation')} ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$this->getTable('entry')} (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
SQL
;
foreach (explode("\n", $sql) as $query) {
@ -175,17 +172,17 @@ SQL
*/
public function down(Schema $schema)
{
$this->addSql('DROP TABLE wallabag_craue_config_setting');
$this->addSql('DROP TABLE "wallabag_tagging_rule"');
$this->addSql('DROP TABLE "wallabag_config"');
$this->addSql('DROP TABLE "wallabag_entry"');
$this->addSql('DROP TABLE wallabag_entry_tag');
$this->addSql('DROP TABLE "wallabag_tag"');
$this->addSql('DROP TABLE wallabag_oauth2_refresh_tokens');
$this->addSql('DROP TABLE wallabag_oauth2_access_tokens');
$this->addSql('DROP TABLE wallabag_oauth2_clients');
$this->addSql('DROP TABLE wallabag_oauth2_auth_codes');
$this->addSql('DROP TABLE "wallabag_user"');
$this->addSql('DROP TABLE wallabag_annotation');
$this->addSql("DROP TABLE {$this->getTable('craue_config_setting')}");
$this->addSql("DROP TABLE {$this->getTable('tagging_rule')}");
$this->addSql("DROP TABLE {$this->getTable('config')}");
$this->addSql("DROP TABLE {$this->getTable('entry')}");
$this->addSql("DROP TABLE {$this->getTable('entry_tag')}");
$this->addSql("DROP TABLE {$this->getTable('tag')}");
$this->addSql("DROP TABLE {$this->getTable('oauth2_refresh_tokens')}");
$this->addSql("DROP TABLE {$this->getTable('oauth2_access_tokens')}");
$this->addSql("DROP TABLE {$this->getTable('oauth2_clients')}");
$this->addSql("DROP TABLE {$this->getTable('oauth2_auth_codes')}");
$this->addSql("DROP TABLE {$this->getTable('user')}");
$this->addSql("DROP TABLE {$this->getTable('annotation')}");
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added foreign keys for account resetting.
*/
class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface
class Version20160410190541 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -56,9 +44,4 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added name field on wallabag_oauth2_clients.
*/
class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface
class Version20160812120952 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -65,9 +53,4 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI
$clientsTable->dropColumn('name');
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added settings for RabbitMQ and Redis imports.
*/
class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface
class Version20160911214952 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -56,9 +44,4 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added pocket_consumer_key field on wallabag_config.
*/
class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface
class Version20160916201049 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI
$configTable->dropColumn('pocket_consumer_key');
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,27 +2,15 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added pocket_consumer_key field on wallabag_config.
*/
class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface
class Version20161001072726 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -36,7 +24,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
$query = $this->connection->query("
SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage
WHERE TABLE_NAME = '" . $this->getTable('entry_tag') . "' AND CONSTRAINT_NAME LIKE 'FK_%'
WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%'
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
);
$query->execute();
@ -54,7 +42,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
FROM pg_constraint c
JOIN pg_namespace n ON n.oid = c.connamespace
WHERE contype = 'f'
AND conrelid::regclass::text = '" . $this->getTable('entry_tag') . "'
AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND n.nspname = 'public';"
);
$query->execute();
@ -75,7 +63,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
$query = $this->connection->query("
SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage
WHERE TABLE_NAME = '" . $this->getTable('annotation') . "'
WHERE TABLE_NAME = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND CONSTRAINT_NAME LIKE 'FK_%'
AND COLUMN_NAME = 'entry_id'
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
@ -95,7 +83,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
FROM pg_constraint c
JOIN pg_namespace n ON n.oid = c.connamespace
WHERE contype = 'f'
AND conrelid::regclass::text = '" . $this->getTable('annotation') . "'
AND conrelid::regclass::text = '" . $this->getTable('annotation', WallabagMigration::UN_ESCAPED_TABLE) . "'
AND n.nspname = 'public'
AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';"
);
@ -117,9 +105,4 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI
{
throw new SkipMigrationException('Too complex ...');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Converted database to utf8mb4 encoding (for MySQL only).
*/
class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface
class Version20161022134138 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -29,7 +17,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), '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;');
// convert field length for utf8mb4
// http://stackoverflow.com/a/31474509/569101
@ -60,7 +48,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), '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;');
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
@ -77,9 +65,4 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,28 +2,16 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added user_id column on oauth2_clients to prevent users to delete API clients from other users.
*/
class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface
class Version20161024212538 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
private $constraintName = 'IDX_user_oauth_client';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -59,9 +47,4 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI
$clientsTable->removeForeignKey($this->constraintName);
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added the internal setting to enable/disable downloading pictures.
*/
class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface
class Version20161031132655 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,28 +2,16 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added created_at index on entry table.
*/
class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface
class Version20161104073720 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
private $indexName = 'IDX_entry_created_at';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -45,9 +33,4 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI
$entryTable->dropIndex($this->indexName);
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added action_mark_as_read field on config table.
*/
class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface
class Version20161106113822 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -48,9 +36,4 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI
$configTable->dropColumn('action_mark_as_read');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added the internal setting to share articles to unmark.it.
*/
class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface
class Version20161117071626 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -56,9 +44,4 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add http_status in `entry_table`.
*/
class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface
class Version20161118134328 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -48,9 +36,4 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('http_status');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add the restricted_access internal setting for articles with paywall.
*/
class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface
class Version20161122144743 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,10 +2,8 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Methods and properties removed from `FOS\UserBundle\Model\User`.
@ -18,18 +16,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* You need to drop the fields `expired` and `credentials_expired` from your database
* schema, because they aren't mapped anymore.
*/
class Version20161122203647 extends AbstractMigration implements ContainerAwareInterface
class Version20161122203647 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -55,9 +43,4 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI
$userTable->addColumn('expired', 'smallint', ['notnull' => false]);
$userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]);
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added list_mode in user config.
*/
class Version20161128084725 extends AbstractMigration implements ContainerAwareInterface
class Version20161128084725 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -41,9 +29,4 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI
$configTable = $schema->getTable($this->getTable('config'));
$configTable->dropColumn('list_mode');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,15 +2,13 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Removed locked, credentials_expire_at and expires_at.
*/
class Version20161128131503 extends AbstractMigration implements ContainerAwareInterface
class Version20161128131503 extends WallabagMigration
{
private $fields = [
'locked' => 'smallint',
@ -18,16 +16,6 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
'expires_at' => 'datetime',
];
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -53,9 +41,4 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
$userTable->addColumn($field, $type, ['notnull' => false]);
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Renamed uuid to uid in entry table.
*/
class Version20161214094402 extends AbstractMigration implements ContainerAwareInterface
class Version20161214094402 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -67,9 +55,4 @@ class Version20161214094402 extends AbstractMigration implements ContainerAwareI
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,28 +2,16 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added index on wallabag_entry.uid.
*/
class Version20161214094403 extends AbstractMigration implements ContainerAwareInterface
class Version20161214094403 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
private $indexName = 'IDX_entry_uid';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -45,9 +33,4 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI
$entryTable->dropIndex($this->indexName);
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,29 +2,17 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added indexes on wallabag_entry.is_starred and wallabag_entry.is_archived.
*/
class Version20170127093841 extends AbstractMigration implements ContainerAwareInterface
class Version20170127093841 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
private $indexStarredName = 'IDX_entry_starred';
private $indexArchivedName = 'IDX_entry_archived';
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -48,9 +36,4 @@ class Version20170127093841 extends AbstractMigration implements ContainerAwareI
$entryTable->dropIndex($this->indexStarredName);
$entryTable->dropIndex($this->indexArchivedName);
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add the share_scuttle internal setting.
*/
class Version20170327194233 extends AbstractMigration implements ContainerAwareInterface
class Version20170327194233 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -46,9 +34,4 @@ class Version20170327194233 extends AbstractMigration implements ContainerAwareI
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';");
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add published_at and published_by in `entry` table.
*/
class Version20170405182620 extends AbstractMigration implements ContainerAwareInterface
class Version20170405182620 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -57,9 +45,4 @@ class Version20170405182620 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('published_by');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Remove isPublic in Entry Table.
*/
class Version20170407200919 extends AbstractMigration implements ContainerAwareInterface
class Version20170407200919 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -43,9 +31,4 @@ class Version20170407200919 extends AbstractMigration implements ContainerAwareI
$entryTable->addColumn('is_public', 'boolean', ['notnull' => false, 'default' => 0]);
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Remove download_pictures in craue_config_setting.
*/
class Version20170420134133 extends AbstractMigration implements ContainerAwareInterface
class Version20170420134133 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20170420134133 extends AbstractMigration implements ContainerAwareI
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_pictures', '1', 'entry')");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add site credential table to store username & password for some website (behind authentication or paywall).
*/
class Version20170501115751 extends AbstractMigration implements ContainerAwareInterface
class Version20170501115751 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -53,9 +41,4 @@ class Version20170501115751 extends AbstractMigration implements ContainerAwareI
{
$schema->dropTable($this->getTable('site_credential'));
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,15 +2,13 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table.
*/
class Version20170510082609 extends AbstractMigration implements ContainerAwareInterface
class Version20170510082609 extends WallabagMigration
{
private $fields = [
'username',
@ -19,16 +17,6 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI
'email_canonical',
];
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -52,9 +40,4 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Added `headers` field in entry table.
*/
class Version20170511115400 extends AbstractMigration implements ContainerAwareInterface
class Version20170511115400 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -47,9 +35,4 @@ class Version20170511115400 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('headers');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,27 +2,15 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Increase the length of the "quote" column of "annotation" table.
*/
class Version20170511211659 extends AbstractMigration implements ContainerAwareInterface
class Version20170511211659 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function up(Schema $schema)
{
$tableName = $this->getTable('annotation');
@ -30,8 +18,8 @@ class Version20170511211659 extends AbstractMigration implements ContainerAwareI
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$this->addSql(<<<EOD
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM ${tableName}
EOD
);
@ -56,8 +44,8 @@ EOD
);
$this->addSql(<<<EOD
INSERT INTO ${tableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
INSERT INTO ${tableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM __temp__wallabag_annotation;
EOD
);
@ -88,9 +76,4 @@ EOD
break;
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add api_user_registration in craue_config_setting.
*/
class Version20170602075214 extends AbstractMigration implements ContainerAwareInterface
class Version20170602075214 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20170602075214 extends AbstractMigration implements ContainerAwareI
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,27 +2,15 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Remove wallabag_url from craue_config_setting.
* It has been moved into the parameters.yml.
*/
class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface
class Version20170606155640 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -45,9 +33,4 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI
{
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Changed tags to lowercase.
*/
class Version20170719231144 extends AbstractMigration implements ContainerAwareInterface
class Version20170719231144 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -67,7 +55,7 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
}
// Just in case...
if (count($ids) > 0) {
if (\count($ids) > 0) {
// Merge tags
$this->addSql('
UPDATE ' . $this->getTable('entry_tag') . '
@ -75,7 +63,7 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
WHERE tag_id IN (' . implode(',', $ids) . ')
AND entry_id NOT IN (
SELECT entry_id
FROM ' . $this->getTable('entry_tag') . '
FROM (SELECT * FROM ' . $this->getTable('entry_tag') . ') AS _entry_tag
WHERE tag_id = ' . $newId . '
)'
);
@ -108,9 +96,4 @@ class Version20170719231144 extends AbstractMigration implements ContainerAwareI
{
throw new SkipMigrationException('Too complex ...');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add starred_at column and set its value to updated_at for is_starred entries.
*/
class Version20170824113337 extends AbstractMigration implements ContainerAwareInterface
class Version20170824113337 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -60,9 +48,4 @@ class Version20170824113337 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('starred_at');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Changed reading_time field to prevent null value.
*/
class Version20171008195606 extends AbstractMigration implements ContainerAwareInterface
class Version20171008195606 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -57,9 +45,4 @@ class Version20171008195606 extends AbstractMigration implements ContainerAwareI
break;
}
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add origin_url column.
*/
class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface
class Version20171105202000 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -47,9 +35,4 @@ class Version20171105202000 extends AbstractMigration implements ContainerAwareI
$entryTable->dropColumn('origin_url');
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add store_article_headers in craue_config_setting.
*/
class Version20171120163128 extends AbstractMigration implements ContainerAwareInterface
class Version20171120163128 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20171120163128 extends AbstractMigration implements ContainerAwareI
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -2,26 +2,14 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
/**
* Add shaarli_share_origin_url in craue_config_setting.
*/
class Version20171125164500 extends AbstractMigration implements ContainerAwareInterface
class Version20171125164500 extends WallabagMigration
{
/**
* @var ContainerInterface
*/
private $container;
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @param Schema $schema
*/
@ -44,9 +32,4 @@ class Version20171125164500 extends AbstractMigration implements ContainerAwareI
{
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';");
}
private function getTable($tableName)
{
return $this->container->getParameter('database_table_prefix') . $tableName;
}
}

View File

@ -27,7 +27,7 @@ export: "export"
import: "import"
misc: "misc"
modify_settings: "apply"
piwik_host: Host of your website in Piwik (without http:// ou https://)
piwik_host: Host of your website in Piwik (without http:// or https://)
piwik_site_id: ID of your website in Piwik
piwik_enabled: Enable Piwik
demo_mode_enabled: "Enable demo mode? (Only used for the public wallabag demo)"
@ -37,4 +37,4 @@ download_images_enabled: Download images locally
restricted_access: Enable authentication for paywalled websites
api_user_registration: Enable user to be registered using the API
store_article_headers: Enable if wallabag stores HTTP headers for each article
shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled
shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled

View File

@ -36,5 +36,5 @@ share_public: Autorizar una URL publica pels articles
download_images_enabled: Telecargar los imatges en local
restricted_access: Activar l'autenticacion pels sites amb peatge
api_user_registration: Autorizar los utilizaires a se marcar amb l'API
# store_article_headers: Enable if wallabag stores HTTP headers for each article
# shaarli_share_origin_url: Enable sharing origin url to Shaarli, if the service is enabled
store_article_headers: Activar se wallabag garda las entèstas HTTP per cada article
shaarli_share_origin_url: Activar lo partatge de lurl amb Shaarli, se lo servici es activat

View File

@ -1,7 +1,7 @@
# settings_changed: Configuration updated
download_pictures: Download imagens no seu servidor
carrot: Habilitar compartilhamento para o Carrot
diaspora_url: URL Diaspora, se o serviço está habilitado
diaspora_url: URL Diaspora caso o serviço esteja habilitado
export_epub: Habilita exportação para ePub
export_mobi: Habilita exportação para .mobi
export_pdf: Habilita exportação para PDF
@ -11,9 +11,10 @@ export_txt: Habilita exportação para TXT
export_xml: Habilita exportação para XML
# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously
# import_with_redis: Enable Redis to import data asynchronously
shaarli_url: URL Shaarli, se o serviço está habilitado
scuttle_url: URL Scuttle, se o serviço está habilitado
unmark_url: URL Unmark, se o serviço está habilitado
shaarli_url: URL Shaarli caso o serviço esteja habilitado
scuttle_url: URL Scuttle caso o serviço esteja habilitado
unmark_url: URL Unmark caso o serviço esteja habilitado
pocket_consumer_key: Chave de consumidor do Pocket para importar conteúdo (https://getpocket.com/developer/docs/authentication)
share_diaspora: Habilitar compartilhamento para o Diaspora
share_mail: Habilitar compartilhamento por e-mail
share_shaarli: Habilitar compartilhamento para o Shaarli

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><path fill="none" d="M0 0h200v200H0z"/><path d="M75.899 72.438c1.597-.981 10.207-5.556 24.098.178 14.289 5.897 23.154.776 24.253.079-3.454-5.678-7.562-10.62-12.104-13.943.303-.083.612-.167.939-.263 6.023-1.742 7.553-6.842 7.875-11.21.364-4.954.616-5.03 1.692-9.487 1.032-4.281-.119-5.137-1.181-4.273-.572.465-5.552 1.616-8.505 3.919-4.768 3.72-7.707 10.794-9.039 14.706-.025.06-.205.604-.265.792-.621 1.498-1.857 1.494-1.857 1.494v.001c-.6-.065-1.202-.1-1.809-.1-.54 0-1.079.029-1.616.081-.012.002-.019 0-.031.001-1.581.233-2.45-1.697-2.632-2.157-1.847-5.304-6.816-15.763-17.984-18.577 0 0-2.028-1.554-1.41 1.074.588 2.511 1.804 5.049 1.534 8.741-.124 1.704-1.181 10.442 6.85 14.99.763.432 1.441.795 2.051 1.101-4.042 3.235-7.716 7.74-10.859 12.853zM128.626 152.353c-9.842-6.098-13.153-8.242-12.946-10.575 0 0 .002-.379.099-.957.239-1.236.995-3.348 3.407-4.552.079-.039.146-.084.208-.129 7.668-4.45 13.27-11.614 15.246-20.56-1.99 4.941-16.735 8.78-34.645 8.78-17.903 0-32.651-3.839-34.641-8.78.442 2.008 1.073 3.923 1.864 5.742.666 3.745 1.562 12.563-2.673 20.282-3.731 6.8-22.15 16.069-49.485 10.748 0 0-1.096-.766-1.428-.136-.491.932 1.517 1.685 3.583 2.229 19.031 5.04 47.756 2.989 56.777-4.443 4.116-3.388 5.704-7.953 6.107-12.865l.003.008s.11-1.287 1.719-.32c.461.277 2.125 1.36 2.39 2.585.232 1.743.248 3.883-.652 5.382-1.287 2.144-1.301 2.452.393 3.662 1.04.742 5.287 3.864 11.198 7.415.015.01.023.019.038.027 1.25.753 2.987 2.597 2.987 2.597 2.662 3.079 8.452 9.275 10.972 8.108 1.19-.551-.051-3.032-.051-3.032s1.98 2.571 3.043 1.694c.809-.668-.473-3.229-.473-3.229s1.729 1.499 2.757.944c1.258-.679-.187-4.614-10.079-10.627-9.896-6.018-12.578-6.94-12.814-9.626 0 0-.004-.135.004-.366.077-.593.414-1.847 1.852-1.712 2.141.346 4.348.531 6.608.531 2.587 0 5.107-.237 7.536-.69l.001.003s.127-.025.164-.031c.284-.036.838-.018.84.671-.09.873-.331 1.751-.845 2.519-1.447 2.168-.972 2.466.54 3.859.933.859 5.211 4.622 11.07 8.264.012.009.017.016.031.023 1.249.752 3.41 2.816 3.41 2.816v-.001c2.428 2.466 6.894 6.596 9.327 6.347 1.646-.168.306-3.002.306-3.002s2.078 2.006 3.099 1.416c1.142-.659-.474-2.755-.474-2.755s1.338.708 2.283.473c.948-.236 1.185-2.644-8.656-8.737z"/><path d="M117.631 83.452c-1.181 0-2.161.355-2.912 1.057-.76.71-1.144 1.531-1.144 2.438v16.056c0 2.154-.382 3.742-1.135 4.721-.728.946-1.892 1.406-3.556 1.406-1.703 0-2.863-.457-3.549-1.396-.716-.979-1.078-2.571-1.078-4.731V86.884c0-1.098-.5-1.996-1.448-2.596-1.289-.812-2.57-1.105-4.129-.587-.476.159-.924.366-1.333.615-.435.265-.802.597-1.093.985-.322.432-.486.901-.486 1.396v16.307c0 2.158-.363 3.75-1.079 4.73-.688.939-1.849 1.396-3.548 1.396-1.705 0-2.877-.459-3.584-1.401-.734-.979-1.107-2.57-1.107-4.726V86.947c0-.908-.384-1.728-1.145-2.438-.751-.702-1.751-1.057-2.973-1.057-1.258 0-2.296.352-3.085 1.045-.811.71-1.222 1.535-1.222 2.45v15.806c0 1.988.194 3.869.575 5.588.393 1.758 1.077 3.3 2.035 4.586.968 1.299 2.282 2.323 3.906 3.05 1.607.716 3.617 1.079 5.975 1.079 2.457 0 4.515-.455 6.115-1.354 1.342-.754 2.473-1.744 3.371-2.951.866 1.207 1.971 2.197 3.294 2.95 1.58.899 3.669 1.354 6.211 1.354 2.357 0 4.359-.364 5.947-1.081 1.601-.726 2.902-1.751 3.872-3.048.96-1.29 1.645-2.833 2.034-4.586.381-1.719.575-3.6.575-5.588V86.947c0-.911-.398-1.733-1.184-2.445-.767-.697-1.818-1.05-3.12-1.05z"/></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -13,8 +13,10 @@ import './global.scss';
import './js/shortcuts/entry';
import './js/shortcuts/main';
import { savePercent, retrievePercent } from './js/tools';
/* Hightlight */
import './js/highlight';
import { savePercent, retrievePercent } from './js/tools';
/* ==========================================================================
Annotations & Remember position
@ -65,7 +67,7 @@ $(document).ready(() => {
retrievePercent(x.entryId);
$(window).resize(() => {
retrievePercent(x.entryId);
retrievePercent(x.entryId, true);
});
}
});

View File

@ -0,0 +1,8 @@
import 'highlight.js/styles/atom-one-light.css';
import * as hljs from 'highlight.js';
window.addEventListener('load', () => {
document.querySelectorAll('pre').forEach((node) => {
hljs.highlightBlock(node);
});
});

View File

@ -19,14 +19,16 @@ function savePercent(id, percent) {
return true;
}
function retrievePercent(id) {
function retrievePercent(id, resized) {
if (!supportsLocalStorage()) { return false; }
const bheight = $(document).height();
const percent = localStorage[`wallabag.article.${id}.percent`];
const scroll = bheight * percent;
$('html,body').animate({ scrollTop: scroll }, 'fast');
if (!resized) {
$('html,body').animate({ scrollTop: scroll }, 'fast');
}
return true;
}

View File

@ -221,6 +221,12 @@ ol li:last-child {
padding-bottom: 0;
}
iframe,
video {
max-width: 100%;
height: auto;
}
mark {
padding: 0 0.2em;
}

View File

@ -11,6 +11,7 @@
color: #424242;
font-size: 18px;
line-height: 1.7em;
overflow-wrap: break-word;
h1,
h2,

View File

@ -25,7 +25,6 @@ main {
max-height: 80px;
font-size: 19px;
font-family: roberto, "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #313131;
}
.card-stacked .card-content .card-title {
@ -103,6 +102,11 @@ main {
display: inline-flex;
vertical-align: middle;
.card-reading-time,
.card-created-at {
display: inline-flex;
}
span {
margin-right: 5px;
}
@ -117,13 +121,6 @@ main {
height: 13.5em;
}
.card-image .preview,
.card-fullimage .preview {
height: 14em;
background: no-repeat 50%/cover;
display: block;
}
&.sw {
max-width: 370px;
margin-left: auto;
@ -138,6 +135,19 @@ a.original:not(.waves-effect) {
display: block;
}
.card .card-image .preview,
.card .card-fullimage .preview,
.card-stacked .preview {
height: 100%;
background: no-repeat 50%/cover;
background-color: #efefef;
display: block;
&--default {
background-size: contain;
}
}
.card-entry-labels li,
.card-tag-labels li {
margin: 10px 10px 10px auto;
@ -206,24 +216,21 @@ a.original:not(.waves-effect) {
text-align: right;
}
.preview {
.card-preview {
max-width: 100px;
height: auto;
max-height: 50px;
margin-right: 10px;
flex: 1;
img {
max-width: 100%;
max-height: 100%;
}
}
div.metadata {
.chip {
background-color: $blueAccentColor;
padding: 0 15px 0 10px;
padding: 0 7px;
margin: auto 2px;
border-radius: 6px;
line-height: 22px;
height: 22px;
a,
i {
@ -251,6 +258,10 @@ a.original:not(.waves-effect) {
float: right;
max-width: 6em;
}
.tags {
display: inline-block;
}
}
#content .collection .collection-item {
@ -266,9 +277,3 @@ a.original:not(.waves-effect) {
.settings .div_tabs {
padding-bottom: 15px;
}
@media only screen and (min-width: 992px) {
.card-tag-labels li {
max-width: 50%;
}
}

View File

@ -24,6 +24,10 @@ main,
height: 100%;
}
.typo-logo {
max-width: 150px;
}
#main {
flex: 1 0 auto;

View File

@ -12,6 +12,16 @@
.pagination {
margin-left: auto;
}
.card-tag-labels li {
max-width: 50%;
}
}
@media screen and (min-width: 993px) {
main #content {
padding-left: 70px;
}
}
@media only screen and (max-width: 992px) {
@ -22,6 +32,16 @@
padding-left: 0;
}
table {
display: block;
overflow: auto;
}
iframe {
max-width: 100%;
height: auto;
}
.nav-panels .action {
padding-right: 0.75rem;
}
@ -154,3 +174,12 @@
padding: 0;
}
}
@media screen and (max-width: 310px),
screen and (min-width: 601px) and (max-width: 660px),
screen and (min-width: 993px) and (max-width: 1050px),
screen and (min-width: 1201px) and (max-width: 1250px) {
.card .card-action .reading-time .card-created-at {
display: none;
}
}

View File

@ -2,8 +2,7 @@
/* ==========================================================================
Nav
========================================================================== */
nav,
.nav-wrapper {
nav {
height: auto;
line-height: initial;
}
@ -18,25 +17,25 @@ nav {
}
}
.nav-wrapper {
.nav-panel-item .button-collapse {
margin-left: 0;
margin-right: 0.5rem;
padding: 0 0.5rem;
height: auto;
line-height: 1;
background-color: transparent;
border: none;
}
.nav-panel-item {
display: flex;
padding: 0.6rem 0.4rem 0.6rem 0.75rem;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
.button-collapse {
margin-left: 0;
margin-right: 0.5rem;
padding: 0 0.5rem;
height: auto;
line-height: 1;
background-color: transparent;
border: none;
}
}
nav .nav-wrapper i {
.nav-panel-item .material-icons {
height: 46px;
line-height: 46px;
}
@ -51,8 +50,8 @@ nav .nav-wrapper i {
justify-content: flex-end;
}
.nav-panel-add .add,
.nav-panel-search .search,
.nav-panel-item .add,
.nav-panel-item .search,
.nav-panels .close {
color: #444 !important;
}
@ -68,9 +67,7 @@ nav .nav-wrapper i {
.input-field input {
display: block;
line-height: inherit;
padding-left: 4rem !important;
width: calc(100% - 8rem);
height: 4.1rem;
height: 3rem;
}
.input-field input:focus {
@ -87,36 +84,45 @@ nav .nav-wrapper i {
}
.input-field {
&.nav-panel-add label,
&.nav-panel-search label {
&.nav-panel-item label {
left: 1rem;
}
&.nav-panel-add .close,
&.nav-panel-search .close {
position: absolute;
top: 0;
right: 1rem;
&.nav-panel-item .close {
color: transparent;
cursor: pointer;
font-size: 2rem;
transition: 0.3s color;
}
&.nav-panel-add,
&.nav-panel-add form,
&.nav-panel-search,
&.nav-panel-search form {
&.nav-panel-item {
display: flex;
flex: 1;
flex-wrap: nowrap;
align-items: center;
}
&.nav-panel-add form.disabled,
&.nav-panel-add form.disabled input {
&.nav-panel-add.disabled,
&.nav-panel-add.disabled input {
background-color: whitesmoke;
}
}
.nav-form-button {
padding: 0;
background-color: transparent;
border: none;
&:focus {
background-color: inherit;
}
}
.nav-form-button,
.nav-panel-item .close {
margin: 0 1%;
}
#button_filters {
display: none;
}

View File

@ -21,6 +21,7 @@ div.settings div.file-field {
nav .input-field input {
margin: 0;
padding-left: 0.5rem;
}
.tabs {

View File

@ -35,6 +35,13 @@ $(document).ready(() => {
initFilters();
initExport();
const toggleNav = (toShow, toFocus) => {
$('.nav-panel-actions').hide(100);
$(toShow).show(100);
$('.nav-panels').css('background', 'white');
$(toFocus).focus();
};
$('#nav-btn-add-tag').on('click', () => {
$('.nav-panel-add-tag').toggle(100);
$('.nav-panel-menu').addClass('hidden');
@ -42,34 +49,21 @@ $(document).ready(() => {
return false;
});
$('#nav-btn-add').on('click', () => {
$('.nav-panel-buttom').hide(100);
$('.nav-panel-add').show(100);
$('.nav-panels .action').hide(100);
$('.nav-panel-menu').addClass('hidden');
$('.nav-panels').css('background', 'white');
$('#entry_url').focus();
toggleNav('.nav-panel-add', '#entry_url');
return false;
});
const materialAddForm = $('.nav-panel-add form[name=entry]');
const materialAddForm = $('.nav-panel-add');
materialAddForm.on('submit', () => {
materialAddForm.addClass('disabled');
$('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur');
});
$('#nav-btn-search').on('click', () => {
$('.nav-panel-buttom').hide(100);
$('.nav-panel-search').show(100);
$('.nav-panels .action').hide(100);
$('.nav-panel-menu').addClass('hidden');
$('.nav-panels').css('background', 'white');
$('#search_entry_term').focus();
toggleNav('.nav-panel-search', '#search_entry_term');
return false;
});
$('.close').on('click', () => {
$('.nav-panel-add').hide(100);
$('.nav-panel-search').hide(100);
$('.nav-panel-buttom').show(100);
$('.nav-panels .action').show(100);
$('.nav-panel-menu').removeClass('hidden');
$('.close').on('click', (e) => {
$(e.target).parent('.nav-panel-item').hide(100);
$('.nav-panel-actions').show(100);
$('.nav-panels').css('background', 'transparent');
return false;
});

View File

@ -26,7 +26,6 @@ framework:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: session.handler.native_file
@ -47,6 +46,7 @@ twig:
doctrine:
dbal:
driver: "%database_driver%"
driver_class: "%database_driver_class%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
@ -147,18 +147,18 @@ nelmio_cors:
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['X-Custom-Auth']
allow_headers: ['Authorization','content-type']
allow_methods: ['POST', 'PUT', 'PATCH','GET', 'DELETE']
max_age: 3600
'^/oauth/':
allow_origin: ['*']
allow_headers: ['X-Custom-Auth']
allow_headers: ['Authorization','content-type']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
'^/':
#origin_regex: true
allow_origin: ['^http://localhost:[0-9]+']
allow_headers: ['X-Custom-Auth']
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
hosts: ['^api\.']

View File

@ -23,6 +23,7 @@ swiftmailer:
doctrine:
dbal:
driver: "%test_database_driver%"
driver_class: "%test_database_driver_class%"
host: "%test_database_host%"
port: "%test_database_port%"
dbname: "%test_database_name%"

View File

@ -11,6 +11,8 @@ parameters:
# database_password: %env.database_password%
database_driver: pdo_mysql
database_driver_class: ~
# database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
database_host: 127.0.0.1
database_port: ~
database_name: wallabag

View File

@ -8,3 +8,4 @@ parameters:
test_database_path: "%env(TEST_DATABASE_PATH)%"
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
test_database_charset: utf8
test_database_driver_class: ~

View File

@ -12,7 +12,7 @@ security:
class: WallabagUserBundle:User
property: username
fos_userbundle:
id: fos_user.user_provider.username
id: fos_user.user_provider.username_email
# the main part of the security, where you can set up firewalls
# for specific sections of your app

View File

@ -1,5 +1,6 @@
parameters:
test_database_driver: pdo_mysql
test_database_driver_class: ~
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag_test

View File

@ -1,5 +1,6 @@
parameters:
test_database_driver: pdo_pgsql
test_database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
test_database_host: localhost
test_database_port:
test_database_name: wallabag_test

View File

@ -1,5 +1,6 @@
parameters:
test_database_driver: pdo_sqlite
test_database_driver_class: ~
test_database_host: localhost
test_database_port:
test_database_name: ~

View File

@ -1,5 +1,5 @@
wallabag_core:
version: 2.3.0
version: 2.3.7
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages:
en: 'English'

View File

@ -14,7 +14,7 @@ module.exports = function () {
output: {
filename: '[name].js',
path: path.resolve(rootDir, 'web/wallassets'),
publicPath: '/wallassets/',
publicPath: '',
},
plugins: [
new webpack.ProvidePlugin({

View File

@ -43,6 +43,7 @@
"ext-iconv": "*",
"ext-tokenizer": "*",
"ext-pdo": "*",
"ext-tidy": "*",
"symfony/symfony": "~3.3.13",
"doctrine/orm": "^2.5.12",
"doctrine/doctrine-bundle": "^1.8.0",
@ -64,7 +65,7 @@
"liip/theme-bundle": "^1.4.6",
"lexik/form-filter-bundle": "^5.0.4",
"j0k3r/graby": "^1.0",
"friendsofsymfony/user-bundle": "^2.0.1",
"friendsofsymfony/user-bundle": "2.0.*",
"friendsofsymfony/oauth-server-bundle": "^1.5.2",
"stof/doctrine-extensions-bundle": "^1.2",
"scheb/two-factor-bundle": "^2.14.0",
@ -83,7 +84,7 @@
"javibravo/simpleue": "^2.0",
"symfony/dom-crawler": "^3.3.13",
"friendsofsymfony/jsrouting-bundle": "^1.6.3",
"bdunogier/guzzle-site-authenticator": "^1.0.0@dev",
"bdunogier/guzzle-site-authenticator": "^1.0.0",
"defuse/php-encryption": "^2.1",
"html2text/html2text": "^4.1"
},
@ -91,10 +92,10 @@
"doctrine/doctrine-fixtures-bundle": "~2.2",
"doctrine/data-fixtures": "~1.1",
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.3",
"symfony/phpunit-bridge": "^4.2",
"friendsofphp/php-cs-fixer": "~2.0",
"m6web/redis-mock": "^2.0",
"dama/doctrine-test-bundle": "^3.0"
"dama/doctrine-test-bundle": "^4.0"
},
"scripts": {
"post-cmd": [

7708
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,10 @@ FROM php:fpm
ARG timezone='Europe/Paris'
RUN apt-get update && apt-get install -y \
libmcrypt-dev libicu-dev libpq-dev libxml2-dev libpng12-dev libjpeg-dev \
libmcrypt-dev libicu-dev libpq-dev libxml2-dev libpng-dev libjpeg-dev \
&& /usr/local/bin/docker-php-ext-configure gd --with-jpeg-dir=/usr/include \
&& docker-php-ext-install \
iconv mcrypt mbstring intl pdo pdo_mysql pdo_pgsql gd
iconv mbstring intl pdo pdo_mysql pdo_pgsql gd
RUN echo "date.timezone="$timezone > /usr/local/etc/php/conf.d/date_timezone.ini

View File

@ -1,13 +1,13 @@
{
"name": "wallabag",
"version": "2.2.2",
"version": "2.3.3",
"description": "wallabag is a self hostable application for saving web pages",
"private": true,
"directories": {
"doc": "docs"
},
"engines": {
"node": ">4.8"
"node": ">=6.10"
},
"repository": {
"type": "git",
@ -65,6 +65,7 @@
"dependencies": {
"annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85",
"hammerjs": "^2.0.8",
"highlight.js": "^9.12.0",
"icomoon-free-npm": "^0.0.0",
"jquery": "^2.1.4",
"jquery.cookie": "^1.4.1",

View File

@ -32,6 +32,6 @@
</filter>
<listeners>
<listener class="\DAMA\DoctrineTestBundle\PHPUnit\LegacyPHPUnitListener" />
<listener class="\DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener" />
</listeners>
</phpunit>

0
scripts/dev.sh Normal file → Executable file
View File

23
scripts/install.sh Normal file → Executable file
View File

@ -2,13 +2,34 @@
# You can execute this file to install wallabag
# eg: `sh install.sh prod`
IGNORE_ROOT_ARG="--ignore-root-warning"
IGNORE_ROOT=0
while :; do
case $1 in
$IGNORE_ROOT_ARG) IGNORE_ROOT=1
;;
*[a-zA-Z]) ENV=$1
;;
*) break
;;
esac
shift
done
# Abort running this script if root
if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
echo "Do not run this script as root!" >&2
echo "Use $IGNORE_ROOT_ARG to ignore this error." >&2
exit 1
fi
COMPOSER_COMMAND='composer'
DIR="${BASH_SOURCE}"
if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
. "$DIR/require.sh"
ENV=$1
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
git checkout $TAG

12
scripts/release.sh Normal file → Executable file
View File

@ -1,6 +1,6 @@
#! /usr/bin/env bash
# You can execute this file to create a new package for wallabag
# eg: `sh release.sh master /tmp wllbg-release prod`
# eg: `sh release.sh 2.3.3 /tmp wllbg-release prod`
VERSION=$1
TMP_FOLDER=$2
@ -9,12 +9,12 @@ ENV=$4
rm -rf $TMP_FOLDER/$RELEASE_FOLDER
mkdir $TMP_FOLDER/$RELEASE_FOLDER
git clone git@github.com:wallabag/wallabag.git -b $VERSION $TMP_FOLDER/$RELEASE_FOLDER/$VERSION
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV composer up -n --no-dev
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console wallabag:install --env=$ENV
git clone git@github.com:wallabag/wallabag.git -b release-$VERSION $TMP_FOLDER/$RELEASE_FOLDER/$VERSION
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV COMPOSER_MEMORY_LIMIT=-1 composer up -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 assets:install --env=$ENV --symlink --relative
cd $TMP_FOLDER/$RELEASE_FOLDER && tar czf wallabag-$VERSION.tar.gz --exclude="var/cache/*" --exclude="var/logs/*" --exclude="var/sessions/*" --exclude=".git" $VERSION
echo "MD5 checksum of the package for wallabag $VERSION"
md5 $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz
scp $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz framasoft_bag@78.46.248.87:/var/www/framabag.org/web
rm -rf $TMP_FOLDER/$RELEASE_FOLDER
echo "Package to upload to the release server:"
echo $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz

0
scripts/require.sh Normal file → Executable file
View File

27
scripts/update.sh Normal file → Executable file
View File

@ -2,14 +2,37 @@
# You can execute this file to update wallabag
# eg: `sh update.sh prod`
IGNORE_ROOT_ARG="--ignore-root-warning"
IGNORE_ROOT=0
while :; do
case $1 in
$IGNORE_ROOT_ARG) IGNORE_ROOT=1
;;
*[a-zA-Z]) ENV=$1
;;
*) break
;;
esac
shift
done
# Abort running this script if root
if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
echo "Do not run this script as root!" >&2
echo "Use $IGNORE_ROOT_ARG to ignore this error." >&2
exit 1
fi
set -e
set -u
COMPOSER_COMMAND='composer'
DIR="${BASH_SOURCE}"
if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
. "$DIR/require.sh"
ENV=$1
rm -rf var/cache/*
git fetch origin
git fetch --tags

View File

@ -28,7 +28,7 @@ class WallabagAnnotationController extends FOSRestController
->getDoctrine()
->getRepository('WallabagAnnotationBundle:Annotation')
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
$total = count($annotationRows);
$total = \count($annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows];
$json = $this->get('jms_serializer')->serialize($annotations, 'json');

View File

@ -21,7 +21,7 @@ class AnnotationRepository extends EntityRepository
public function getBuilderForAllByUser($userId)
{
return $this
->getBuilderByUser($userId)
->getSortedQueryBuilderByUser($userId)
;
}
@ -133,7 +133,7 @@ class AnnotationRepository extends EntityRepository
*
* @return QueryBuilder
*/
private function getBuilderByUser($userId)
private function getSortedQueryBuilderByUser($userId)
{
return $this->createQueryBuilder('a')
->leftJoin('a.user', 'u')

View File

@ -9,6 +9,7 @@ use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Entry;
@ -98,24 +99,28 @@ class EntryRestController extends WallabagRestController
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
$isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public');
$sort = $request->query->get('sort', 'created');
$order = $request->query->get('order', 'desc');
$sort = strtolower($request->query->get('sort', 'created'));
$order = strtolower($request->query->get('order', 'desc'));
$page = (int) $request->query->get('page', 1);
$perPage = (int) $request->query->get('perPage', 30);
$tags = is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', '');
$tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', '');
$since = $request->query->get('since', 0);
/** @var \Pagerfanta\Pagerfanta $pager */
$pager = $this->get('wallabag_core.entry_repository')->findEntries(
$this->getUser()->getId(),
$isArchived,
$isStarred,
$isPublic,
$sort,
$order,
$since,
$tags
);
try {
/** @var \Pagerfanta\Pagerfanta $pager */
$pager = $this->get('wallabag_core.entry_repository')->findEntries(
$this->getUser()->getId(),
$isArchived,
$isStarred,
$isPublic,
$sort,
$order,
$since,
$tags
);
} catch (\Exception $e) {
throw new BadRequestHttpException($e->getMessage());
}
$pager->setMaxPerPage($perPage);
$pager->setCurrentPage($page);
@ -253,7 +258,7 @@ class EntryRestController extends WallabagRestController
$limit = $this->container->getParameter('wallabag_core.api_limit_mass_actions');
if (count($urls) > $limit) {
if (\count($urls) > $limit) {
throw new HttpException(400, 'API limit reached');
}
@ -347,7 +352,7 @@ class EntryRestController extends WallabagRestController
'open_graph' => [
'og_image' => !empty($data['picture']) ? $data['picture'] : $entry->getPreviewPicture(),
],
'authors' => is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(),
'authors' => \is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(),
]
);
} catch (\Exception $e) {
@ -381,6 +386,14 @@ class EntryRestController extends WallabagRestController
}
}
if (empty($entry->getDomainName())) {
$this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
$this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
}
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
$em->flush();
@ -453,7 +466,7 @@ class EntryRestController extends WallabagRestController
$contentProxy->updateLanguage($entry, $data['language']);
}
if (!empty($data['authors']) && is_string($data['authors'])) {
if (!empty($data['authors']) && \is_string($data['authors'])) {
$entry->setPublishedBy(explode(',', $data['authors']));
}
@ -490,6 +503,14 @@ class EntryRestController extends WallabagRestController
$entry->setOriginUrl($data['origin_url']);
}
if (empty($entry->getDomainName())) {
$this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
$this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
}
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
$em->flush();
@ -549,16 +570,32 @@ class EntryRestController extends WallabagRestController
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* },
* parameters={
* {"name"="expect", "dataType"="string", "required"=false, "format"="id or entry", "description"="Only returns the id instead of the deleted entry's full entity if 'id' is specified. Default to entry"},
* }
* )
*
* @return JsonResponse
*/
public function deleteEntriesAction(Entry $entry)
public function deleteEntriesAction(Entry $entry, Request $request)
{
$expect = $request->query->get('expect', 'entry');
if (!\in_array($expect, ['id', 'entry'], true)) {
throw new BadRequestHttpException(sprintf("expect: 'id' or 'entry' expected, %s given", $expect));
}
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$response = $this->sendResponse([
'id' => $entry->getId(),
]);
// We clone $entry to keep id in returned object
if ('entry' === $expect) {
$e = clone $entry;
$response = $this->sendResponse($e);
}
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
$em->flush();
@ -566,7 +603,7 @@ class EntryRestController extends WallabagRestController
// entry deleted, dispatch event about it!
$this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
return $this->sendResponse($entry);
return $response;
}
/**

View File

@ -46,12 +46,14 @@ class TagRestController extends WallabagRestController
$this->validateAuthentication();
$label = $request->get('tag', '');
$tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($label);
$tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$label], $this->getUser()->getId());
if (empty($tag)) {
if (empty($tags)) {
throw $this->createNotFoundException('Tag not found');
}
$tag = $tags[0];
$this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->removeTag($this->getUser()->getId(), $tag);
@ -80,15 +82,7 @@ class TagRestController extends WallabagRestController
$tagsLabels = $request->get('tags', '');
$tags = [];
foreach (explode(',', $tagsLabels) as $tagLabel) {
$tagEntity = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($tagLabel);
if (!empty($tagEntity)) {
$tags[] = $tagEntity;
}
}
$tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
if (empty($tags)) {
throw $this->createNotFoundException('Tags not found');
@ -120,6 +114,12 @@ class TagRestController extends WallabagRestController
{
$this->validateAuthentication();
$tagFromDb = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
if (empty($tagFromDb)) {
throw $this->createNotFoundException('Tag not found');
}
$this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->removeTag($this->getUser()->getId(), $tag);
@ -138,14 +138,14 @@ class TagRestController extends WallabagRestController
*/
private function cleanOrphanTag($tags)
{
if (!is_array($tags)) {
if (!\is_array($tags)) {
$tags = [$tags];
}
$em = $this->getDoctrine()->getManager();
foreach ($tags as $tag) {
if (0 === count($tag->getEntries())) {
if (0 === \count($tag->getEntries())) {
$em->remove($tag);
}
}

View File

@ -11,7 +11,7 @@ use Wallabag\UserBundle\Entity\User;
/**
* @ORM\Table("oauth2_clients")
* @ORM\Entity
* @ORM\Entity(repositoryClass="Wallabag\ApiBundle\Repository\ClientRepository")
*/
class Client extends BaseClient
{

View File

@ -0,0 +1,19 @@
<?php
namespace Wallabag\ApiBundle\Repository;
use Doctrine\ORM\EntityRepository;
class ClientRepository extends EntityRepository
{
public function findOneBy(array $criteria, array $orderBy = null)
{
if (!empty($criteria['id'])) {
// cast client id to be an integer to avoid postgres error:
// "invalid input syntax for integer"
$criteria['id'] = (int) $criteria['id'];
}
return parent::findOneBy($criteria, $orderBy);
}
}

View File

@ -51,7 +51,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
} else {
$users = $this->getContainer()->get('wallabag_user.user_repository')->findAll();
$this->io->text(sprintf('Cleaning through <info>%d</info> user accounts', count($users)));
$this->io->text(sprintf('Cleaning through <info>%d</info> user accounts', \count($users)));
foreach ($users as $user) {
$this->io->text(sprintf('Processing user <info>%s</info>', $user->getUsername()));
@ -79,7 +79,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
$url = $this->similarUrl($entry['url']);
/* @var $entry Entry */
if (in_array($url, $urls, true)) {
if (\in_array($url, $urls, true)) {
++$duplicatesCount;
$em->remove($repo->find($entry['id']));
@ -96,8 +96,8 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
private function similarUrl($url)
{
if (in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls
return substr($url, 0, strlen($url));
if (\in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls
return substr($url, 0, \strlen($url));
}
return $url;

View File

@ -47,7 +47,7 @@ class ExportCommand extends ContainerAwareCommand
->getQuery()
->getResult();
$io->text(sprintf('Exporting <info>%d</info> entrie(s) for user <info>%s</info>...', count($entries), $user->getUserName()));
$io->text(sprintf('Exporting <info>%d</info> entrie(s) for user <info>%s</info>...', \count($entries), $user->getUserName()));
$filePath = $input->getArgument('filepath');

View File

@ -64,7 +64,7 @@ class InstallCommand extends ContainerAwareCommand
;
$this->io->success('Wallabag has been successfully installed.');
$this->io->note('Just execute `php bin/console server:run --env=prod` for using wallabag: http://localhost:8000');
$this->io->success('You can now configure your web server, see https://doc.wallabag.org');
}
protected function checkRequirements()
@ -81,7 +81,7 @@ class InstallCommand extends ContainerAwareCommand
$status = '<info>OK!</info>';
$help = '';
if (!extension_loaded($this->getContainer()->getParameter('database_driver'))) {
if (!\extension_loaded($this->getContainer()->getParameter('database_driver'))) {
$fulfilled = false;
$status = '<error>ERROR!</error>';
$help = 'Database driver "' . $this->getContainer()->getParameter('database_driver') . '" is not installed.';
@ -146,7 +146,7 @@ class InstallCommand extends ContainerAwareCommand
$status = '<info>OK!</info>';
$help = '';
if (!function_exists($functionRequired)) {
if (!\function_exists($functionRequired)) {
$fulfilled = false;
$status = '<error>ERROR!</error>';
$help = 'You need the ' . $functionRequired . ' function activated';
@ -371,7 +371,7 @@ class InstallCommand extends ContainerAwareCommand
}
try {
return in_array($databaseName, $schemaManager->listDatabases(), true);
return \in_array($databaseName, $schemaManager->listDatabases(), true);
} catch (\Doctrine\DBAL\Exception\DriverException $e) {
// it means we weren't able to get database list, assume the database doesn't exist
@ -389,6 +389,6 @@ class InstallCommand extends ContainerAwareCommand
{
$schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
return count($schemaManager->listTableNames()) > 0 ? true : false;
return \count($schemaManager->listTableNames()) > 0 ? true : false;
}
}

View File

@ -50,7 +50,7 @@ class ListUserCommand extends ContainerAwareCommand
$io->success(
sprintf(
'%s/%s%s user(s) displayed.',
count($users),
\count($users),
$nbUsers,
null === $input->getArgument('search') ? '' : ' (filtered)'
)

View File

@ -43,7 +43,7 @@ class ReloadEntryCommand extends ContainerAwareCommand
$entryRepository = $this->getContainer()->get('wallabag_core.entry_repository');
$entryIds = $entryRepository->findAllEntriesIdByUserId($userId);
$nbEntries = count($entryIds);
$nbEntries = \count($entryIds);
if (!$nbEntries) {
$io->success('No entry to reload.');

View File

@ -348,7 +348,7 @@ class ConfigController extends Controller
$em = $this->getDoctrine()->getManager();
foreach ($tags as $tag) {
if (0 === count($tag->getEntries())) {
if (0 === \count($tag->getEntries())) {
$em->remove($tag);
}
}

View File

@ -502,6 +502,14 @@ class EntryController extends Controller
$message = 'flashes.entry.notice.' . $prefixMessage . '_failed';
}
if (empty($entry->getDomainName())) {
$this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
$this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
}
$this->get('session')->getFlashBag()->add('notice', $message);
}

View File

@ -58,6 +58,7 @@ class ExportController extends Controller
$method = ucfirst($category);
$methodBuilder = 'getBuilderFor' . $method . 'ByUser';
$repository = $this->get('wallabag_core.entry_repository');
$title = $method;
if ('tag_entries' === $category) {
$tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag'));
@ -66,6 +67,8 @@ class ExportController extends Controller
$this->getUser()->getId(),
$tag->getId()
);
$title = 'Tag ' . $tag->getLabel();
} else {
$entries = $repository
->$methodBuilder($this->getUser()->getId())
@ -76,7 +79,7 @@ class ExportController extends Controller
try {
return $this->get('wallabag_core.helper.entries_export')
->setEntries($entries)
->updateTitle($method)
->updateTitle($title)
->updateAuthor($method)
->exportAs($format);
} catch (\InvalidArgumentException $e) {

View File

@ -12,7 +12,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\UserBundle\Entity\User;

View File

@ -65,7 +65,7 @@ class TagController extends Controller
$em->flush();
// remove orphan tag in case no entries are associated to it
if (0 === count($tag->getEntries())) {
if (0 === \count($tag->getEntries())) {
$em->remove($tag);
$em->flush();
}

View File

@ -14,97 +14,112 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
*/
public function load(ObjectManager $manager)
{
$entry1 = new Entry($this->getReference('admin-user'));
$entry1->setUrl('http://0.0.0.0/entry1');
$entry1->setReadingTime(11);
$entry1->setDomainName('domain.io');
$entry1->setMimetype('text/html');
$entry1->setTitle('test title entry1');
$entry1->setContent('This is my content /o/');
$entry1->setLanguage('en');
$entries = [
'entry1' => [
'user' => 'admin-user',
'url' => 'http://0.0.0.0/entry1',
'reading_time' => 11,
'domain' => 'domain.io',
'mime' => 'text/html',
'title' => 'test title entry1',
'content' => 'This is my content /o/',
'language' => 'en',
'tags' => ['foo-tag', 'baz-tag'],
],
'entry2' => [
'user' => 'admin-user',
'url' => 'http://0.0.0.0/entry2',
'reading_time' => 1,
'domain' => 'domain.io',
'mime' => 'text/html',
'title' => 'test title entry2',
'content' => 'This is my content /o/',
'origin' => 'ftp://oneftp.tld',
'language' => 'fr',
],
'entry3' => [
'user' => 'bob-user',
'url' => 'http://0.0.0.0/entry3',
'reading_time' => 1,
'domain' => 'domain.io',
'mime' => 'text/html',
'title' => 'test title entry3',
'content' => 'This is my content /o/',
'language' => 'en',
'tags' => ['foo-tag', 'bar-tag', 'bob-tag'],
],
'entry4' => [
'user' => 'admin-user',
'url' => 'http://0.0.0.0/entry4',
'reading_time' => 12,
'domain' => 'domain.io',
'mime' => 'text/html',
'title' => 'test title entry4',
'content' => 'This is my content /o/',
'language' => 'en',
'tags' => ['foo-tag', 'bar-tag'],
],
'entry5' => [
'user' => 'admin-user',
'url' => 'http://0.0.0.0/entry5',
'reading_time' => 12,
'domain' => 'domain.io',
'mime' => 'text/html',
'title' => 'test title entry5',
'content' => 'This is my content /o/',
'language' => 'fr',
'starred' => true,
'preview' => 'http://0.0.0.0/image.jpg',
],
'entry6' => [
'user' => 'admin-user',
'url' => 'http://0.0.0.0/entry6',
'reading_time' => 12,
'domain' => 'domain.io',
'mime' => 'text/html',
'title' => 'test title entry6',
'content' => 'This is my content /o/',
'language' => 'de',
'archived' => true,
'tags' => ['bar-tag'],
],
];
$entry1->addTag($this->getReference('foo-tag'));
$entry1->addTag($this->getReference('baz-tag'));
foreach ($entries as $reference => $item) {
$entry = new Entry($this->getReference($item['user']));
$entry->setUrl($item['url']);
$entry->setReadingTime($item['reading_time']);
$entry->setDomainName($item['domain']);
$entry->setMimetype($item['mime']);
$entry->setTitle($item['title']);
$entry->setContent($item['content']);
$entry->setLanguage($item['language']);
$manager->persist($entry1);
if (isset($item['tags'])) {
foreach ($item['tags'] as $tag) {
$entry->addTag($this->getReference($tag));
}
}
$this->addReference('entry1', $entry1);
if (isset($item['origin'])) {
$entry->setOriginUrl($item['origin']);
}
$entry2 = new Entry($this->getReference('admin-user'));
$entry2->setUrl('http://0.0.0.0/entry2');
$entry2->setReadingTime(1);
$entry2->setDomainName('domain.io');
$entry2->setMimetype('text/html');
$entry2->setTitle('test title entry2');
$entry2->setContent('This is my content /o/');
$entry2->setOriginUrl('ftp://oneftp.tld');
$entry2->setLanguage('fr');
if (isset($item['starred'])) {
$entry->setStarred($item['starred']);
}
$manager->persist($entry2);
if (isset($item['archived'])) {
$entry->setArchived($item['archived']);
}
$this->addReference('entry2', $entry2);
if (isset($item['preview'])) {
$entry->setPreviewPicture($item['preview']);
}
$entry3 = new Entry($this->getReference('bob-user'));
$entry3->setUrl('http://0.0.0.0/entry3');
$entry3->setReadingTime(1);
$entry3->setDomainName('domain.io');
$entry3->setMimetype('text/html');
$entry3->setTitle('test title entry3');
$entry3->setContent('This is my content /o/');
$entry3->setLanguage('en');
$entry3->addTag($this->getReference('foo-tag'));
$entry3->addTag($this->getReference('bar-tag'));
$manager->persist($entry3);
$this->addReference('entry3', $entry3);
$entry4 = new Entry($this->getReference('admin-user'));
$entry4->setUrl('http://0.0.0.0/entry4');
$entry4->setReadingTime(12);
$entry4->setDomainName('domain.io');
$entry4->setMimetype('text/html');
$entry4->setTitle('test title entry4');
$entry4->setContent('This is my content /o/');
$entry4->setLanguage('en');
$entry4->addTag($this->getReference('foo-tag'));
$entry4->addTag($this->getReference('bar-tag'));
$manager->persist($entry4);
$this->addReference('entry4', $entry4);
$entry5 = new Entry($this->getReference('admin-user'));
$entry5->setUrl('http://0.0.0.0/entry5');
$entry5->setReadingTime(12);
$entry5->setDomainName('domain.io');
$entry5->setMimetype('text/html');
$entry5->setTitle('test title entry5');
$entry5->setContent('This is my content /o/');
$entry5->setStarred(true);
$entry5->setLanguage('fr');
$entry5->setPreviewPicture('http://0.0.0.0/image.jpg');
$manager->persist($entry5);
$this->addReference('entry5', $entry5);
$entry6 = new Entry($this->getReference('admin-user'));
$entry6->setUrl('http://0.0.0.0/entry6');
$entry6->setReadingTime(12);
$entry6->setDomainName('domain.io');
$entry6->setMimetype('text/html');
$entry6->setTitle('test title entry6');
$entry6->setContent('This is my content /o/');
$entry6->setArchived(true);
$entry6->setLanguage('de');
$entry6->addTag($this->getReference('bar-tag'));
$manager->persist($entry6);
$this->addReference('entry6', $entry6);
$manager->persist($entry);
$this->addReference($reference, $entry);
}
$manager->flush();
}

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