A free, self-hostable news aggregator…
Fix issue #65 : création d'un vrai script de mise à jour permettant de mettre tous les flux à jour via CRON
Marien Fressinaud5963221249cf
diff --git a/README b/READMEindex 0136016a1..30cd56226 100644--- a/README+++ b/README@@ -49,9 +49,12 @@ SÉCURITÉ ET CONSEILS3. Le fichier `/public/index.php` défini les chemins d'accès auxrépertoires clés de l'application. Si vous les bougez, tout se passeici.- 4. Vous pouvez ajouter une tâche CRON sur l'url de mise à jour des flux- (clic droit sur le bouton d'actualisation puis "Copier l'adresse du- lien") pour que celle-ci se fasse de manière transparente+ 4. Vous pouvez ajouter une tâche CRON sur le script d'actualisation des+ flux. Il s'agit d'un script PHP à exécuter avec la commande `php`.+ Par exemple, pour exécuter le script toutes les heures :+ 0 * * * * php /chemin/vers/freshrss/actualize_script.php >/dev/null 2>&1+ Veuillez cependant vérifier que le fichier PUBLIC_PATH/data/Configuration.array.php+ soit accessible en lecture / écriture par l'exécuteur du scriptCHANGELOG=========diff --git a/actualize_script.php b/actualize_script.phpnew file mode 100755index 000000000..cb4cbf351--- /dev/null+++ b/actualize_script.php@@ -0,0 +1,45 @@+<?php+# ***** BEGIN LICENSE BLOCK *****+# MINZ - A free PHP framework+# Copyright (C) 2011 Marien Fressinaud+#+# This program is free software: you can redistribute it and/or modify+# it under the terms of the GNU Affero General Public License as+# published by the Free Software Foundation, either version 3 of the+# License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU Affero General Public License for more details.+#+# You should have received a copy of the GNU Affero General Public License+# along with this program. If not, see <http://www.gnu.org/licenses/>.+#+# ***** END LICENSE BLOCK *****++// Constantes de chemins+define ('PUBLIC_PATH', realpath (dirname (__FILE__) . '/public'));+define ('LIB_PATH', realpath (PUBLIC_PATH . '/../lib'));+define ('APP_PATH', realpath (PUBLIC_PATH . '/../app'));+define ('LOG_PATH', realpath (PUBLIC_PATH . '/../log'));+define ('CACHE_PATH', realpath (PUBLIC_PATH . '/../cache'));++$_GET['c'] = 'feed';+$_GET['a'] = 'actualize';+$_GET['force'] = true;+$_SERVER['HTTP_HOST'] = '';++set_include_path (get_include_path ()+ . PATH_SEPARATOR+ . LIB_PATH+ . PATH_SEPARATOR+ . LIB_PATH . '/minz'+ . PATH_SEPARATOR+ . APP_PATH);++require (APP_PATH . '/App_FrontController.php');++$front_controller = new App_FrontController ();+$front_controller->init ();+$front_controller->run ();diff --git a/app/controllers/feedController.php b/app/controllers/feedController.phpindex 5173c3a2d..77f1787d0 100755--- a/app/controllers/feedController.php+++ b/app/controllers/feedController.php@@ -118,6 +118,7 @@ class feedController extends ActionController {$entryDAO = new EntryDAO ();$id = Request::param ('id');+ $force = Request::param ('force', false);// on créé la liste des flux à mettre à actualiser// si on veut mettre un flux à jour spécifiquement, on le met@@ -163,8 +164,9 @@ class feedController extends ActionController {}// On arrête à 10 flux pour ne pas surcharger le serveur+ // sauf si le paramètre $force est à vrai$i++;- if ($i >= 10) {+ if ($i >= 10 && !$force) {break;}}