From b8c4afadf4bff7ac282ac5933eedccb1c666d873 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 17 Nov 2013 01:35:06 +0100 Subject: Nouveau fichier constants.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En particulier pour stocker le numéro de version de FreshRSS utilisé entre autres par https://github.com/marienfressinaud/FreshRSS/issues/174 et centraliser les constantes de chemins Implémente https://github.com/marienfressinaud/FreshRSS/issues/271 --- actualize_script.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'actualize_script.php') diff --git a/actualize_script.php b/actualize_script.php index 45b2938cb..65f9360a0 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -1,11 +1,5 @@ Date: Sun, 17 Nov 2013 02:56:30 +0100 Subject: Réorganisation des fichiers utilisateur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implémente https://github.com/marienfressinaud/FreshRSS/issues/248 --- README.md | 2 +- actualize_script.php | 2 +- app/configuration/.gitignore | 1 - app/controllers/entryController.php | 2 +- app/controllers/indexController.php | 4 +-- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/layout/layout.phtml | 2 +- app/models/Feed.php | 2 +- app/models/RSSConfiguration.php | 2 +- cache/.gitignore | 1 - constants.php | 13 ++++++---- data/.gitignore | 6 +++++ lib/lib_rss.php | 6 ++--- lib/minz/Configuration.php | 10 ++++---- lib/minz/dao/Model_pdo.php | 6 ++--- log/.gitignore | 1 - public/data/.gitignore | 4 --- public/data/grey.gif | Bin 56 -> 0 bytes public/index.php | 8 +++--- public/install.php | 47 ++++++++++++++++++------------------ public/themes/icons/grey.gif | Bin 0 -> 56 bytes 22 files changed, 61 insertions(+), 62 deletions(-) delete mode 100644 app/configuration/.gitignore delete mode 100644 cache/.gitignore create mode 100644 data/.gitignore delete mode 100644 log/.gitignore delete mode 100644 public/data/.gitignore delete mode 100644 public/data/grey.gif create mode 100644 public/themes/icons/grey.gif (limited to 'actualize_script.php') diff --git a/README.md b/README.md index 00df693e6..fb0b9e61e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Privilégiez pour cela des demandes sur GitHub # Sécurité et conseils 1. Pour une meilleure sécurité, faites en sorte que seul le répertoire `./public` soit accessible par le navigateur. Faites pointer un sous-domaine sur le répertoire `./public` par exemple -2. Dans tous les cas, assurez-vous que `./app/configuration/application.ini` ne puisse pas être téléchargé ! +2. Dans tous les cas, assurez-vous que `./data/application.ini` ne puisse pas être téléchargé ! 3. Le fichier de log peut être utile à lire si vous avez des soucis 4. Le fichier `./public/index.php` défini les chemins d'accès aux répertoires clés de l'application. Si vous les bougez, tout se passe ici. 5. 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 : diff --git a/actualize_script.php b/actualize_script.php index 65f9360a0..bc1d108bd 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -20,4 +20,4 @@ $front_controller = new App_FrontController (); $front_controller->init (); Session::_param('mail', true); // permet de se passer de la phase de connexion $front_controller->run (); -touch(PUBLIC_PATH . '/data/touch.txt'); +touch(DATA_PATH . '/touch.txt'); diff --git a/app/configuration/.gitignore b/app/configuration/.gitignore deleted file mode 100644 index 72e8ffc0d..000000000 --- a/app/configuration/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index 4d2d92c1b..8016d719f 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -84,7 +84,7 @@ class entryController extends ActionController { $entryDAO = new EntryDAO(); $entryDAO->optimizeTable(); - touch(PUBLIC_PATH . '/data/touch.txt'); + touch(DATA_PATH . '/touch.txt'); $notif = array ( 'type' => 'good', diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 224d6fb9e..392abd3e1 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -277,7 +277,7 @@ class indexController extends ActionController { $res = json_decode ($result, true); if ($res['status'] == 'okay' && $res['email'] == $this->view->conf->mailLogin ()) { Session::_param ('mail', $res['email']); - touch(PUBLIC_PATH . '/data/touch.txt'); + touch(DATA_PATH . '/touch.txt'); } else { $res = array (); $res['status'] = 'failure'; @@ -290,6 +290,6 @@ class indexController extends ActionController { public function logoutAction () { $this->view->_useLayout (false); Session::_param ('mail'); - touch(PUBLIC_PATH . '/data/touch.txt'); + touch(DATA_PATH . '/touch.txt'); } } diff --git a/app/i18n/en.php b/app/i18n/en.php index eca1dd6d5..8243756bd 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -283,7 +283,7 @@ return array ( 'dom_is_nok' => 'You haven’t the necessary to browse the DOM (php-xml package can be useful)', 'cache_is_ok' => 'Permissions on cache directory are good', 'log_is_ok' => 'Permissions on logs directory are good', - 'conf_is_ok' => 'Permissions on configuration directory are good', + 'favicons_is_ok' => 'Permissions on favicons directory are good', 'data_is_ok' => 'Permissions on data directory are good', 'file_is_nok' => 'Check permissions on %s directory. HTTP server must have rights to write into', 'fix_errors_before' => 'Fix errors before skip to the next step.', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 2cddd4083..8040a6a44 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -283,7 +283,7 @@ return array ( 'dom_is_nok' => 'Vous ne disposez pas du nécessaire pour parcourir le DOM (voir du côté du paquet php-xml ?)', 'cache_is_ok' => 'Les droits sur le répertoire de cache sont bons', 'log_is_ok' => 'Les droits sur le répertoire des logs sont bons', - 'conf_is_ok' => 'Les droits sur le répertoire de configuration sont bons', + 'favicons_is_ok' => 'Les droits sur le répertoire des favicons sont bons', 'data_is_ok' => 'Les droits sur le répertoire de data sont bons', 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire %s. Le serveur HTTP doit être capable d’écrire dedans', 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index ba4df4834..4232b714d 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -32,7 +32,7 @@ notification)) { - touch(PUBLIC_PATH . '/data/touch.txt', time() + 1); + touch(DATA_PATH . '/touch.txt', time() + 1); ?>
notification['content']; ?> diff --git a/app/models/Feed.php b/app/models/Feed.php index 2618d023f..adc8e1677 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -100,7 +100,7 @@ class Feed extends Model { return $this->nbNotRead; } public function favicon () { - $file = '/data/favicons/' . $this->id () . '.ico'; + $file = '/favicons/' . $this->id () . '.ico'; $favicon_url = Url::display ($file); if (!file_exists (PUBLIC_PATH . $file)) { diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index e79fd933b..f8379a625 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -348,7 +348,7 @@ class RSSConfigurationDAO extends Model_array { public $bottomline_link = 'yes'; public function __construct () { - parent::__construct (PUBLIC_PATH . '/data/Configuration.array.php'); + parent::__construct (DATA_PATH . '/Configuration.array.php'); // TODO : simplifier ce code, une boucle for() devrait suffir ! if (isset ($this->array['language'])) { diff --git a/cache/.gitignore b/cache/.gitignore deleted file mode 100644 index 72e8ffc0d..000000000 --- a/cache/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/constants.php b/constants.php index 260f01986..05d60b242 100644 --- a/constants.php +++ b/constants.php @@ -3,8 +3,11 @@ define('FRESHRSS_VERSION', '0.7-dev'); define('FRESHRSS_WEBSITE', 'http://marienfressinaud.github.io/FreshRSS/'); // Constantes de chemins -define ('PUBLIC_PATH', realpath (dirname (__FILE__) . '/public')); -define ('LIB_PATH', realpath (dirname (__FILE__) . '/lib')); -define ('APP_PATH', realpath (dirname (__FILE__) . '/app')); -define ('LOG_PATH', realpath (dirname (__FILE__) . '/log')); -define ('CACHE_PATH', realpath (dirname (__FILE__) . '/cache')); +define ('FRESHRSS_PATH', realpath (dirname (__FILE__))); +define ('PUBLIC_PATH', FRESHRSS_PATH . '/public'); +define ('DATA_PATH', FRESHRSS_PATH . '/data'); +define ('LIB_PATH', FRESHRSS_PATH . '/lib'); +define ('APP_PATH', FRESHRSS_PATH . '/app'); + +define ('LOG_PATH', DATA_PATH . '/log'); +define ('CACHE_PATH', DATA_PATH . '/cache'); diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 000000000..0e407f099 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,6 @@ +cache +log +application.ini +Configuration.array.php +*.sqlite +touch.txt \ No newline at end of file diff --git a/lib/lib_rss.php b/lib/lib_rss.php index e4518ab4b..33f8641e1 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -168,9 +168,9 @@ function get_content_by_parsing ($url, $path) { /* Télécharge le favicon d'un site, le place sur le serveur et retourne l'URL */ function dowload_favicon ($website, $id) { $url = 'http://g.etfv.co/' . $website; - $favicons_dir = PUBLIC_PATH . '/data/favicons'; + $favicons_dir = PUBLIC_PATH . '/favicons'; $dest = $favicons_dir . '/' . $id . '.ico'; - $favicon_url = '/data/favicons/' . $id . '.ico'; + $favicon_url = '/favicons/' . $id . '.ico'; if (!is_dir ($favicons_dir)) { if (!mkdir ($favicons_dir, 0755, true)) { @@ -211,7 +211,7 @@ function dowload_favicon ($website, $id) { function lazyimg($content) { return preg_replace( '/]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '', + '', $content ); } diff --git a/lib/minz/Configuration.php b/lib/minz/Configuration.php index b296ec378..bdd6af0fb 100755 --- a/lib/minz/Configuration.php +++ b/lib/minz/Configuration.php @@ -8,7 +8,7 @@ * La classe Configuration permet de gérer la configuration de l'application */ class Configuration { - const CONF_PATH_NAME = '/configuration/application.ini'; + const CONF_PATH_NAME = '/application.ini'; /** * VERSION est la version actuelle de MINZ @@ -111,21 +111,21 @@ class Configuration { * @exception BadConfigurationException si CONF_PATH_NAME mal formaté */ private static function parseFile () { - if (!file_exists (APP_PATH . self::CONF_PATH_NAME)) { + if (!file_exists (DATA_PATH . self::CONF_PATH_NAME)) { throw new FileNotExistException ( - APP_PATH . self::CONF_PATH_NAME, + DATA_PATH . self::CONF_PATH_NAME, MinzException::ERROR ); } $ini_array = parse_ini_file ( - APP_PATH . self::CONF_PATH_NAME, + DATA_PATH . self::CONF_PATH_NAME, true ); if (!$ini_array) { throw new PermissionDeniedException ( - APP_PATH . self::CONF_PATH_NAME, + DATA_PATH . self::CONF_PATH_NAME, MinzException::ERROR ); } diff --git a/lib/minz/dao/Model_pdo.php b/lib/minz/dao/Model_pdo.php index dd75153be..beeb65ea8 100755 --- a/lib/minz/dao/Model_pdo.php +++ b/lib/minz/dao/Model_pdo.php @@ -49,9 +49,7 @@ class Model_pdo { PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' ); } elseif($type == 'sqlite') { - $string = $type - . ':/' . PUBLIC_PATH - . '/data/' . $db['base'] . '.sqlite'; //TODO: DEBUG UTF-8 http://www.siteduzero.com/forum/sujet/sqlite-connexion-utf-8-18797 + $string = $type . ':/' . DATA_PATH . $db['base'] . '.sqlite'; //TODO: DEBUG UTF-8 http://www.siteduzero.com/forum/sujet/sqlite-connexion-utf-8-18797 } $this->bd = new FreshPDO ( @@ -86,7 +84,7 @@ class Model_pdo { class FreshPDO extends PDO { private static function check($statement) { if (preg_match('/^(?:UPDATE|INSERT|DELETE)/i', $statement)) { - touch(PUBLIC_PATH . '/data/touch.txt'); + touch(DATA_PATH . '/touch.txt'); } } diff --git a/log/.gitignore b/log/.gitignore deleted file mode 100644 index 72e8ffc0d..000000000 --- a/log/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/public/data/.gitignore b/public/data/.gitignore deleted file mode 100644 index 8498bc17e..000000000 --- a/public/data/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -favicons -Configuration.array.php -*.sqlite -touch.txt \ No newline at end of file diff --git a/public/data/grey.gif b/public/data/grey.gif deleted file mode 100644 index c7212bc1f..000000000 Binary files a/public/data/grey.gif and /dev/null differ diff --git a/public/index.php b/public/index.php index bda585592..d989bc11d 100755 --- a/public/index.php +++ b/public/index.php @@ -20,16 +20,16 @@ require('../constants.php'); -if (file_exists (PUBLIC_PATH . '/install.php')) { +if (file_exists ('install.php')) { include ('install.php'); } else { session_cache_limiter(''); require (LIB_PATH . '/http-conditional.php'); $dateLastModification = max( - @filemtime(PUBLIC_PATH . '/data/touch.txt'), + @filemtime(DATA_PATH . '/touch.txt'), @filemtime(LOG_PATH . '/application.log'), - @filemtime(PUBLIC_PATH . '/data/Configuration.array.php'), - @filemtime(APP_PATH . '/configuration/application.ini') + @filemtime(DATA_PATH . '/Configuration.array.php'), + @filemtime(DATA_PATH . '/application.ini') ); if (httpConditional($dateLastModification, 0, 0, false, false, true)) { exit(); //No need to send anything diff --git a/public/install.php b/public/install.php index 4c0da0ce5..085a412ff 100644 --- a/public/install.php +++ b/public/install.php @@ -166,7 +166,7 @@ function saveStep2 () { . small_hash ($_SESSION['base_url'] . $_SESSION['sel']); } - $file_data = PUBLIC_PATH . '/data/Configuration.array.php'; + $file_data = DATA_PATH . '/Configuration.array.php'; $f = fopen ($file_data, 'w'); writeLine ($f, ' $php ? 'ok' : 'ko', @@ -276,11 +276,11 @@ function checkStep1 () { 'curl' => $curl ? 'ok' : 'ko', 'pdo-mysql' => $pdo ? 'ok' : 'ko', 'dom' => $dom ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', 'cache' => $cache ? 'ok' : 'ko', 'log' => $log ? 'ok' : 'ko', - 'configuration' => $conf ? 'ok' : 'ko', - 'data' => $data ? 'ok' : 'ko', - 'all' => $php && $minz && $curl && $pdo && $dom && $cache && $log && $conf && $data ? 'ok' : 'ko' + 'favicons' => $favicons ? 'ok' : 'ko', + 'all' => $php && $minz && $curl && $pdo && $dom && $data && $cache && $log && $favicons ? 'ok' : 'ko' ); } function checkStep2 () { @@ -289,7 +289,7 @@ function checkStep2 () { isset ($_SESSION['title']) && isset ($_SESSION['old_entries']) && isset ($_SESSION['mail_login']); - $data = file_exists (PUBLIC_PATH . '/data/Configuration.array.php'); + $data = file_exists (DATA_PATH . '/Configuration.array.php'); return array ( 'conf' => $conf ? 'ok' : 'ko', @@ -298,7 +298,7 @@ function checkStep2 () { ); } function checkStep3 () { - $conf = file_exists (APP_PATH . '/configuration/application.ini'); + $conf = file_exists (DATA_PATH . '/application.ini'); $bd = isset ($_SESSION['bd_type']) && isset ($_SESSION['bd_host']) && isset ($_SESSION['bd_user']) && @@ -337,8 +337,7 @@ function checkBD () { // on écrase la précédente connexion en sélectionnant la nouvelle BDD $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_name']; } elseif($_SESSION['bd_type'] == 'sqlite') { - $str = 'sqlite:' . PUBLIC_PATH - . '/data/' . $_SESSION['bd_name'] . '.sqlite'; + $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_name'] . '.sqlite'; } $c = new PDO ($str, @@ -370,8 +369,8 @@ function checkBD () { $error = true; } - if ($error && file_exists (APP_PATH . '/configuration/application.ini')) { - unlink (APP_PATH . '/configuration/application.ini'); + if ($error && file_exists (DATA_PATH . '/application.ini')) { + unlink (DATA_PATH . '/application.ini'); } return !$error; @@ -448,28 +447,28 @@ function printStep1 () {

+ +

+ +

+ +

-

+

-

- - - -

- -

+

- -

+ +

-

+

diff --git a/public/themes/icons/grey.gif b/public/themes/icons/grey.gif new file mode 100644 index 000000000..c7212bc1f Binary files /dev/null and b/public/themes/icons/grey.gif differ -- cgit v1.2.3 From 7cdc477c45a84bde56f5253ce34924f164e6ca0a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 28 Nov 2013 20:59:31 +0100 Subject: touch en microsecondes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passage en microsecondes pour le touch (gestion du cache) pour éviter les problèmes en particulier dans le cas de requêtes de moins d'une seconde. Nouvelle fonction invalidateHttpCache() pour plus facilement changer de méthode de contrôle de fraîcheur de cache. Devrait résoudre https://github.com/marienfressinaud/FreshRSS/issues/296 --- actualize_script.php | 2 +- app/controllers/entryController.php | 2 +- app/controllers/indexController.php | 4 ++-- app/layout/layout.phtml | 2 +- app/models/RSSConfiguration.php | 2 +- lib/lib_rss.php | 4 ++++ lib/minz/dao/Model_pdo.php | 2 +- public/index.php | 7 ++++--- 8 files changed, 15 insertions(+), 10 deletions(-) (limited to 'actualize_script.php') diff --git a/actualize_script.php b/actualize_script.php index bc1d108bd..942070ccc 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -20,4 +20,4 @@ $front_controller = new App_FrontController (); $front_controller->init (); Session::_param('mail', true); // permet de se passer de la phase de connexion $front_controller->run (); -touch(DATA_PATH . '/touch.txt'); +invalidateHttpCache(); diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php index fa34ad429..d92eb0ed3 100755 --- a/app/controllers/entryController.php +++ b/app/controllers/entryController.php @@ -84,7 +84,7 @@ class entryController extends ActionController { $entryDAO = new EntryDAO(); $entryDAO->optimizeTable(); - touch(DATA_PATH . '/touch.txt'); + invalidateHttpCache(); $notif = array ( 'type' => 'good', diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index e4462e543..8e6abd682 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -272,7 +272,7 @@ class indexController extends ActionController { $res = json_decode ($result, true); if ($res['status'] == 'okay' && $res['email'] == $this->view->conf->mailLogin ()) { Session::_param ('mail', $res['email']); - touch(DATA_PATH . '/touch.txt'); + invalidateHttpCache(); } else { $res = array (); $res['status'] = 'failure'; @@ -285,6 +285,6 @@ class indexController extends ActionController { public function logoutAction () { $this->view->_useLayout (false); Session::_param ('mail'); - touch(DATA_PATH . '/touch.txt'); + invalidateHttpCache(); } } diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index c53b28841..9b502275c 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -32,7 +32,7 @@ notification)) { - touch(DATA_PATH . '/touch.txt'); + invalidateHttpCache(); ?>
notification['content']; ?> diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php index c36548e6f..fe6cd48d3 100755 --- a/app/models/RSSConfiguration.php +++ b/app/models/RSSConfiguration.php @@ -473,6 +473,6 @@ class RSSConfigurationDAO extends Model_array { } $this->writeFile($this->array); - touch(DATA_PATH . '/touch.txt'); + invalidateHttpCache(); } } diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 3c03f4281..5a74bfd0a 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -230,3 +230,7 @@ function lazyimg($content) { $content ); } + +function invalidateHttpCache() { + file_put_contents(DATA_PATH . '/touch.txt', microtime(true)); +} diff --git a/lib/minz/dao/Model_pdo.php b/lib/minz/dao/Model_pdo.php index 545f59e81..48c81d082 100755 --- a/lib/minz/dao/Model_pdo.php +++ b/lib/minz/dao/Model_pdo.php @@ -85,7 +85,7 @@ class Model_pdo { class FreshPDO extends PDO { private static function check($statement) { if (preg_match('/^(?:UPDATE|INSERT|DELETE)/i', $statement)) { - touch(DATA_PATH . '/touch.txt'); + invalidateHttpCache(); } } diff --git a/public/index.php b/public/index.php index 9bf4fc073..cabd836d5 100755 --- a/public/index.php +++ b/public/index.php @@ -27,10 +27,11 @@ if (file_exists ('install.php')) { if (!file_exists(DATA_PATH . '/no-cache.txt')) { require (LIB_PATH . '/http-conditional.php'); $dateLastModification = max( - @filemtime(DATA_PATH . '/touch.txt') - 1, - @filemtime(LOG_PATH . '/application.log') - 1, - @filemtime(DATA_PATH . '/application.ini') - 1 + @filemtime(DATA_PATH . '/touch.txt'), + @filemtime(LOG_PATH . '/application.log'), + @filemtime(DATA_PATH . '/application.ini') ); + $_SERVER['QUERY_STRING'] .= '&utime=' . file_get_contents(DATA_PATH . '/touch.txt'); if (httpConditional($dateLastModification, 0, 0, false, false, true)) { exit(); //No need to send anything } -- cgit v1.2.3 From 755fdd9026c7d8c38fa34586a52bc80a97d81aaa Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 15 Dec 2013 03:38:17 +0100 Subject: Refactorisation : fichier oublié MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suite de https://github.com/marienfressinaud/FreshRSS/commit/878e96202e8a22e4857b98e29b0a1fce68eccbc9 --- actualize_script.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actualize_script.php') diff --git a/actualize_script.php b/actualize_script.php index 942070ccc..b6baa0a30 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -14,10 +14,10 @@ set_include_path (get_include_path () . PATH_SEPARATOR . APP_PATH); -require (APP_PATH . '/App_FrontController.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader -$front_controller = new App_FrontController (); +$front_controller = new FreshRSS (); $front_controller->init (); -Session::_param('mail', true); // permet de se passer de la phase de connexion +Minz_Session::_param('mail', true); // permet de se passer de la phase de connexion $front_controller->run (); invalidateHttpCache(); -- cgit v1.2.3 From 96bf9e5159df8a1217b2dbcff3210505c5c9ac1d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 15 Dec 2013 03:39:59 +0100 Subject: set_include_path oublié MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suite de https://github.com/marienfressinaud/FreshRSS/commit/755fdd9026c7d8c38fa34586a52bc80a97d81aaa --- actualize_script.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'actualize_script.php') diff --git a/actualize_script.php b/actualize_script.php index b6baa0a30..7986ba0b5 100755 --- a/actualize_script.php +++ b/actualize_script.php @@ -6,14 +6,6 @@ $_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(LIB_PATH . '/lib_rss.php'); //Includes class autoloader $front_controller = new FreshRSS (); -- cgit v1.2.3 From 3ba5223e1350bf0c38a81722a7669871400b340a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 26 Dec 2013 13:26:05 +0100 Subject: Déplacement de ./actualize_script.php sous ./app/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour une meilleure protection par défaut --- CHANGELOG | 1 + README.md | 2 +- actualize_script.php | 15 --------------- app/.htaccess | 3 +++ app/actualize_script.php | 15 +++++++++++++++ app/index.html | 13 +++++++++++++ data/index.html | 2 +- index.html | 1 + lib/.htaccess | 3 +++ 9 files changed, 38 insertions(+), 17 deletions(-) delete mode 100755 actualize_script.php create mode 100644 app/.htaccess create mode 100755 app/actualize_script.php create mode 100644 app/index.html create mode 100644 lib/.htaccess (limited to 'actualize_script.php') diff --git a/CHANGELOG b/CHANGELOG index 9ae3d3f62..336245269 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -53,6 +53,7 @@ * Déplacement de “./public/data/Configuration.array.php” vers “./data/*_user.php” * Déplacement de “./public/index.php” vers “./p/i/index.php” (voir cookie ci-dessous) * Déplacement de “./public/” vers “./p/” + * Déplacement de “./actualize_script.php” vers “./app/actualize_script.php” * Divers : * Nouvelle politique de cookie de session (témoin de connexion) * Utilise un nom poli “FreshRSS” diff --git a/README.md b/README.md index 210ec64cc..5051a936c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Il est recommandé de limiter l’accès à votre FreshRSS, soit : # Rafraîchissement automatique des flux * Vous pouvez ajouter une tâche CRON sur le script d’actualisation des flux. Par exemple, pour exécuter le script toutes les heures : ``` -7 * * * * php /chemin/vers/freshrss/actualize_script.php >/dev/null 2>&1 +7 * * * * php /chemin/vers/FreshRSS/app/actualize_script.php >/dev/null 2>&1 ``` # Conseils diff --git a/actualize_script.php b/actualize_script.php deleted file mode 100755 index 7986ba0b5..000000000 --- a/actualize_script.php +++ /dev/null @@ -1,15 +0,0 @@ -init (); -Minz_Session::_param('mail', true); // permet de se passer de la phase de connexion -$front_controller->run (); -invalidateHttpCache(); diff --git a/app/.htaccess b/app/.htaccess new file mode 100644 index 000000000..9e768397d --- /dev/null +++ b/app/.htaccess @@ -0,0 +1,3 @@ +Order Allow,Deny +Deny from all +Satisfy all diff --git a/app/actualize_script.php b/app/actualize_script.php new file mode 100755 index 000000000..20438128a --- /dev/null +++ b/app/actualize_script.php @@ -0,0 +1,15 @@ +init (); +Minz_Session::_param('mail', true); // permet de se passer de la phase de connexion +$front_controller->run (); +invalidateHttpCache(); diff --git a/app/index.html b/app/index.html new file mode 100644 index 000000000..85faaa37e --- /dev/null +++ b/app/index.html @@ -0,0 +1,13 @@ + + + + + +Redirection + + + + +

Redirection

+ + diff --git a/data/index.html b/data/index.html index 2f3b51848..85faaa37e 100644 --- a/data/index.html +++ b/data/index.html @@ -4,7 +4,7 @@ Redirection - + diff --git a/index.html b/index.html index bbea573c7..1bfdea859 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ Redirection + diff --git a/lib/.htaccess b/lib/.htaccess new file mode 100644 index 000000000..9e768397d --- /dev/null +++ b/lib/.htaccess @@ -0,0 +1,3 @@ +Order Allow,Deny +Deny from all +Satisfy all -- cgit v1.2.3