| 1 | <?php |
||
| 37 | class FeedParser_File extends SimplePie_File { |
||
| 38 | var $http; |
||
| 39 | var $useragent; |
||
| 40 | var $success = true; |
||
| 41 | var $headers = array(); |
||
| 42 | var $body; |
||
| 43 | var $error; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Inititializes the HTTPClient |
||
| 47 | * |
||
| 48 | * We ignore all given parameters - they are set in DokuHTTPClient |
||
| 49 | */ |
||
| 50 | function __construct($url, $timeout=10, $redirects=5, |
||
| 51 | $headers=null, $useragent=null, $force_fsockopen=false) { |
||
| 52 | $this->http = new DokuHTTPClient(); |
||
| 53 | $this->success = $this->http->sendRequest($url); |
||
| 54 | |||
| 55 | $this->headers = $this->http->resp_headers; |
||
| 56 | $this->body = $this->http->resp_body; |
||
| 57 | $this->error = $this->http->error; |
||
| 58 | |||
| 59 | $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN; |
||
| 60 | |||
| 61 | return $this->success; |
||
| 62 | } |
||
| 63 | |||
| 64 | function headers(){ |
||
| 67 | |||
| 68 | function body(){ |
||
| 71 | |||
| 72 | function close(){ |
||
| 75 | |||
| 76 | } |
||
| 77 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.