Commit Graph

48 Commits

Author SHA1 Message Date
Alexandre Alapetite 76cbfadcdf
Fix types for extensions (#5901)
* Fix types for extensions
To accompany https://github.com/FreshRSS/Extensions/pull/185

* Avoid bug redeclared function
2023-11-24 14:50:03 +01:00
Luc SANCHEZ 30c7a61a9b
Use strict_types (#5830)
* Little's optimisations and booleans in conditions

* Apply strict type

* Apply strict type

* Apply strict type

* Fix multiple bugs with PHP 8.2 and 8.3

* Many declares missing, more errors fixed

* Apply strict type

* Another approach

* Stronger typing for Minz_Session

* Fix case of SQLite

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-11-16 22:43:00 +01:00
Alexandre Alapetite 98559cebc3
Remove obsolete TTL migration code (#5625)
Remove `updateTTL` function used to help migration to 5+ year-old FreshRSS 1.10 and FreshRSS 0.7.3 https://github.com/FreshRSS/FreshRSS/pull/1750
This function contributed to locking the database https://github.com/FreshRSS/FreshRSS/pull/5574
Subset of https://github.com/FreshRSS/FreshRSS/pull/3558
2023-09-06 21:41:17 +02:00
Luc SANCHEZ f8f163d054
Chore/processing of depreciations and updating code to php72 minimum (#5504)
* processing of depreciations and updating of code to php7.2 minimum

* Autoformat many strange array indenting
And revert a few unwanted changes

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-07-07 22:36:27 +02:00
Alexandre Alapetite 6e2f2f1c1e
A few additional PHPStan rules (#5388)
A subset of
https://github.com/phpstan/phpstan-strict-rules
2023-05-11 13:02:04 +02:00
Alexandre Alapetite fe7d9bbcd6
Typed view model classes (#5380)
* Typed view model classes
* Add ability to provide a typed view model class to a controller
* Use `::class` instead of string for referring to classes
* Examplified with `stats` and `javascript` controllers / views (more to do)
* Also useful for extensions (my usecase today), which did not have the ability to define own view model attributes before.

* Typo
2023-05-11 12:53:32 +02:00
Alexandre Alapetite bd9fa803f1
PHPStan Level 7 complete DAOs (#5354)
* PHPStan Level 7 complete DAOs

* Finalise PHPStan Level 7 for CategoryDAO

* PHPStan Level 7 for Context and Search

* Apply suggestions from code review

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>
2023-05-02 14:38:32 +02:00
Alexandre Alapetite c72914bba2
PHPStan Level 7 for more DAO PDO (#5328)
* PHPStan Level 7 for more DAO PDO
With new function to address common type and check problems

* A bit more

* PHPStan Level 7 for FreshRSS_Entry
2023-04-28 14:01:11 +02:00
Alexandre Alapetite f3760f138d
Complete PHPStan Level 6 (#5305)
* Complete PHPStan Level 6
Fix https://github.com/FreshRSS/FreshRSS/issues/4112
And initiate PHPStan Level 7

* PHPStan Level 6 for tests
* Use phpstan/phpstan-phpunit
* Update to PHPStan version 1.10

* Fix mixed bug

* Fix mixed return bug

* Fix paginator bug

* Fix FreshRSS_UserConfiguration

* A couple more Minz_Configuration bug fixes

* A few trivial PHPStan Level 7 fixes

* A few more simple PHPStan Level 7

* More files passing PHPStan Level 7
Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251

* A few more PHPStan Level 7 preparations

* A few last details
2023-04-17 08:30:21 +02:00
Alexandre Alapetite 6c01e4e7d6
Use typed access to request parameters (#5267)
* Use typed access to request parameters
This was a big source of mixed datatypes in many places

* Fix notifications

* Fix bookmarkAction
2023-04-07 00:13:49 +02:00
Alexandre Alapetite 1ee2a3d72d
Fix repartitionAction (#5228)
* Fix repartitionAction
Fix https://github.com/FreshRSS/FreshRSS/issues/5227

* Better types

* PHPStan level 6
2023-03-26 21:42:56 +02:00
Luc SANCHEZ 247215ffaa
Typehint some Controllers (#5106)
* Typehint to Controllers

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

* Remarque's from Alkarex

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-03-21 18:57:57 +01:00
Alexandre Alapetite 1c434971d4
statsController at phpStan level 9 (#5028)
Follow up of https://github.com/FreshRSS/FreshRSS/pull/5024

```
vendor/bin/phpstan analyse --level 9 app/Controllers/statsController.php
```

Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-01-21 23:20:44 +01:00
Luc SANCHEZ 75a203fff2
Type hinting statsController.php (#5024) 2023-01-20 23:37:41 +01:00
Alexandre Alapetite f89819bd64
Custom logo HTML (#4369)
* Custom logo HTML
Add option for custom HTML logo/title in the main Web UI view.
Can potentially be different per user.
#fix https://github.com/FreshRSS/FreshRSS/pull/3830/files#r850472247

* logo_html in main config
With new `./data/config.custom.php` to provide custom values before install

* Docker documentation

* whitespace

* Auto relax CSP to allow images for HTML logo

* Documentation
2022-05-23 14:03:19 +02:00
maTh 807ea755e0
fix preview (#4291)
* fix

* Update extra.js

* reorga the scripts

* Update extra.js

* Several fixes
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1125472321

* More fixes

* Cleaning

* fix pr 4291

* Reorganise some script functions

* Remove unused popup-txt
And associated function openPopupWithMessage

* Fix archiving categories
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126924602

* Fix stats
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126983134

* Fix direct subscription
E.g. http://localhost/i/?c=subscription&id=735

* Fix subscription add
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126991621

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-05-15 21:52:52 +02:00
Alexandre Alapetite 6f018cc674
Show errored, empty, muted feeds in statistics (#4276) 2022-03-21 12:51:26 +01:00
maTh be9c06fd5c
Improved: Idle feeds list in a new layout (#4192)
* that should work fine

* fixed phpcs

* fixed phpcs
2022-02-05 10:57:36 +01:00
Alexandre Alapetite 4e2dff4591
Add spell checking with typos (#4138)
* Add spell checking with typos
Implement https://github.com/FreshRSS/FreshRSS/pull/4134#issuecomment-1008027558

* GitHub Actions attempt

* Quiet wget

* Makefile
2022-01-09 18:21:40 +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
maTh 02641de32e
Stats: replace flotr2 with chart.js (#3858)
* include Chart.js

* page: main statistics. Flotr.js replaced with Chart.js

* main stats + repartition

* Delete: repartition.js + stats.js

* delete flotr2

* add libs in README

* polish

* code polish

* fixed amount of week days and months

* added manget link for LibreJS

* added: @license-end

* phpcbf + jshint formatting

* delete old code

* fix stats

* fix Comments

* finally I found the issue and fixed its best

* fix the month stats

* Whitespace fixes

* Remove flotr2

* Rename to chart.min.js

* Remove console.log

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-10-16 12:00:07 +02:00
maTh 93e73855ec
Delete jQuery (#3847)
* delete jquery.min.js lib
2021-09-13 08:02:09 +02:00
Anton Smirnov 11b6668cbf
More inactive cutoffs (#2831)
* Fill additional cutoffs

* Update phpdoc

* Add translation strings

* Update app/i18n/fr/gen.php

Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>

* Add Dutch translation

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2020-03-22 01:10:28 +01:00
Marien Fressinaud 7802fd33a6 tec: Allow to change CSP header from controllers
For an extension, I needed to call a script from an external domain.
Unfortunately, the CSP headers didn't allow this domain and I had to
patch manually the FreshRSS FrontController for my extension. It's
obviously not a long-term solution since it has nothing to do in the
core of FRSS, and I don't want to apply this patch manually at each
update.

With this patch, I allow changing the CSP header from inside the
controller actions. It allows extensions to modify headers. It's also an
opportunity to remove a bit of code from the FrontController. I wasn't
happy with the previous implementation anyhow.

Reference: https://github.com/flusio/xExtension-Flus/commit/ed12d56#diff-ff12e33ed31b23bda327499fa6e84eccR143
2019-12-22 15:01:02 +01:00
Alexandre Alapetite 2374374ba9
Less jQuery (#2234)
* Less jQuery

Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2199

* Even less jQuery + global view unread title fix

* Even less jQuery

* Yet even less jQuery

* Even less jQuery

* Reduce some events

* Even less jQuery

* jQuery gone from main view

+Fixed English i18n

* Fix feed folded view

* Remove Firefox 64 workaround

Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox
65

* Split to extra.js

Avoid loading unneeded JavaScript code for the main view.
+ several adjustements

* Improve CSS transition fold category

* Rewrite shortcuts

Remove library. Much faster, shorter, one listener instead of many.
Control of the shortcut context.
Fix https://github.com/FreshRSS/FreshRSS/issues/2215

* Remove debug

* Minor syntax

* Filter out unwanted shortcut modifiers

* Menu overflow fix

* Typo

* Fix unfolding in mobile view

* Remove jQuery from category.js

* Remove jQuery from Global view
2019-02-13 15:06:28 +01: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 ccb56bcbf3 Simplify SQL in statistics
Reduce the use of product-specific date functions. Improve performances.
Remove redundant functions.
2016-09-11 11:24:32 +02:00
Marien Fressinaud f43b273706 Update i18n for statistics 2014-12-11 16:10:39 +01:00
Alexis Degrugillier 38cf7a109e Add more info in article repartition page
I added the same information than on the main stat page (total, read, unread and favorite) on the repartition page. Some refactoring was needed.
2014-11-08 09:26:01 -05:00
Marien Fressinaud 58deab37cd Fix Minz_Error::error() -> use default values 2014-10-30 19:57:08 +01: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 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
Alexis Degrugillier cd88414abc Add an average per day for the 30 day period 2014-09-29 18:54:03 -04:00
Alexis Degrugillier 5889ef35c8 Change todo align 2014-09-21 12:01:36 -04:00
Alexis Degrugillier 0420a98939 Add comments on the stat controller 2014-09-21 11:51:53 -04:00
Alexis Degrugillier f002dbe4ce Add average on repartition charts.
It needs some verification on the value used to calculate the averages.
2014-09-01 20:58:05 -04:00
Alexandre Alapetite ea99ac1259 Syntax 581
#581
2014-08-19 21:55:49 +02:00
Alexis Degrugillier 393fce3e8a Add a feed selector in repartition statistics.
Before we could choose the feed in the statistics only from the feed options in the main view. Now with the new drop-down list, it is possible to choose it from the statistics page.
The rendering needs to be polished to be nicer.
2014-08-19 08:55:44 -04:00
Alexis Degrugillier d049c1bc80 Add article repartition in stats
Add article repartition per hour, per day of week, per month for all feeds but also for individual feeds.
2014-07-24 21:57:59 -04:00
Alexandre Alapetite e507256d0b Stats idle feed small bug
Some feeds were listed more than once. A bit more independent from the
SQL query.
https://github.com/marienfressinaud/FreshRSS/issues/544
2014-07-23 00:24:00 +02:00
Alexandre Alapetite 937cb4b066 Idle feeds: link to configuration page
https://github.com/marienfressinaud/FreshRSS/issues/544
2014-07-22 13:41:31 +02:00
Alexandre Alapetite 3bbd0e446f Prepare statistics for SQLite
Temporarily disable 30-day statistics for SQLite
https://github.com/marienfressinaud/FreshRSS/issues/100
https://github.com/marienfressinaud/FreshRSS/issues/90
2014-07-06 11:54:00 +02:00
Alexis Degrugillier 60fe99344e Refactor and formatting 2014-06-15 12:13:33 -04:00
Alexis Degrugillier e9cee8cc20 Fix syntax 2014-06-15 12:05:21 -04:00
Alexis Degrugillier d9f570a84d Refactor idle feed stats 2014-06-15 12:05:21 -04:00
Alexis Degrugillier 181fcd9889 Refactor statistics
I made a new controller to handle statistics. The old statistics have been moved in that controller and a new action has been added to display idle feeds. I also added a menu in the left panel to navigate between the statistics pages.
See #90
2014-06-15 12:05:21 -04:00