Skip to content

Instantly share code, notes, and snippets.

@samsonasik
Created April 12, 2013 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samsonasik/5370196 to your computer and use it in GitHub Desktop.
Save samsonasik/5370196 to your computer and use it in GitHub Desktop.
using simplepie
1. copy to vendor folder.
2. edit index.php
chdir(dirname(__DIR__));
// Setup autoloading
require 'init_autoloader.php';
//require the simplepie
require './vendor/SimplePie/autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
3. test it! call from controller :
public function indexAction()
{
$feed = new \SimplePie();
$feed->set_feed_url('feed://samsonasik.wordpress.com/feed');
$feed->set_item_class();
$feed->enable_cache(true);
$feed->set_cache_duration(3600);
$feed->set_cache_location('./data/cache');
$feed->init();
$feed->handle_content_type();
\Zend\Debug\Debug::dump($feed->get_items());
die;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment