0

I'm trying to use a bit of code to cloud print with Google:

    $client = Zend_Gdata_ClientLogin::getHttpClient('username', 'password', 'cloudprint');
        $Client_Login_Token = $client->getClientLoginToken(); 
        $client->setHeaders('Authorization','GoogleLogin auth='.$Client_Login_Token); 
        $client->setHeaders('X-CloudPrint-Proxy','Mimeo');

        $title = 'test';
        $fileUrl = 'url';
        $Printer_ID = 'ad83528c-a114-3f68-4768-c132ecc32ea2';


        $client->setUri('http://www.google.com/cloudprint/interface/submit');
        $client->setParameterPost('title', $title);
        $client->setParameterPost('content', $fileUrl );       
        $client->setParameterPost('contentType', 'url' ); 
        $client->setParameterPost('printerid', $Printer_ID); 
        $client->setParameterPost('capabilities', '{}' );
        $client->setConfig(array( 'timeout' => 180 ));          
        $response = $client->request(Zend_Http_Client::POST); 
        $response = json_decode($response->getBody());
        var_dump($response);

I'm getting this error:

Fatal error: Class 'Zend_Gdata_ClientLogin'

I'm using GoDaddy shared hosting. Is there just a file I can include_once that will contain this. I've downloaded the Zend framework but can't find the class?

James MV
  • 8,569
  • 17
  • 65
  • 96
  • Are you bootstraping whole zend application or you just trying use this part of Zend Framework? Did you download latest version of Zend Framework 1? – s7anley Jan 28 '14 at 21:44
  • I just need it for this one part. I downloaded Zend 2. Is that why I can't find it?! – James MV Jan 28 '14 at 21:44
  • 1
    Yes, its in [Zend Framework 1](https://github.com/zendframework/zf1/tree/master/library/Zend/Gdata). Check [documentation](http://framework.zend.com/manual/1.12/en/zend.gdata.introduction.html). – s7anley Jan 28 '14 at 21:45
  • Can I just include the folder Gdata for this or do I need to upload the entire framework? – James MV Jan 28 '14 at 21:48
  • You can include only what you need. – s7anley Jan 28 '14 at 21:49

1 Answers1

1

Dowload the Zend Framework, put it into a directory on your server, add this directory to your include path.

Example

<?php
 $path = '/usr/lib/zend';
 set_include_path(get_include_path() . PATH_SEPARATOR . $path);
 ?>
hpelleti
  • 342
  • 1
  • 6
  • 1
    Look like you are using version 1.x. There is several dependencies with Zend. You may need to use serveral packages – hpelleti Jan 28 '14 at 21:49