Skip to content

Instantly share code, notes, and snippets.

@AJ
Last active December 15, 2015 09:59
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 AJ/5242960 to your computer and use it in GitHub Desktop.
Save AJ/5242960 to your computer and use it in GitHub Desktop.
//Script location: /public/myapp/includes/simplepie/library/SimplePie/Cache/Custom_Cache.php
class Custom_Cache extends SimplePie_Cache {
function __construct() {
error_log("AJ::Success!!! Succeeded in reaching the cache class::Constructor");
}
function create($location, $filename, $extension) {
error_log("AJ::Success!!! Succeeded in reaching the cache class");
die;
return new Skimr_DB_Cache(/*$location, $filename, $extension*/);
}
}
class Skimr_DB_Cache extends SimplePie_Cache_DB {
.
.
.
public function __construct($location, $name, $type);
public function save($data);
public function load();
//And so on
.
.
.
}
//Script location: /public/myapp/includes/utils.php
function fetchFeed() {
$feed = new SimplePie();
$feed->set_feed_url($feedURL);
$feed->handle_content_type();
$feed->force_feed(true);
$feed->get_registry()->register('Cache', 'Custom_Cache');
$feed->init();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment