开发者

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

开发者 https://www.devze.com 2023-02-06 06:54 出处:网络
I have the following code: <?php require_once(\'Zend/Loader.php\'); $classes = array(\'Zend_Gdata\',\'Zend_Gdata_Query\',\'Zend_Gdata_ClientLogin\',\'Zend_Gdata_Calendar\');

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

精彩评论

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