aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-01 16:23:35 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-01 16:23:35 +0100
commit85e7ac96a10ffd9277ca3b11433a69ad0588a02e (patch)
treecbf15644d9dc13add7a19b3799d15d9ee99ac619
parentf2321eb9201babb4f22a3563bc4c343f6f560aec (diff)
Charge lib_phpQuery uniquement au besoin
Évite de charger lib_phpQuery (170ko de code tout de même) jusqu'au moment où la librairie est éventuellement nécessaire (c'est-à-dire pour le téléchargement du contenu des articles tronqués, si cette fonctionnalité est utilisée)
-rw-r--r--app/App_FrontController.php1
-rw-r--r--lib/lib_rss.php2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/App_FrontController.php b/app/App_FrontController.php
index 176677781..0721dba45 100644
--- a/app/App_FrontController.php
+++ b/app/App_FrontController.php
@@ -19,7 +19,6 @@ class App_FrontController extends FrontController {
}
private function loadLibs () {
- require (LIB_PATH . '/lib_phpQuery.php');
require (LIB_PATH . '/lib_rss.php');
require (LIB_PATH . '/SimplePie_autoloader.php');
}
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 08e65a45f..93fa48af0 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -159,6 +159,8 @@ function getFeed ($outline, $cat_id) {
/* permet de récupérer le contenu d'un article pour un flux qui n'est pas complet */
function get_content_by_parsing ($url, $path) {
+ require_once (LIB_PATH . '/lib_phpQuery.php');
+
$html = file_get_contents ($url);
if ($html) {