【问题标题】:What's causing "Call to ... getCalendarListFeed() on a non-object" error?是什么导致“在非对象上调用 ... getCalendarListFeed()”错误?
【发布时间】:2011-01-25 00:50:19
【问题描述】:

我有以下代码:

<?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();

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

是什么导致了这个错误?

【问题讨论】:

    标签: php google-api google-calendar-api gdata


    【解决方案1】:

    我知道这有点过时了,但试一试!

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

    【讨论】:

      猜你喜欢
      • 2013-03-08
      • 1970-01-01
      • 2016-12-07
      • 2016-01-04
      • 2013-09-16
      • 2013-11-25
      • 2012-05-30
      • 2016-08-30
      • 2015-02-06
      相关资源
      最近更新 更多