ob_start(); echo 'Results: ', "\n"; //Buffered if (defined('STDOUT')) { $begin_date = date_create('now'); fwrite(STDOUT, 'Starting feed actualization at ' . $begin_date->format('c') . "\n"); //Unbuffered } // Set the header params ($_GET) to call the FRSS application. $_GET['c'] = 'feed'; $_GET['a'] = 'actualize'; $_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!) // Create the list of users to actualize. // Users are processed in a random order but always start with admin $users = listUsers(); shuffle($users); if ($system_conf->default_user !== '') { array_unshift($users, $system_conf->default_user); $users = array_unique($users); } $limits = $system_conf->limits; $min_last_activity = time() - $limits['max_inactivity']; foreach ($users as $user) { if ($user !== $system_conf->default_user && FreshRSS_UserDAO::mtime($user) < $min_last_activity) {
# # ***** END LICENSE BLOCK ***** require '../../constants.php'; require LIB_PATH . '/lib_rss.php'; //Includes class autoloader if (file_exists(DATA_PATH . '/do-install.txt')) { require APP_PATH . '/install.php'; } else { session_cache_limiter(''); Minz_Session::init('FreshRSS'); Minz_Session::_param('keepAlive', 1); //For Persona if (!file_exists(DATA_PATH . '/no-cache.txt')) { require LIB_PATH . '/http-conditional.php'; $currentUser = Minz_Session::param('currentUser', ''); $dateLastModification = $currentUser === '' ? time() : max(@filemtime(join_path(USERS_PATH, $currentUser, 'log.txt')), @filemtime(join_path(DATA_PATH, 'config.php'))); if (httpConditional($dateLastModification, 0, 0, false, PHP_COMPRESSION, true)) { exit; //No need to send anything } } try { $front_controller = new FreshRSS(); $front_controller->init(); $front_controller->run(); } catch (Exception $e) { echo '### Fatal error! ###<br />', "\n"; Minz_Log::error($e->getMessage()); echo 'See logs files.'; } }
//But always start with admin $users = array_unique($users); foreach ($users as $myUser) { syslog(LOG_INFO, 'FreshRSS actualize ' . $myUser); if (defined('STDOUT')) { fwrite(STDOUT, 'Actualize ' . $myUser . "...\n"); //Unbuffered } echo $myUser, ' '; //Buffered $_GET['c'] = 'feed'; $_GET['a'] = 'actualize'; $_GET['ajax'] = 1; $_GET['force'] = true; $_SERVER['HTTP_HOST'] = ''; $freshRSS = new FreshRSS(); $freshRSS->_useOb(false); Minz_Configuration::_authType('none'); Minz_Session::init('FreshRSS'); Minz_Session::_param('currentUser', $myUser); $freshRSS->init(); $freshRSS->run(); if (!invalidateHttpCache()) { syslog(LOG_NOTICE, 'FreshRSS write access problem in ' . LOG_PATH . '/*.log!'); if (defined('STDERR')) { fwrite(STDERR, 'Write access problem in ' . LOG_PATH . '/*.log!' . "\n"); } } Minz_Session::unset_session(true); Minz_ModelPdo::clean(); }