`file_put_contents` can return 0 if there’s nothing to write in the
`applied_migrations.txt` file, which is equivalent to `false`. Since
there are no migrations yet, this is what happens. Because this value
(i.e. `0`) is tested next in the `app/install.php` file, the install
script was failing.
* Add a Minz_Migrator class
Until now, we updated the database structure somewhere in the code but
it wasn't always consistent and somehow complicated to find. Also, this
code was always checked for nothing.
The Migrator aims to improve and ease the creation of migrations. It
should improve the way we apply the updates, making the update server
almost useless.
References:
- example of migration (before Migrator): cc0db9af4f (diff-11a53443fa81512b128c66b065df0679R10)
- update server: https://github.com/FreshRSS/update.freshrss.org
- PR moving the code of the update server to the core: https://github.com/FreshRSS/FreshRSS/pull/1760
* Automatically apply migrations
For now, administrators are used to have nothing to do during an update
else than getting the new code. I suggest to keep this behaviour and
automatically apply migrations if we detect new ones.
Another solution would be to create a CLI command and ask admins to call
it after getting the new code. It could hide migrations errors to end
users, but admin can forget to apply migrations since there are not used
to it.
* Add documentation for Minz Migrator
* Execute migrations even if next ones are applied
* Change mechanism to prevent multiple update at once
* Use mkdir to create the lock and to test it exists
Reference: https://stackoverflow.com/a/731634
* Append .lock to applied_migrations_path
There are no needs to define another file to serve as a lock.
* Change migrations naming convention
* Apply suggestions from code review
Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>
* Perform a low-cost migration versions comparaison
* Clarify version numbers concerning the migration system
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Before, to update a key from the reference language (en), the key was deleted
then created. This way was unproductive for all keys already translated.
Now, the key is updated in all untranslated languages.
See https://github.com/FreshRSS/FreshRSS/pull/3068#issuecomment-646868894
FeedMe is able to add/remove subscriptions.
Fix minor bug introduced by
https://github.com/FreshRSS/FreshRSS/pull/1731
If the category ID is provided, we must first search for the existing
category before trying to add a category with the provided name.
Fix:
```
SQL error addCategory: ["23000",19,"UNIQUE constraint failed:
category.name"]
```
* Add auto-registration when using http_auth
* Document HTTP auth auto-registration
* Check email variable for HTTP auth auto-registration
* Auto-create HTTP users by default
* Fix Context init
(I will provide in another PR a better fix requiring a bit of global refactoring)
* Init language
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Initial locaization from international english to United States English
examples:
favourite -> favorite
optimise -> optimize
occured -> occurred
labelled -> labelled
ok -> okay
* More spelling corrections
default English occured->occurred
cancelled -> canceled
labelled -> labeled
* Undo key spelling change
* i18n format and admin.php translating
* Translating admin.php
* more admin.php translating
* Translating conf.php
* Translating feedback.php and format command
* Translating gen.php
* Translating index.php
* Translating sub.php
* Translating user.php
* Translating install.php
* Fix 'there is no idle feed'
* FIx 'there is no feed to refresh"
* Add i18n manipulation option to ignore all unmodified translation keys
* Lint fixes
* Update keys newly add since original branch
* Revert unintenntional ru 'translation'
* Code review revisions
* Fix leading whitespace in ignore_unmodified api
* Update app/i18n/en-us/gen.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update app/i18n/en-us/admin.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update app/i18n/en-us/admin.php
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update error message for Make ignore-unmodified keys to use Make syntax.
(inline with 3062) Also rename ignore-unmodifed-key ->
ignore-unmodified-keys
* Replace makefile leading spaces with tabs
* Code review revisions
* Retab added php functions
* Missed tab replace
* Remove stray '-> todo'
Co-authored-by: root <root@x-freshrss.lan.ewsandor.com>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Even if the issue #3035 seemed pretty simple at a first glance, it was
more complicated than I expected. Because we send CSP headers AFTER
running the controller actions, it means we can't "echo" any content
from the controller. It's in fact a good practice, but it was easier at
the time we developed the feature.
To fix that, the only thing I had to do was to move the `print()` and
`readfile()` function into the view. The problem was that we needed to
output the content from the CLI too. Then, things became more
complicated. I decided to extract the export-related methods in a
`FreshRSS_Export_Service` class, in order to use it from both the
controller and the CLI. It was an opportunity to refactor the whole
feature in order to make it a bit more linear and easy to read.
Reference: https://github.com/FreshRSS/FreshRSS/issues/3035
* Remove line from ansum.css, fixing contrast
As with #3047#3048, current behavior produces very pale-on-white text in inline code tags
* Update CREDITS.md
#3048 and related
By default, the container starts without extensions. But if for some reasons,
you need to add them without copying or moving some code, you can embed them
while starting the container. The syntax is:
```
make start extensions="/full/path/to/extension/1 /full/path/to/extension/2"
```
Before, all new languages were generated from the reference language which
was English. It makes sense for new languages but not so much for new language
flavor (ex: French Canadian versus French French)
Now, there is a way to select the reference language while adding a new one.
* Return the correct Content-Type for SVG favicons
* Use mime_content_type to check file type
* Use tab instead of spaces
* Remove extra blank lines
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* Update f.php
* Better obey HTTP/1.1 304 Not Modified rules about headers https://tools.ietf.org/html/rfc2616#section-10.3.5
* Do not fail if the optional `fileinfo` is not available
* Handle more cases such as PNG, GIF, BMP...
* Add Content-Type for default favicon
* Do not repeat HTTP headers in HTTP 304 response
According to https://tools.ietf.org/html/rfc2616#section-10.3.5 it is better not to repeat HTTP headers in a HTTP 304 Not Modified response
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Before, the user queries were working filter-wise but they failed at being displayed
properly in the configuration page. Thus they were stored without the search param.
Now, the search is URL encoded to avoid that kind of behavior and keep the search
param through out the user query's life.
Now, there is a shortcut to play or pause media available from an
entry. If there is more than one media available, only the first
one will be targeted.
See #1952
Before, when the user was not logged in, pages where translated with the '_' user language.
Now, they are translated with the user preferred language if there is one supported by FreshRSS or with the system default language.
The login form layout was broken for BlueLagoon and Screwdriver themes. The 'about' link was
displayed next to the form since the later didn't have a height. I removed completely the
rule since it seems that it has no effect, except the one aforementioned.
* Fix display_categories upgrade from 1.16.0
#fix https://github.com/FreshRSS/FreshRSS/issues/3017
The property `'display_categories' => boolean,` in 1.16.0 is not properly converted to `'display_categories' => 'string',` in 1.16.1 due to a weak type comparison bug.