diff options
| author | 2012-11-06 22:02:20 +0100 | |
|---|---|---|
| committer | 2012-11-06 22:02:20 +0100 | |
| commit | f3f2bc7471ebb77e6f8adfa5371d055980401bef (patch) | |
| tree | a7674f7dc6f8495682499cb2df9f420a7a5303c5 | |
| parent | 87ae244176567ecd83642dc4a2646465aac15a46 (diff) | |
Limitation du nombre d'articles à charger en utilisant le chargement par parsing (pour éviter les débordements de mémoire)
| -rw-r--r-- | app/models/Feed.php | 6 | ||||
| -rw-r--r-- | public/data/Configuration.array.php | 9 |
2 files changed, 15 insertions, 0 deletions
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 @@ +<?php +return array ( + 'posts_per_page' => 10, + 'default_view' => 'all', + 'display_posts' => 'no', + 'sort_order' => 'low_to_high', + 'old_entries' => 3, + 'mail_login' => '', +); |
