From 5c52d9b34bb1f1285f92dd557bb8b8cb222b50f4 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sun, 10 Dec 2017 22:09:54 +0100 Subject: Check requirement in CLI script (#1711) * 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 --- app/actualize_script.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'app/actualize_script.php') diff --git a/app/actualize_script.php b/app/actualize_script.php index deaa1bf7c..0bb1f166f 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -1,6 +1,5 @@ format('c') . "\n"); //Unbuffered } - // Set the header params ($_GET) to call the FRSS application. $_GET['c'] = 'feed'; $_GET['a'] = 'actualize'; @@ -20,15 +18,15 @@ $_GET['ajax'] = 1; $_GET['force'] = true; $_SERVER['HTTP_HOST'] = ''; - $log_file = join_path(USERS_PATH, '_', 'log.txt'); - $app = new FreshRSS(); $system_conf = Minz_Configuration::get('system'); $system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) -FreshRSS_Context::$isCli = true; + +// make sure the PHP setup of the CLI environment is compatible with FreshRSS as well +performRequirementCheck($system_conf->db['type']); // Create the list of users to actualize. // Users are processed in a random order but always start with admin @@ -39,7 +37,6 @@ if ($system_conf->default_user !== '') { $users = array_unique($users); } - $limits = $system_conf->limits; $min_last_activity = time() - $limits['max_inactivity']; foreach ($users as $user) { @@ -74,7 +71,6 @@ foreach ($users as $user) { } } - Minz_Log::notice('FreshRSS actualize done.', $log_file); if (defined('STDOUT')) { fwrite(STDOUT, 'Done.' . "\n"); -- cgit v1.2.3