1 | <?php |
||
17 | class Fetcher { |
||
18 | |||
19 | private $fetchers; |
||
20 | |||
21 | public function __construct(){ |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Add an additional fetcher |
||
28 | * @param IFeedFetcher $fetcher the fetcher |
||
29 | */ |
||
30 | public function registerFetcher(IFeedFetcher $fetcher){ |
||
33 | |||
34 | /** |
||
35 | * Fetch a feed from remote |
||
36 | * @param string $url remote url of the feed |
||
37 | * @param boolean $getFavicon if the favicon should also be fetched, |
||
38 | * defaults to true |
||
39 | * @param string $lastModified a last modified value from an http header |
||
40 | * defaults to false. If lastModified matches the http header from the feed |
||
41 | * no results are fetched |
||
42 | * @param string $etag an etag from an http header. |
||
43 | * If lastModified matches the http header from the feed |
||
44 | * no results are fetched |
||
45 | * @param bool fullTextEnabled if true tells the fetcher to enhance the |
||
46 | * articles by fetching custom enhanced content |
||
47 | * @param string $basicAuthUser if given, basic auth is set for this feed |
||
48 | * @param string $basicAuthPassword if given, basic auth is set for this |
||
49 | * feed. Ignored if user is null or an empty string |
||
50 | * @throws FetcherException if simple pie fails |
||
51 | * @return array an array containing the new feed and its items, first |
||
52 | * element being the Feed and second element being an array of Items |
||
53 | */ |
||
54 | public function fetch($url, $getFavicon=true, $lastModified=null, |
||
67 | |||
68 | |||
69 | } |
||
70 |