From f3f2bc7471ebb77e6f8adfa5371d055980401bef Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 6 Nov 2012 22:02:20 +0100 Subject: [PATCH] =?UTF-8?q?Limitation=20du=20nombre=20d'articles=20=C3=A0?= =?UTF-8?q?=20charger=20en=20utilisant=20le=20chargement=20par=20parsing?= =?UTF-8?q?=20(pour=20=C3=A9viter=20les=20d=C3=A9bordements=20de=20m=C3=A9?= =?UTF-8?q?moire)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Feed.php | 6 ++++++ public/data/Configuration.array.php | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/app/models/Feed.php b/app/models/Feed.php index 7568069b0..d8b975038 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -88,6 +88,7 @@ class Feed extends Model { private function loadEntries ($feed) { $entries = array (); + $i = 0; foreach ($feed->get_items () as $item) { $title = $item->get_title (); $author = $item->get_author (); @@ -100,6 +101,7 @@ class Feed extends Model { if ($path) { try { $content = get_content_by_parsing ($item->get_permalink (), $path); + $i++; } catch (Exception $e) { $content = $item->get_content (); } @@ -118,6 +120,10 @@ class Feed extends Model { ); $entries[$entry->id ()] = $entry; + + if ($i > 10) { + break; + } } $this->entries = $entries; diff --git a/public/data/Configuration.array.php b/public/data/Configuration.array.php index e69de29bb..ca5af0a01 100644 --- a/public/data/Configuration.array.php +++ b/public/data/Configuration.array.php @@ -0,0 +1,9 @@ + 10, + 'default_view' => 'all', + 'display_posts' => 'no', + 'sort_order' => 'low_to_high', + 'old_entries' => 3, + 'mail_login' => '', +);