diff options
author | Andreas Gohr <andi@splitbrain.org> | 2007-03-12 21:34:19 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2007-03-12 21:34:19 +0100 |
commit | a307fd7ad74b8985f80754dc26c38963d4fe6f5f (patch) | |
tree | 6547a81a746f1c3391e3c5ba21c92f01c568b8b7 /inc | |
parent | ded1910a68360c0cab7075a0d0ba7e23d39cacc8 (diff) | |
download | rpg-a307fd7ad74b8985f80754dc26c38963d4fe6f5f.tar.gz rpg-a307fd7ad74b8985f80754dc26c38963d4fe6f5f.tar.bz2 |
fix for the new SimplePie
SimplePie changed the method to fetch the feed, this patch restores the usage
of DokuWiki's own HTTP client.
darcs-hash:20070312203419-7ad00-a3ef0c6d810d59f618165b3968e61b6d8a5a68a0.gz
Diffstat (limited to 'inc')
-rw-r--r-- | inc/FeedParser.php | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/inc/FeedParser.php b/inc/FeedParser.php index 7c0071af0..f110ef132 100644 --- a/inc/FeedParser.php +++ b/inc/FeedParser.php @@ -20,16 +20,50 @@ class FeedParser extends SimplePie { */ function FeedParser(){ $this->SimplePie(); - $this->caching = false; + $this->enable_caching(false); + $this->set_file_class('FeedParser_File'); } +} + +/** + * Fetch an URL using our own HTTPClient + * + * Replaces SimplePie's own class + */ +class FeedParser_File extends SimplePie_File { + var $http; + var $useragent; + var $success = true; + var $headers = array(); + var $body; + var $error; /** - * Fetch an URL using our own HTTPClient + * Inititializes the HTTPClient * - * Overrides SimplePie's own method + * We ignore all given parameters - they are set in DokuHTTPClient */ - function get_file($url){ - $http = new DokuHTTPClient(); - return $http->get($url,true); + function FeedParser_File($url, $timeout=10, $redirects=5, + $headers=null, $useragent=null, $force_fsockopen=false) { + $this->http = new DokuHTTPClient(); + $this->success = $this->http->sendRequest($url); + + $this->headers = $this->http->resp_headers; + $this->body = $this->http->resp_body; + $this->error = $this->http->error; + return $this->success; } + + function headers(){ + return $this->headers; + } + + function body(){ + return $this->body; + } + + function close(){ + return true; + } + } |