Files
FreshRSS/public/index.php
Alexandre Alapetite 878e96202e Grosse refactorisation pour permettre le chargement automatique des classes
C'est parti de changements pour
https://github.com/marienfressinaud/FreshRSS/issues/255 et finalement
j'ai continué la refactorisation...

Ajout de préfixes FreshRSS_ et Minz_ sur le modèle de SimplePie_.
Toutes les classes sont maintenant en chargement automatique (devrait
améliorer les performances en évitant de charger plein de classes
inutilisées, et faciliter la maintenance).
Suppression de set_include_path().
Si souhaité, certaines classes de Minz pourraient être déplacées dans un
sous-répertoire, par exemple les exceptions.

Tests et relecture nécessaires.
2013-12-15 03:30:24 +01:00

52 lines
1.7 KiB
PHP
Executable File

<?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 *****
if (file_exists ('install.php')) {
require('install.php');
} else {
require('../constants.php');
session_cache_limiter('');
if (!file_exists(DATA_PATH . '/no-cache.txt')) {
require (LIB_PATH . '/http-conditional.php');
$dateLastModification = max(
@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'); //For ETag
if (httpConditional($dateLastModification, 0, 0, false, false, true)) {
exit(); //No need to send anything
}
}
require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
try {
$front_controller = new FreshRSS();
$front_controller->init ();
$front_controller->run ();
} catch (Exception $e) {
echo '### Fatal error! ###<br />', "\n";
Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
echo 'See logs files.';
}
}