开发者

What's causing "Call to ... getCalendarListFeed() on a non-object" error?

I have the following code:

<?php
require_once('Zend/Loader.php');
$classes = array('Zend_Gdata','Zend_Gdata_Query','Zend_Gdata_ClientLogin','Zend_Gdata_Calendar');
foreach($classes as $class) {
    Zend_Loader::loadClass($class);
}
$user = 'me@gmail.com';
$pass = 'MyPassword';
$service = Zend_Gdata_Calendar::AUTH开发者_如何学编程_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
$service = $Zend_Gdata_Calendar[$client];

$listFeed = $service->getCalendarListFeed();

This code returns Call to a member function getCalendarListFeed() on a non-object in MyCal.php on line 13.

What is causing this error?


I know this is a little out-dated, but give this a shot!

$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$client  = Zend_Gdata_ClientLogin::getHttpClient($email, $password, $service); 
$service = new Zend_Gdata_Calendar($client);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜