2011-01-25 128 views
1

我有以下代碼:什麼原因導致「對非對象調用... getCalendarListFeed()」錯誤?

<?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 = '[email protected]'; 
$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(); 

此代碼返回Call to a member function getCalendarListFeed() on a non-object in MyCal.php on line 13

什麼是造成此錯誤?

回答

0

我知道這是有點過時了,但給這個鏡頭!

$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; 
$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, $service); 
$service = new Zend_Gdata_Calendar($client); 
相關問題