Skip to content

Commit

Permalink
Suggest install of simplepie lib (been removed from SS core master)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillu committed Jul 1, 2013
1 parent f7c33e4 commit 294074b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions code/widgets/RSSWidget.php
Expand Up @@ -66,10 +66,17 @@ function getFeedItems() {
return $output;
}

include_once(Director::getAbsFile(SAPPHIRE_DIR . '/thirdparty/simplepie/simplepie.inc'));
if(!class_exists('SimplePie')) {
throw new LogicException(
'Please install the "simplepie/simplepie" library by adding it to the "require" '
+ 'section of your composer.json'
);
}

$t1 = microtime(true);
$feed = new SimplePie($this->AbsoluteRssUrl, TEMP_FOLDER);
$feed = new SimplePie();
$feed->set_feed_url($this->AbsoluteRssUrl);
$feed->set_cache_location(TEMP_FOLDER);
$feed->init();
if($items = $feed->get_items(0, $this->NumberToShow)) {
foreach($items as $item) {
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Expand Up @@ -18,9 +18,10 @@
{
"silverstripe/cms": ">=3.1.x-dev,<4.0"
},
"suggests":
"suggest":
{
"silverstripe/widgets": "dev-master",
"silverstripe/comments": "dev-master"
"silverstripe/widgets": "Additional 'sidebar features', e.g. a list of recent posts and a tagcloud",
"silverstripe/comments": "Enable user comments on any page type, including blog posts",
"simplepie/simplepie": "Parse RSS feeds, required for the RSS widget"
}
}

0 comments on commit 294074b

Please sign in to comment.