2010年3月13日星期六

[fw-gdata] Re: Problems with: $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);

Hi there,

Thanks for your reply.

>You need to load Zend_Uri_Http, too.

Kindly refer to the code below. I managed to get this running after my
original post to the list and as you can see, I didn't specifically load
Zend_Uri_Http. The code below is pretty much lifted straight from the
documentation and it didn't specifically suggest the need to load
Zend_Uri_Http, otherwise, I would have done this.

The problem seems to arise when I run the code in the context of my
preferred framework and so after getting the Zend code to run as shown
below, I did escalate the problem to my framework vendor to see whether they
could see a reason as to why the code failed in its initial form.

However, I will certainly try your suggestion in the context of my framework
and see whether it helps in any way.

Again, thanks for your help.

<?php

require_once('../ZendGdata/library/Zend/Loader.php');

Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');

$user = '*******';
$pass = '*******';
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass, $service);

$gdataCal = new Zend_Gdata_Calendar($client);
$calFeed = $gdataCal->getCalendarListFeed();
echo '<h1>' . $calFeed->title->text . '</h1>';
echo '<ul>';
foreach ($calFeed as $calendar) {
echo '<li>' . $calendar->title->text . '</li>';
}

echo '</ul>';

?>
--
View this message in context: http://n4.nabble.com/Problems-with-client-Zend-Gdata-ClientLogin-getHttpClient-user-pass-service-tp1590852p1591613.html
Sent from the Zend gdata mailing list archive at Nabble.com.

没有评论: