1<?php 2require_once('ZoteroFeedReader.php'); 3 4class WebZoteroFeedReader implements ZoteroFeedReader 5{ 6 /** 7 * @var ZoteroConfig 8 */ 9 private $config; 10 11 public function __construct(ZoteroConfig $config) 12 { 13 $this->config = $config; 14 } 15 16 function getFeed() 17 { 18 if (!function_exists('curl_init')) 19 { 20 throw new Exception("CURL functions are not available."); 21 } 22 $ch = curl_init(); 23 curl_setopt($ch, CURLOPT_URL, $this->config->getUrlForEntries()); 24 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 25 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 26 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 27 $feed = curl_exec($ch); 28 curl_close($ch); 29 return $feed; 30 } 31} 32?>