From 77e9877316fcfacb26799afdf32d94c8411da80e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Dec 2021 17:00:51 +0100 Subject: 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 --- app/actualize_script.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'app/actualize_script.php') diff --git a/app/actualize_script.php b/app/actualize_script.php index 1e3514de7..721376f62 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -2,20 +2,6 @@ auth_type = 'none'; // avoid necessity to be logged in (not saved!) define('SIMPLEPIE_SYSLOG_ENABLED', FreshRSS_Context::$system_conf->simplepie_syslog_enabled); +/** + * Writes to FreshRSS admin log, and if it is not already done by default, + * writes to syslog (only if simplepie_syslog_enabled in FreshRSS configuration) and to STDOUT + */ +function notice($message) { + Minz_Log::notice($message, ADMIN_LOG); + if (!COPY_LOG_TO_SYSLOG && SIMPLEPIE_SYSLOG_ENABLED) { + syslog(LOG_NOTICE, $message); + } + if (defined('STDOUT') && !COPY_SYSLOG_TO_STDERR) { + fwrite(STDOUT, $message . "\n"); //Unbuffered + } +} + notice('FreshRSS starting feeds actualization at ' . $begin_date->format('c')); // make sure the PHP setup of the CLI environment is compatible with FreshRSS as well -- cgit v1.2.3