diff --git a/README.fr.md b/README.fr.md
index 794b1a9e1..a173f0a75 100644
--- a/README.fr.md
+++ b/README.fr.md
@@ -33,7 +33,7 @@ Nous sommes une communauté amicale.
* Serveur modeste, par exemple sous Linux ou Windows
* Fonctionne même sur un Raspberry Pi 1 avec des temps de réponse < 1s (testé sur 150 flux, 22k articles)
* Serveur Web Apache2 (recommandé), ou nginx, lighttpd (non testé sur les autres)
-* PHP 5.2.1+ (PHP 5.3.7+ recommandé, et PHP 5.5+ pour les performances) (support bêta de PHP 7 avec encore meilleures performances)
+* PHP 5.3+ (PHP 5.3.7+ recommandé, et PHP 5.5+ pour les performances, et PHP 7+ pour d’encore meilleures performances)
* Requis : [PDO_MySQL](http://php.net/pdo-mysql) ou [PDO_SQLite](http://php.net/pdo-sqlite), [cURL](http://php.net/curl), [GMP](http://php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](http://php.net/intl.idn) (pour les noms de domaines internationalisés)
* Recommandés : [iconv](http://php.net/iconv), [JSON](http://php.net/json), [mbstring](http://php.net/mbstring), [Zip](http://php.net/zip), [zlib](http://php.net/zlib)
* Inclus par défaut : [DOM](http://php.net/dom), [XML](http://php.net/xml)…
diff --git a/README.md b/README.md
index 728204a38..4d3bb5c4c 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ We are a friendly community.
* Light server running Linux or Windows
* It even works on Raspberry Pi 1 with response time under a second (tested with 150 feeds, 22k articles)
* A web server: Apache2 (recommended), nginx, lighttpd (not tested on others)
-* PHP 5.2.1+ (PHP 5.3.7+ recommended, and PHP 5.5+ for performance) (beta support for PHP 7 with even higher performance)
+* PHP 5.3+ (PHP 5.3.7+ recommended, and PHP 5.5+ for performance, and PHP 7 for even higher performance)
* Required extensions: [PDO_MySQL](http://php.net/pdo-mysql) or [PDO_SQLite](http://php.net/pdo-sqlite), [cURL](http://php.net/curl), [GMP](http://php.net/gmp) (for API access on platforms < 64 bits), [IDN](http://php.net/intl.idn) (for Internationalized Domain Names)
* Recommended extensions: [iconv](http://php.net/iconv), [JSON](http://php.net/json), [mbstring](http://php.net/mbstring), [Zip](http://php.net/zip), [zlib](http://php.net/zlib)
* Enabled by default: [DOM](http://php.net/dom), [XML](http://php.net/xml)…
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index baaf99065..7e626720e 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -32,42 +32,44 @@ class FreshRSS_index_Controller extends Minz_ActionController {
Minz_Error::error(404);
}
- try {
- $entries = $this->listEntriesByContext();
+ $this->view->callbackBeforeContent = function() {
+ try {
+ $entries = $this->listEntriesByContext();
- $nb_entries = count($entries);
- if ($nb_entries > FreshRSS_Context::$number) {
- // We have more elements for pagination
- $last_entry = array_pop($entries);
- FreshRSS_Context::$next_id = $last_entry->id();
- }
-
- $first_entry = $nb_entries > 0 ? $entries[0] : null;
- FreshRSS_Context::$id_max = $first_entry === null ?
- (time() - 1) . '000000' :
- $first_entry->id();
- if (FreshRSS_Context::$order === 'ASC') {
- // In this case we do not know but we guess id_max
- $id_max = (time() - 1) . '000000';
- if (strcmp($id_max, FreshRSS_Context::$id_max) > 0) {
- FreshRSS_Context::$id_max = $id_max;
+ $nb_entries = count($entries);
+ if ($nb_entries > FreshRSS_Context::$number) {
+ // We have more elements for pagination
+ $last_entry = array_pop($entries);
+ FreshRSS_Context::$next_id = $last_entry->id();
}
+
+ $first_entry = $nb_entries > 0 ? $entries[0] : null;
+ FreshRSS_Context::$id_max = $first_entry === null ?
+ (time() - 1) . '000000' :
+ $first_entry->id();
+ if (FreshRSS_Context::$order === 'ASC') {
+ // In this case we do not know but we guess id_max
+ $id_max = (time() - 1) . '000000';
+ if (strcmp($id_max, FreshRSS_Context::$id_max) > 0) {
+ FreshRSS_Context::$id_max = $id_max;
+ }
+ }
+
+ $this->view->entries = $entries;
+ } catch (FreshRSS_EntriesGetter_Exception $e) {
+ Minz_Log::notice($e->getMessage());
+ Minz_Error::error(404);
}
- $this->view->entries = $entries;
- } catch (FreshRSS_EntriesGetter_Exception $e) {
- Minz_Log::notice($e->getMessage());
- Minz_Error::error(404);
- }
+ $this->view->categories = FreshRSS_Context::$categories;
- $this->view->categories = FreshRSS_Context::$categories;
-
- $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title();
- $title = FreshRSS_Context::$name;
- if (FreshRSS_Context::$get_unread > 0) {
- $title = '(' . FreshRSS_Context::$get_unread . ') ' . $title;
- }
- Minz_View::prependTitle($title . ' · ');
+ $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title();
+ $title = FreshRSS_Context::$name;
+ if (FreshRSS_Context::$get_unread > 0) {
+ $title = '(' . FreshRSS_Context::$get_unread . ') ' . $title;
+ }
+ Minz_View::prependTitle($title . ' · ');
+ };
}
/**
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index bafa970da..562d8e2cd 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -34,7 +34,7 @@ class FreshRSS extends Minz_FrontController {
// Auth has to be initialized before using currentUser session parameter
// because it's this part which create this parameter.
- $this->initAuth();
+ self::initAuth();
// Then, register the user configuration and use the configuration setter
// created above.
@@ -46,10 +46,7 @@ class FreshRSS extends Minz_FrontController {
// Finish to initialize the other FreshRSS / Minz components.
FreshRSS_Context::init();
- $this->initI18n();
- FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php'));
- $this->loadStylesAndScripts();
- $this->loadNotifications();
+ self::initI18n();
// Enable extensions for the current (logged) user.
if (FreshRSS_Auth::hasAccess()) {
$ext_list = FreshRSS_Context::$user_conf->extensions_enabled;
@@ -57,7 +54,7 @@ class FreshRSS extends Minz_FrontController {
}
}
- private function initAuth() {
+ private static function initAuth() {
FreshRSS_Auth::init();
if (Minz_Request::isPost() && !is_referer_from_same_domain()) {
// Basic protection against XSRF attacks
@@ -74,12 +71,12 @@ class FreshRSS extends Minz_FrontController {
}
}
- private function initI18n() {
+ private static function initI18n() {
Minz_Session::_param('language', FreshRSS_Context::$user_conf->language);
Minz_Translate::init(FreshRSS_Context::$user_conf->language);
}
- private function loadStylesAndScripts() {
+ private static function loadStylesAndScripts() {
$theme = FreshRSS_Themes::load(FreshRSS_Context::$user_conf->theme);
if ($theme) {
foreach($theme['files'] as $file) {
@@ -91,9 +88,9 @@ class FreshRSS extends Minz_FrontController {
$filename = $file;
}
$filetime = @filemtime(PUBLIC_PATH . '/themes/' . $theme_id . '/' . $filename);
- Minz_View::appendStyle(Minz_Url::display(
- '/themes/' . $theme_id . '/' . $filename . '?' . $filetime
- ));
+ $url = '/themes/' . $theme_id . '/' . $filename . '?' . $filetime;
+ header('Link: <' . Minz_Url::display($url, '', 'root') . '>;rel=preload', false); //HTTP2
+ Minz_View::appendStyle(Minz_Url::display($url));
}
}
@@ -110,6 +107,14 @@ class FreshRSS extends Minz_FrontController {
}
}
+ private static function loadNotifications() {
+ $notif = Minz_Session::param('notification');
+ if ($notif) {
+ Minz_View::_param('notification', $notif);
+ Minz_Session::_param('notification');
+ }
+ }
+
public static function preLayout() {
switch (Minz_Request::controllerName()) {
case 'index':
@@ -123,13 +128,9 @@ class FreshRSS extends Minz_FrontController {
break;
}
header("X-Content-Type-Options: nosniff");
- }
- private function loadNotifications() {
- $notif = Minz_Session::param('notification');
- if ($notif) {
- Minz_View::_param('notification', $notif);
- Minz_Session::_param('notification');
- }
+ FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php'));
+ self::loadStylesAndScripts();
+ self::loadNotifications();
}
}
diff --git a/app/Models/Themes.php b/app/Models/Themes.php
index e3b260261..5a6ec0a05 100644
--- a/app/Models/Themes.php
+++ b/app/Models/Themes.php
@@ -116,7 +116,3 @@ class FreshRSS_Themes extends Minz_Model {
'';
}
}
-
-function _i($icon, $url_only = false) {
- return FreshRSS_Themes::icon($icon, $url_only);
-}
diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml
index 99a3717bc..6906fa05f 100644
--- a/app/layout/layout.phtml
+++ b/app/layout/layout.phtml
@@ -1,35 +1,16 @@
-
+