10930 Posts in 2613 Topics by 1810 members
|Go to End|
10 June 2010 at 2:37am
I would like to fetch an iCal-calendar from external websites (Google, etc.) with the event_calendar_module. To do this I have to use proxy for url-requests from the SS. The iCal.php usesand not the SimplePie-Framework to do this, right?
$ical = file_get_contents($file);
So I've replaced file_get_content($file) with a call of a function with curl_opts:
$c = curl_init($URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($c, CURLOPT_PROXY, "proxy.webserver.com");
curl_setopt($c, CURLOPT_PORT, 3128);
curl_setopt($c, CURLOPT_PROXYUSERPWD, "user:password");
$contents = curl_exec($c);
if ($contents) return $contents;
else return FALSE;
Unfortunately I don't have PHP-knowledges so I didn't have success at all: Call to undefined function curl_get_file_contents()
What's the error in reasoning?
30 July 2010 at 1:48am Last edited: 30 July 2010 6:37pm
Ok. So I push this forward because I need some PHP-based knowledge to solve this.
Simple question to the event_calendar module or anything other in PHP:
file_get_contents() doesn't work for me, because my webhoster limits outgoing traffic through proxy. So I have to use curl instead and I tried to replace the file_get_contents with the name of a new function and put the function in the iCal.php. But this causes an error "Fatal error: Call to undefined function curl_get_file_contents() in.../htdocs/event_calendar/code/iCal.php on line 27".
The curl_get_file_contents-function is working in an example script, but not in iCal.php. So I shifted this function in Calender.php without any better result.
What's wrong with my idea?
27 May 2011 at 11:17pm
Late reply - you need PHP extension called PHP Curl installed and enabled
I simple install like this:
sudo port install php5-curl
|Go to Top|