Commit Graph

44 Commits

Author SHA1 Message Date
Thomas Renes
916df412f5 Fix various typos and spelling errors in documentation, comments and code. (#4134) 2022-01-08 16:25:17 +01:00
Alexandre Alapetite
1335a0e3cf PHPStan level 5 (#4110)
* Fix most PHPDocs errors
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103
https://phpstan.org/writing-php-code/phpdoc-types

* Avoid func_get_args
Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list
And avoid dynamic functions names when possible to more easily identify calls and unused functions.
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103

* PHPStan level 3

* PHPStand level 4

* Update default to PHPStan level 4

* Towards level 5

* Fix level 4 regression

* Towards level 5

* Pass PHPStan level 5

* Towards level 6

* Remove erronenous regression from changelog
https://github.com/FreshRSS/FreshRSS/pull/4116
2022-01-04 13:59:09 +01:00
Alexandre Alapetite
77e9877316 Add PHPStan (#4021)
* Add PHPStan
#fix https://github.com/FreshRSS/FreshRSS/issues/4016
https://phpstan.org/

```sh
composer run-script phpstan
```

* More fixes

* Fix global variables

* Add .phtml

* Fix merge
https://github.com/FreshRSS/FreshRSS/pull/4090

* Fix more warnings

* Fix view errors and enable in CI

* ReturnTypeWillChange

* Dynamic view type

* Fix Minz static/self bug
2021-12-31 17:00:51 +01:00
Alexandre Alapetite
fe295f50d0 Lint i18n files (#3841)
Translations had quite a lot of cleaning in late:
* Removed some unused keys
* Added some ignores
* Applied a `cli/manipulate.translation.php -a format`
2021-09-12 11:37:15 +02:00
Alexis Degrugillier
cc0db9af4f Feature/new archiving (#2335)
* Change archiving config page layout

I've changed some wording and moved actions into a
maintenance section.

* Update purge action

Now we have more control on the purge action. The configuration allows
us to choose what to keep and what to discard in a more precise way.
At the moment, the configuration applies for all feeds.

* Add purge configuration on feed level

Now the extend purge configuration is available on feed level.
It is stored as attributes and will be used in the purge action.

* Update purge action

Now the purge action uses the feed configuration if it exists and
defaults on user configuration if not.

* Add empty option in period list

* Fix configuration warnings

* Add archiving configuration on categories

See #2369

* Add user info back

* Add explanations in UI

* Fixes for SQLite + error + misc.

* Fix invalid feed reference

* Short array syntax

Only for new code, so far

* Fix prefix error

* Query performance, default values

Work in progress

* Fix default values and confirm before leaving

Form cancel and confirm changes before leaving were broken.
And start taking advantage of the short echo syntax `<?= ?>` as we have
moved to PHP 5.4+

* More work

* Tuning SQL

* Fix MariaDB + performance issue

* SQL performance

* Fix SQLite bug

* Fix some attributes JSON encoding bugs

Especially for SQLite export/import

* More uniform, fix bugs

More uniform between global, category, feed settings

* Drop special cases for old articles during refresh

Instead will use lastSeen date with the new archiving logic.
This was generating problems anyway
https://github.com/FreshRSS/FreshRSS/issues/2154

* Draft drop index keep_history

Not needed anymore

* MySQL typo

Now properly tested with MySQL, PostgreSQL, SQLite

* More work for legacy values

Important to avoid overriding user's preference and risking deleting
data erroneously

* Fix PHP 7.3 / 7.4 warnings

@aledeg "Trying to use values of type null, bool, int, float or resource
as an array (such as $null["key"]) will now generate a notice. "
https://php.net/migration74.incompatible

* Reintroduce min articles and take care of legacy parameters

* A few changes forgotten

* Draft of migration + DROP of feed.keep_history

* Fix several errors

And give up using const for SQL to allow multiple database types (and we
cannot redefine a const)

* Add keep_min to categories + factorise archiving logic

* Legacy fix

* Fix bug yield from

* Minor: Use JSON_UNESCAPED_SLASHE for attributes

And make more uniform

* Fix sign and missing variable

* Fine tune the logic
2019-10-23 00:52:15 +02:00
Marien Fressinaud
49e1a2c579 Allow to change the view layout (#2467)
The `_useLayout` function is marked as deprecated, replaced by a more
powerful `_layout` function.
2019-08-02 11:40:57 +02:00
Alexandre Alapetite
4888f919f1 Prepare for batch mark as read 2018-12-25 01:30:28 +01:00
Alexandre Alapetite
c57aade0f2 Introduce a routine for minor DB maintenance (#2080) 2018-10-26 21:05:00 +02:00
Alexandre Alapetite
307e6995fe MySQL GUID case sensitive (#2078)
* MySQL GUID case sensitive

latin1_bin
https://github.com/FreshRSS/FreshRSS/issues/2077

* Prepare update for existing bases

* Perform DB update during actualize

* Reduce frequency slightly

* No optimize at the same time

* Take advantage of the SQL modifications in 1.12

* Move higher up

* Move to purge, which all users can manually call
2018-10-25 22:43:13 +02:00
Alexandre Alapetite
8ee8a573f1 Custom labels (#2027)
* First draft of custom tags

https://github.com/FreshRSS/FreshRSS/issues/928
https://github.com/FreshRSS/FreshRSS/issues/1367

* SMALLINT to BIGINT for id_entry

And uppercase SQL types

* Fix layout for unreads

* Start UI menu

* Change menu order

* Clean database helpers

https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535

* Travis rules do not understand PostgreSQL constants

Grrr

* Tag controller + UI

* Add column attributes to tags

* Use only favicon for now, for label

* Fix styling for different themes

* Constant for maximum InnoDB index length in Unicode

https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200
(I would have personnally prefered keeping the readability of a real
value instead of a constant, in this case of many SQL fields)

* Use FreshRSS_Factory::createCategoryDao

* Add view of all articles containing any tag

* Fix search in tags

* Mark as read tags

* Partial auto-update unread tags

* More auto update tag unreads

* Add tag deletion

* Do not purge tagged articles

* Minor comment

* Fix SQLite and UI bug

* Google Reader API support for user tags

Add SQL check that tag names must be distinct from category names

* whitespace

* Add missing API for EasyRSS

* Compatibility SQLite

Problematic parentheses

* Add SQL DISTINCT for cases with multiple tags

* Fix for PostgreSQL

PostgreSQL needs some additional type hint to avoid "could not determine
data type of parameter $1"

http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2018-09-29 20:47:17 +02:00
Alexandre Alapetite
d3f5bd840d Add mark-as-unread (#1995)
* Add mark-as-unread

https://github.com/FreshRSS/FreshRSS/issues/1966

* Change sentence

https://github.com/FreshRSS/FreshRSS/pull/1995#discussion_r214515954

* Enable mark-as-unread only when unread articles are shown

In order to prevent erroneous marking-as-unread.
We might find a better logic later.

* Disable instead of hide mark-as-unread option

To make it easier to discover
2018-09-03 20:48:04 +02:00
Alexandre Alapetite
99dfdbc10d Avoid feed credentials in logs (#1949)
* Avoid feed credentials in logs

Related to https://github.com/FreshRSS/FreshRSS/pull/1891

* Changelog 1949
2018-07-08 11:29:05 +02:00
Alexandre Alapetite
84d891f8cf Light Boolean search implementation (#1828)
* Light Boolean search implementation

"Hello intitle:World OR date:P1D example"
https://github.com/FreshRSS/FreshRSS/issues/879

* Doc Boolean search

* Doc typos
2018-03-14 17:20:41 +01:00
Alexandre Alapetite
5872a11eb7 cleanOldEntries call autoUpdateDb (#1804)
* cleanOldEntries call autoUpdateDb

https://github.com/FreshRSS/FreshRSS/issues/1803

* Fix feedDAO autoUpdateDb

* Move cleanOldEntries to EntryDAO

Only the entry table is concerned
2018-03-01 19:25:40 +01:00
Alexis Degrugillier
7642d334f8 Replace "keep history" magic value by a constant (#1759)
I think the use of a magic value repeated many times in the code is prone to have some errors made by people not knowing its meaning. Using a constant is a bit more safe. Judging by some comments in the code, I am not the only one.
2018-01-02 23:53:35 +01:00
Alexandre Alapetite
f632a34626 CLI optimize database (#1663)
CLI optimize database https://github.com/FreshRSS/FreshRSS/issues/1583
And VACUUM in SQLite https://github.com/FreshRSS/FreshRSS/issues/918
Add VACUUM for PostgreSQL (Not tested yet)
2017-10-12 20:11:06 +02:00
Alexandre Alapetite
32c734ef62 SQL mark search as read
https://github.com/FreshRSS/FreshRSS/issues/608
2016-08-18 00:00:08 +02:00
Alexandre Alapetite
6b787c7408 Error message when accessing entry by GET 2016-04-23 23:07:12 +02:00
Marien Fressinaud
7cca47d1ab Change name of user configuration var in Context
- FreshRSS_Context::$conf is replaced by FreshRSS_Context::$user_conf
- Introduce FreshRSS_Context::$system_conf
- Remove FreshRSS_Configuration object

See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-05 22:45:03 +01:00
Marien Fressinaud
7f4ca35fc3 Fix i18n strings for sharing
Fix https://github.com/FreshRSS/FreshRSS/issues/728
2014-12-17 17:21:41 +01:00
Marien Fressinaud
fee1ae997a Fix i18n for conf, entry, error, feed Controllers 2014-12-11 19:02:05 +01:00
Marien Fressinaud
58deab37cd Fix Minz_Error::error() -> use default values 2014-10-30 19:57:08 +01:00
Marien Fressinaud
1fe5ed5d21 nextGet and idMax are coming back.
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 19:19:15 +02:00
Marien Fressinaud
1a22a87fb1 Use FreshRSS_Context::$conf only
- Replace $this->view->conf in controllers
- Replace $this->conf in views
2014-10-20 18:45:22 +02:00
Marien Fressinaud
79aa5beaf4 Refactor authentication system.
Big work, not finished. A lot of features have been removed.

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-06 23:29:20 +02:00
Marien Fressinaud
d65a9f9bd6 Refactor entryController
- Coding style
- Refactoring
- Comments (set of TODO)

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-06 11:59:27 +02:00
Marien Fressinaud
d8f4681382 Replace Minz_Log::record by corresponding methods
Please not use Minz_Log::record anymore!

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05 19:35:29 +02:00
Marien Fressinaud
9a0d01be0c Coding style
Remove spaces before parenthesis.

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05 18:24:28 +02:00
Marien Fressinaud
6c8b36f04e Let's begin the big refactoring!
Minz_Translate::t\s? replaces by _t

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05 15:55:20 +02:00
Marien Fressinaud
1e5efc9299 Mark many as read must be a POST action
See https://github.com/marienfressinaud/FreshRSS/issues/599
2014-09-16 14:23:04 +02:00
Alexandre Alapetite
bc8eb560af Add TTL to control feed freshness
https://github.com/marienfressinaud/FreshRSS/issues/250
2014-07-06 00:09:31 +02:00
Alexandre Alapetite
b34f59e85a Preparation #3 for SQLite
https://github.com/marienfressinaud/FreshRSS/issues/100
2014-07-03 22:48:29 +02:00
Alexandre Alapetite
d6f4141086 Preparation for SQLite
https://github.com/marienfressinaud/FreshRSS/issues/100
2014-07-03 21:26:30 +02:00
Alexandre Alapetite
8a8fe93d34 SQL: Update cached values after an optimization
https://github.com/marienfressinaud/FreshRSS/issues/452
2014-03-10 17:34:29 +01:00
Alexandre Alapetite
71f7ce1be5 API: SQL optimisation
https://github.com/marienfressinaud/FreshRSS/issues/13
2014-03-01 15:47:15 +01:00
Alexandre Alapetite
fdd179d344 Corrections vue globale
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/353
2014-01-18 19:29:44 +01:00
Alexandre Alapetite
69f7bce75b Changements de vues
Correction d'un bug JavaScript récent dans la vue globale.
Corrections de nombreux bugs lors des changements de vue
https://github.com/marienfressinaud/FreshRSS/issues/346 et amélioration
des performances pour la génération des URL en évitant beaucoup d'appels
de fonctions https://github.com/marienfressinaud/FreshRSS/pull/362
De plus, dans les URL, is_favorite et is_read ont maintenant une valeur
par défaut de 1, ce qui évite de les écrire dans beaucoup de cas.
Suppression des espaces blancs de la sortie HTML au niveau de quelques
boucles critiques.
2014-01-18 16:41:10 +01:00
Alexandre Alapetite
1ac09e7fe4 Multi-utilisateur fonctionnel en HTTP Auth
+ Possibilité d'ajout / suppression d'utilisateur (seulement par
l'administrateur)
+ Divers changements pour le mode multi-utilisateur
https://github.com/marienfressinaud/FreshRSS/issues/126
+ Minz : Renomme "sel_application" en "salt'
2013-12-31 02:59:07 +01:00
Alexandre Alapetite
92efd68a3a Début de mode multi-utilisateur avec http_auth
+ Légère optimisation de Minz_View.
+ Encore plus de tests de bibliothèques dans install.php
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 et
https://github.com/marienfressinaud/FreshRSS/issues/303
2013-12-30 01:03:32 +01:00
Alexandre Alapetite
96bdbafcea Refactorisation FreshRSS_Configuration
Implémente https://github.com/marienfressinaud/FreshRSS/issues/260
(évite les comparaisons de chaînes au profit des vrais booléens et
entiers)
Grosse simplification et réduction du code relatif à la configuration.
Supprime ConfigurationDAO.
Permet de simplifier considérablement configureController.
Évite de multiples copies des mêmes données en mémoire.
Évite de garder plusieurs versions de la configuration en mémoire
(auparavant : dans un tableau au niveau de ModelArray + au niveau de
FreshRSS_Configuration + en Session + des copies temporaires comme
ConfigurationDAO).
Ne stocke plus 'conf' en Session (n'était presque pas utilisé).
Évite de recharger plusieurs fois Translate inutilement.
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/303
2013-12-28 23:09:39 +01:00
Alexandre Alapetite
33e200dc04 Redirection correcte vers nouvelle vue archivage 2013-12-27 22:45:26 +01:00
Alexandre Alapetite
43fd0a5439 Mise à jour de f.url en base de données lorsque SimplePie découvre que l'adresse a changé
Et correction problème favicon lorsque l'adresse du flux a changé du
point de vue de SimplePie.
Plus petites optimisations.
2013-12-26 22:20:24 +01:00
Alexandre Alapetite
7eda2793bb Nouveau bouton pour lancer manuellement la purge des vieux articles
Attention, si on supprime des articles qui sont encore dans les flux
RSS, ils risquent de réapparaitre en cas de date manquante ou erronée,
ou si l'utilisateur augmente la date d'expiration.

Ce bouton est plus strict que la purge automatique qui conserve toujours
au moins le même nombre d'articles que dans le flux RSS en cours + 10.
2013-12-25 19:53:09 +01:00
Alexandre Alapetite
b4463cb69e Problème casse renommage répertoire 2013-12-15 11:28:27 +01:00