Problems with: $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with: $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);

geester
Hi,

Total Newbie to this.

In my code below, I am getting the following error:

"A server error has occurred:

require(Zend_Uri_Http.php): failed to open stream: No such file or directory
in /Applications/MAMP/htdocs/ZendGdata/library/Zend/Uri.php
on line 126"

I downloaded and installed the latest build of the Zend Google library code. Any ideas what may be wrong? Any help would be greatly appreciated.

Thanks.



<?php

require_once('../NOLOH/NOLOH.php');
require_once('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');

class GCal extends WebPage {

    function GCal() {
        parent::WebPage();

        $user = 'xxxxxxxxx';
        $pass = 'xxxxx';
        $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
        $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
    }
}
?>
Reply | Threaded
Open this post in threaded view
|

Re: Problems with: $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);

Peter Warnock-2
You need to load Zend_Uri_Http, too.

On Fri, Mar 12, 2010 at 9:37 AM, geester <[hidden email]> wrote:

Hi,

Total Newbie to this.

In my code below, I am getting the following error:

"A server error has occurred:

require(Zend_Uri_Http.php): failed to open stream: No such file or directory
in /Applications/MAMP/htdocs/ZendGdata/library/Zend/Uri.php
on line 126"

I downloaded and installed the latest build of the Zend Google library code.
Any ideas what may be wrong? Any help would be greatly appreciated.

Thanks.



<?php

require_once('../NOLOH/NOLOH.php');
require_once('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');

class GCal extends WebPage {

   function GCal() {
       parent::WebPage();

       $user = 'xxxxxxxxx';
       $pass = 'xxxxx';
       $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined
service name for calendar
       $client =
Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
   }
}
?>
--
View this message in context: http://n4.nabble.com/Problems-with-client-Zend-Gdata-ClientLogin-getHttpClient-user-pass-service-tp1590852p1590852.html
Sent from the Zend gdata mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Problems with: $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);

geester
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 '

' . $calFeed->title->text . '

';
echo '<ul>';
foreach ($calFeed as $calendar) {
   echo '<li>' . $calendar->title->text . '</li>';
}

echo '</ul>';

?>