Hi - I’m writing a plugin for parsing RSS feeds. I wanted to take the opportunity to try to link it in with Codeigniter.
So… I grabbed Eliot Haughin’s great CI wrapper for SimplePie, and dropped it into the System/Libraries folder.
I’ve been able to call it and do everything I normally would with CI like this:
$this->EE->load->library('simplepie');I just wondered if anyone could see anything wrong with this approach? Should I be putting the library in the plugin folder instead?
I’ve also run into an issue trying to override one of the functions. I tried loading
$this->EE->load->library('simplepiecustom');straight after loading simplepie. The custom class is just set up to override one function, but I can’t seem to get it to work - the class loads in without an error, but the original sort function still gets called.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Simplepiecustom extends SimplePie
{
function Simplepiecustom()
{
parent::SimplePie();
}
function sort_items($a, $b)
{
return strcasecmp($a->get_title(), $b->get_title());
}
}
?>Anyone have any advice?!
Thanks Tim
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.