aboutsummaryrefslogtreecommitdiff
path: root/app/actualize_script.php
AgeCommit message (Collapse)Author
2025-11-11Housekeeping lib_rss.php (#8193)Gravatar Alexandre Alapetite
* Housekeeping lib_rss.php `lib_rss.php` had become much too large, especially after https://github.com/FreshRSS/FreshRSS/pull/7924 Moved most functions to other places. Mostly no change of code otherwise (see comments). * Extension: composer run-script phpstan-third-party
2025-09-30Add hook enums (#8036)Gravatar Alexis Degrugillier
- add an enum to handle hook types (enum are available since PHP 8.1) - change hook calls from string value to enum value
2025-09-05Change how files are included (#7916)Gravatar Alexis Degrugillier
1. `include`, `include_once`, `require` and `require_once` are expressions not functions, parentheses are not necessary. 2. to move up the directory tree, it's better to use the `dirname` function instead of relying on `/..`.
2024-12-27PHPStan 2.0 (#7131)Gravatar Alexandre Alapetite
* PHPStan 2.0 fix https://github.com/FreshRSS/FreshRSS/issues/6989 https://github.com/phpstan/phpstan/releases/tag/2.0.0 https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md * More * More * Done * fix i18n CLI * Restore a PHPStan Next test For work towards PHPStan Level 10 * 4 more on Level 10 * fix getTagsForEntry * API at Level 10 * More Level 10 * Finish Minz at Level 10 * Finish CLI at Level 10 * Finish Controllers at Level 10 * More Level 10 * More * Pass bleedingEdge * Clean PHPStan options and add TODOs * Level 10 for main config * More * Consitency array vs. list * Sanitize themes get_infos * Simplify TagDAO->getTagsForEntries() * Finish reportAnyTypeWideningInVarTag * Prepare checkBenevolentUnionTypes and checkImplicitMixed * Fixes * Refix * Another fix * Casing of __METHOD__ constant
2024-02-26Improve feed refresh (#6117)Gravatar Alexandre Alapetite
* Improve feed refresh Better account for some edge cases for cron and automatic labels fix https://github.com/FreshRSS/FreshRSS/issues/6089 fix https://github.com/FreshRSS/FreshRSS/issues/6109 * Apply labels also to new entries already marked as read * Add case most relevant for cron
2023-12-18Pass PHPStan level 8 (#5946)Gravatar Alexandre Alapetite
* Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more
2023-12-03Rework keepmax (#5905)Gravatar Alexandre Alapetite
* Rework keepmax fix https://github.com/FreshRSS/FreshRSS/issues/5702 fix https://github.com/FreshRSS/FreshRSS/issues/5870 * More WIP * Minor progress * Progress * Beta * Improved debug message * Revert noCommit * Fix variable reset * Remove debug syslogs
2023-11-18Fix PHP 7 compatibility strict_types (#5893)Gravatar Alexandre Alapetite
* Fix PHP 7 compatibility https://github.com/FreshRSS/FreshRSS/discussions/5892 * Multiple PHP 7 fixes * PHPStan
2023-11-16Use strict_types (#5830)Gravatar Luc SANCHEZ
* 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-05-11A few additional PHPStan rules (#5388)Gravatar Alexandre Alapetite
A subset of https://github.com/phpstan/phpstan-strict-rules
2023-05-04Use PHPStan dynamicConstantNames (#5370)Gravatar Alexandre Alapetite
https://phpstan.org/config-reference#constants Avoid a few phpstan-ignore-next-line
2023-04-17Complete PHPStan Level 6 (#5305)Gravatar Alexandre Alapetite
* 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-04Fix extensions in actualize_script (#5243)Gravatar Alexandre Alapetite
* Fix extension freshrss_user_maintenance in actualize_script Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3440 The hook was called before registering all the extensions for the current user * PHPStan Level 6 for extensions And remove 5-year old legacy format of enabled extensions < FreshRSS 1.11.1 * Fix multiple bugs in extensions * Minor typing * Don't change signature of methods supposed to be overridden * PHPStan Level 9 and compatibility Intelliphense * Set as final the methods not supposed to be overriden
2023-03-31Mutex for actualize script (#5235)Gravatar Alexandre Alapetite
* Simplify extension method One parameter was not used Furthermore, that unused parameter was preventing simpler calls (i.e. without a dedicated extension class). Now it is possible to register a call back with a lamda: ```php Minz_ExtensionManager::addHook('feed_before_actualize', function () { // Hello }); ``` * Mutex for actualize script In the case of extremely long cron jobs that are refreshing feeds, a cron job might start before the previous one has completed, leading to an accumulation of cron jobs running in parallel. Although we already have a mutex preventing concurrency problems on a single feed refresh, the problem occurs in particular if each feed can take a long time (e.g. due to heavy processing, which is my usecase). https://github.com/FreshRSS/FreshRSS/pull/5234 must be merged first * Fiw wrong return
2023-03-26Automated test towards PHPStan level 6 (#5230)Gravatar Alexandre Alapetite
* Automated test towards PHPStan level 6 Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112 With this automated tests, files that are passing Level 6 are tested to avoid regressions towards Level 5 (which is the current baseline for the whole code-base) It is included when calling `make test-all` or can be called specifically by `composer run-script phpstan-next` * Test and example with 3 new passing files
2022-08-21Improved: error page (#4465)Gravatar maTh
* error page: true HTML page * error page: http500 erorr * error page: add CSP header * 'log.txt' replaced by LOG_FILENAME * use ADMIN_LOG * log.txt => LOG_FILENAME * error message: add <title> * Docs created * delete: documentation on error message page * line break added * added: new line at the end * typo fixed * Update lib/lib_rss.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update lib/lib_rss.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Minz HTTP 500 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-01-08Use typographic quotes (#4133)Gravatar Alexandre Alapetite
* Use typographic quotes * A few fixes * Fix * Fix not saved * Implement feedback * Detail * Revert spoken English fixes Left for a future dedicated discussion * More reverts * Final reverts * Final minor
2022-01-04PHPStan level 5 (#4110)Gravatar Alexandre Alapetite
* 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
2021-12-31Add PHPStan (#4021)Gravatar Alexandre Alapetite
* 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-02-17Add user maintenance hooks (#3440)Gravatar Alexis Degrugillier
The new hook allows to add maintenance extensions at the user level. See #3398
2021-02-05Add requirements check in CLI (#3410)Gravatar Alexandre Alapetite
* Add requirements check in CLI #fix https://github.com/FreshRSS/FreshRSS/issues/1853 * More checks #fix https://github.com/FreshRSS/FreshRSS/issues/1853
2021-01-02Avoid manual initialisations of system or user configuration (#3070)Gravatar Alexandre Alapetite
* Avoid manual intialisations of system or user configuration More consistent use of Context * Simplify FreshRSS_Context::initUser * Remove a few manual get_user_configuration * A bit of debugging * Fix context user init * Fix install * Fix concurrency Concurrent requests could lead to bad race condition * Fix actualize cron Fix case when system i initialised several times
2020-10-06Minz allow parallel sessions (#3096)Gravatar Alexandre Alapetite
* Minz allow parallel sessions #fix https://github.com/FreshRSS/FreshRSS/issues/3093 * Array optimisation * Array optimisation missing * Reduce direct access to $_SESSION except in install process * Fix session start headers warning * Use cookie only the first time the session is started: `PHP Warning: session_start(): Cannot start session when headers already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39` * New concept of volatile session for API calls Optimisation: do not use cookies or local storage at all for API calls without a Web session Fix warning: ``` PHP Warning: session_destroy(): Trying to destroy uninitialized session in Unknown on line 0 ``` * Only call Minz_Session::init once in our index It was called twice (once indirectly via FreshRSS->init()) * Whitespace * Mutex for notifications Implement mutex for notifications https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809 * Typo * Install script is not ready for using Minz_Session
2020-06-14Add a way to disable/enable users (#3056)Gravatar Alexis Degrugillier
If you want to block users without deleting their account, you can now disable them from the interface.
2020-06-06Modify shebang to be more portable (#3038)Gravatar Alexis Degrugillier
The new shebang is a portable way to find the php interpreter. It works on Mac, GNU/Linux and BSD.
2020-05-15Revert to STDOUT for cron messages (#2979)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/2975
2020-05-15Delay the feeds actualization start notice (#2974)Gravatar Craig Andrews
* Delay the feeds actualization start notice Move the actualization start notice until after SIMPLEPIE_SYSLOG_ENABLED is defined. Fixes https://github.com/FreshRSS/FreshRSS/issues/2973 * Update app/actualize_script.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-05-14Improve logs during cron actualization (#2964)Gravatar Alexandre Alapetite
For https://github.com/FreshRSS/FreshRSS/issues/2952#issuecomment-626218921 And fix a little bug writing logs with the wrong user name
2020-05-10Attempt to reduce max memory usage during actualize (#2955)Gravatar Alexandre Alapetite
* Attempt to reduce max memory usage during actualize #Fix https://github.com/FreshRSS/FreshRSS/issues/2952 * Use memory_get_peak_usage
2020-01-03Fix logging environment constants (#2745)Gravatar Alexandre Alapetite
* Fix logging environment constants * COPY_LOG_TO_SYSLOG was only working when Syslog was used * FRESHRSS_ENV was not properly used to set logging level * Simplify code Always call `openlog()` even when it is not used * Always specify syslog properties https://github.com/FreshRSS/FreshRSS/pull/2745#discussion_r362207445 * $username is also needed further down * No new line in syslog
2019-01-06Copy syslog to STDERR (#2208)Gravatar Alexandre Alapetite
* Use openlog before syslog In order to have a copy on stderr when syslog is not available. * Take advantage of syslog for actualization Pipe cron job STDERR and syslog to Docker log Cf. https://github.com/FreshRSS/FreshRSS/pull/2202/commits/00bd467655b7c060cdae388519b2413d12d8cb0f
2018-05-20add shebang to actualize script (#1886)Gravatar David souza
* add shebang to actualize script * Update actualize_script.php
2017-12-10Merge branch 'dev' into logfilesizeGravatar Alexandre Alapetite
2017-12-10Check requirement in CLI script (#1711)Gravatar Kevin Papst
* check requirements in actualize_script before executing, fixes #1710 * removed empty whiteline * testing all requirements * incorporated code review feedback * removed code that is already executed in _cli.php * added newline at eof * fixed include problems * fixed include problems
2017-12-10Log rotation, use Minz_Log, new log constantsGravatar Alexandre Alapetite
ADMIN_LOG, API_LOG, PSHB_LOG
2016-10-22CLI list-users and create-userGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1095 https://github.com/FreshRSS/FreshRSS/issues/1090
2016-10-12Cron refresh faviconsGravatar Alexandre Alapetite
Related to https://github.com/FreshRSS/FreshRSS/issues/1181 https://github.com/FreshRSS/FreshRSS/issues/1298
2015-01-29Remove calls to syslog()Gravatar Marien Fressinaud
Temporary fix: - Change syslog by Minz_Log::notice in most of the files - Logs are stored in USERS_PATH/_/log.txt for actualize_script.php - Simply comment syslog in SimplePie See https://github.com/FreshRSS/FreshRSS/issues/711
2015-01-20Quick fix cron actualization due to problematic FreshRSS constructor/initGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/759 Suggestion: the static objects should be user-independent (or at least with the possibility to be re-set), while the FreshRSS object and its attributes should be user-dependent.
2015-01-06Coding style in actualize_scriptGravatar Marien Fressinaud
2015-01-06Fix a bug of authentication in actualize_scriptGravatar Marien Fressinaud
See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-06Fix and improve actualize_scriptGravatar Marien Fressinaud
See https://github.com/FreshRSS/FreshRSS/issues/730
2014-12-28Remove all old references to LOG_PATHGravatar Marien Fressinaud
See https://github.com/FreshRSS/FreshRSS/issues/729
2014-10-29Ne pas rafraîchir les flux des utilisateurs non logués depuis x joursGravatar Alexandre Alapetite
https://github.com/marienfressinaud/FreshRSS/issues/681 Warning: needs some testing
2014-10-26Fix errors + improvements on bug #683 fix.Gravatar Luc Didry
2014-10-26Fixes #683Gravatar Luc Didry
2014-10-20start with admin only if existsGravatar plopoyop
2014-03-22Minz: remove one layer of ob_ (experimental)Gravatar Alexandre Alapetite
https://github.com/marienfressinaud/FreshRSS/issues/303#issuecomment-38351311 https://github.com/marienfressinaud/FreshRSS/issues/163 * Remove Minz_Response (not needed anymore) * Move Minz_Request::reseted to Minz_Dispatcher::reset()
2014-02-11Mutex par flux pour les actualisationsGravatar Alexandre Alapetite
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/351 Nouvelle constante TMP_PATH comme répertoire pour stocker des fichiers temporaires (si possible en mémoire et non sur disque, tel tmpfs pour /tmp sur certaines distributions Linux) Requiert PHP 5.2.1+ (contre 5.2.0 auparavant) pour le `sys_get_temp_dir()`
2014-02-01Actualize : Tolère PHP lancé en CGI plutôt que CLIGravatar Alexandre Alapetite
Corrige https://github.com/marienfressinaud/FreshRSS/issues/405 + Message d'erreur en cas de problème de droits dans ./data/ (par exemple si le cron utilise un mauvais utilisateur)