* Possiblity to autoinstall in Docker Compose
#fix https://github.com/FreshRSS/FreshRSS/issues/3349
It is simply calling our existing CLI: do-install.php and
create-user.php
https://github.com/FreshRSS/FreshRSS/tree/master/cli
FreshRSS will typically be ready a few seconds before the database, so
introduce a tolerance when the database is not available / up (yet) by
trying a few times to connect. Also useful to avoid service interruption
when DB service is restarted.
Example:
```yml
freshrss-app:
image: freshrss/freshrss
container_name:
freshrss-app
hostname: freshrss-app
restart: unless-stopped
ports:
- "8080:80"
depends_on:
- freshrss-db
volumes:
- data:/var/www/FreshRSS/data
-
extensions:/var/www/FreshRSS/extensions
environment:
CRON_MIN:
'*/20'
FRESHRSS_ENV: development
FRESHRSS_INSTALL: |-
--api_enabled
--base_url https://rss.example.net
--db-base freshrss
--db-host freshrss-db
--db-password
freshrss
--db-type pgsql
--db-user freshrss
--default_user admin
--language en
FRESHRSS_USER: |-
--api_password freshrss
--email user@example.net
--language en
--password freshrss
--user admin
TZ:
Europe/Paris
```
* Minor type f in find
* shellcheck
Before, we had 5 classes in the ModelPdo file. It was bad for 2 reasons.
The first reason is that it is considered bad practice to have multiple
class in one file. This is especially true when using autoloading. On top
of that it is less readable considering the size of the file. The second
reason is that so far we were lucky. Everytime we needed to access the
database, it was through the ModelPdo class which loads all the other
classes. If we want to access directly the connection, it wont be loaded.
On top of that, the system is configured to work on a single database,
but as we have every connection definition in a single file, all classes
were loaded at the same time. Thus using memory and processing time for
nothing.
Now, we have a file for each class. To work with autoloading, classes
were slightly renamed to match autoloading rules.
Before, we had 5 classes in the ModelPdo file. It was bad for 2 reasons.
The first reason is that it is considered bad practice to have multiple
class in one file. This is especially true when using autoloading. On top
of that it is less readable considering the size of the file. The second
reason is that so far we were lucky. Everytime we needed to access the
database, it was through the ModelPdo class which loads all the other
classes. If we want to access directly the connection, it wont be loaded.
On top of that, the system is configured to work on a single database,
but as we have every connection definition in a single file, all classes
were loaded at the same time. Thus using memory and processing time for
nothing.
Now, we have a file for each class. To work with autoloading, classes
were slightly renamed to match autoloading rules.
* Minz: support PHP8 lint
Fix PHP8 Fatal error: Declaration of MinzPDO::query($statement) must be
compatible with PDO::query(string $query, ?int $fetch_mode = null, mixed
...$fetch_mode_args) in /FreshRSS/lib/Minz/ModelPdo.php on line 159
Errors parsing /FreshRSS/lib/Minz/ModelPdo.php
* Fix argument name
* Please phpcs in Travis
For a moment, PHP wasn't able to connect to my database. I tried to
understand what happened, unfortunately, the logs were not very helpful
(it basically showed me information that I had in my configuration
file).
I changed the dsn string by the message from the raised exception, I
think it will be more useful.
Other call of Minz_PDOConnectionException are passing error messages
instead of string connection, so I took the opportunity to rename the
constructor argument.
* PDO refactor
* Automatic prefix when using the syntax `_tableName`
* Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query
* Use PDO methods exec(), query(), prepare() + execute() in a more efficient way
* Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old)
* The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language)
* Rename `->bd` to `->pdo` (less of a frenshism, and more informative)
* Fix some requests, which were not compatible with MySQL prepared statements
* Whitespace
* Fix syntax for PostgreSQL sequences
+ MySQL install
* Minor formatting
* Fix lastInsertId for PostgreSQL
* Use PHP 5.6+ const
Take advantage of https://github.com/FreshRSS/FreshRSS/pull/2527https://www.php.net/manual/en/migration56.new-features.php
* A bit of forgotten PHP 5.6 simplification for cURL
* Forgotten $s
* Mini fix custom user config
https://github.com/FreshRSS/FreshRSS/pull/2490/files#r326290346
* More work on install.php but not finished
* install.php working
* More cleaning of PDO in install
* Even more simplification
Take advantage of PDO->exec() to run multiple statements
* Disallow changing the name of the default category
https://github.com/FreshRSS/FreshRSS/pull/2522#discussion_r326967724
* CLI to export/import any database to/from SQLite
Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/pull/2495
* Travis
* Execution rights
* Fix wrong static fields
* Fix MySQL bad default buffering
https://stackoverflow.com/questions/6895098/pdo-mysql-memory-consumption-with-large-result-set/6935271#6935271https://php.net/manual/ref.pdo-mysql
* Fix count on progression
* Avoid static DB information
To ease working with two DBs at the same time
* Less static, simplify
Needs some testing
* Small corrections
* Special case for SQLite to SQLite
* Modify special case for SQLite
* Remove special case for SQLite
More uniform logic for the 3 databases.
Fix wrong DROP TABLE for SQLite.
* Drop indexes
* Revert "Drop indexes"
This reverts commit f28d2bae09.
* Fix deletion
* Fix classic export
* Update cli/README.md
Co-Authored-By: Marien Fressinaud <dev@marienfressinaud.fr>
* Addressing part of review
* Remove goto 😢
* Travis
* Comment for SQLite case
* Fix missing fields when inserting
* Require PHP 5.5+
https://github.com/FreshRSS/FreshRSS/issues/2469#issuecomment-522255093
I think it would be reasonable to require PHP 5.5+ for the core of
FreshRSS after all.
As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the
most popular PHP application.
We would loose about 20% of the PHP servers according to
https://w3techs.com/technologies/details/pl-php/5/all but I expect this
number to drop fast after the release of CentOS 8 (CentOS accounts for
17% of Linux servers
https://w3techs.com/technologies/details/os-linux/all/all ).
Distributions:
* no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze,
Mageia, as all active versions have PHP > 7
* no impact on OpenSuze, Synology, as all active versions have PHP > 5.5
* we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch
(2017-06) - current is Debian 10 Buster
* we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05)
* we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released
soonish)
When dropping older versions, I can better like when it is for a good
reason, and there is actually one with PHP 5.5, namely generators
(yield) https://php.net/language.generators.overview which I consider
using.
* Version note for JSON.php
* hex2bin
* Update .travis.yml
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
* [ci] Add Travis
* Exclude some libs
* Semi-auto whitespace fixes
* line length in SQLite
* Exclude tests from line length
* Feed.php line length
* Feed.php: get rid of unnecessary concat
* Feed.php: line length
* bootstrap.php: no newline at end of file
* Allow concatenating across multiple lines
* Add Travis badge
* do-install line length
* update-or-create-user line length
* cli/create-user line length
* tests/app/Models/SearchTest.php fix indentation
* tests/app/Models/UserQueryTest.php fix indentation
* tests/app/Models/CategoryTest.php fix indentation
* [fix] PHP 5.3 on precise
* cli/do-install no spaces
* cli/list-users line length
* cli/reconfigure line length
* empty catch statements
* api/index line length nonsense
* spaces before semicolon
* app/Models/EntryDAO bunch of indentation
* extra blank lines
* spaces before comma in function call
* testing tabwidth
* increase to 10
* comment out tabwidth line
* try older phpcs version 3.0.0RC4
* line length exception for app/install.php
* proper spaces
* stray spaces in i18n
* Minz/ModelPdo line length
* Minz whitespace
* greader line length
* greader elseif placement
* app/Models/Feed.php spacing in function argument
* ignore php 5.3
* app/Models/ConfigurationSetter.php stray whitespace
* EntryDAOSQLite line length
* I vote for higher max line length =P
* ignore SQL
* remove classname complaint
* line length/more legible SQL
* ignore line length nonsense
* greader line length
* feedController issues
* uppercase TRUE, FALSE, NULL
* revert
* importExportController lowercase null
* Share.php default value not necessary because ! is_array () a few lines down
* CategoryDAO constants should be UPPERCASE
* EntryDAO reduce line length
* contentious autofix
* Allow failures on all versions of PHP except 7.1 because reasons
- Use only Minz_Configuration
- register() method to load a new configuration file
- get() to get a configuration
- new exceptions related to configuration
- fix a list configuration calls to have FRSS working
Current problems to resolve:
- How to handle configuration param verifications (i.e. check auth_type
is a value from none, http_auth, persona or form)
- We must use $conf = Minz_Configuration::get('system'); $general_conf = $conf->general;
to access global system configuration which is quite annoying. How to change that?
See https://github.com/FreshRSS/FreshRSS/issues/730
- Create ./data/users/ folder
- Move user configuration to ./data/users/username/config.php
- Move sqlite db to ./data/users/username/db.sqlite
- Move user logs to ./data/users/username/log.txt
See https://github.com/FreshRSS/FreshRSS/issues/729
* Messages plus verbeux dans actualize_script
* Ajout d'un message syslog lorsque SimplePie fait une requête HTTP
* Minz_Session ne fermait pas les sessions complètement.
* Nouvelle option dans Minz_Dispatcher et Minz_FrontController pour ne
pas utiliser ob_gzhandler.
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
C'est parti de changements pour
https://github.com/marienfressinaud/FreshRSS/issues/255 et finalement
j'ai continué la refactorisation...
Ajout de préfixes FreshRSS_ et Minz_ sur le modèle de SimplePie_.
Toutes les classes sont maintenant en chargement automatique (devrait
améliorer les performances en évitant de charger plein de classes
inutilisées, et faciliter la maintenance).
Suppression de set_include_path().
Si souhaité, certaines classes de Minz pourraient être déplacées dans un
sous-répertoire, par exemple les exceptions.
Tests et relecture nécessaires.
Passage en microsecondes pour le touch (gestion du cache) pour éviter
les problèmes en particulier dans le cas de requêtes de moins d'une
seconde.
Nouvelle fonction invalidateHttpCache() pour plus facilement changer de
méthode de contrôle de fraîcheur de cache.
Devrait résoudre https://github.com/marienfressinaud/FreshRSS/issues/296