0

我正在尝试使用一些代码与 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);

我收到此错误:

Fatal error: Class 'Zend_Gdata_ClientLogin'

我正在使用 GoDaddy 共享主机。是否只有一个我可以 include_once 包含此文件的文件。我已经下载了 Zend 框架但找不到类?

4

1 回答 1

1

下载 Zend 框架,将其放入服务器上的目录中,将此目录添加到包含路径中。

例子

<?php
 $path = '/usr/lib/zend';
 set_include_path(get_include_path() . PATH_SEPARATOR . $path);
 ?>
于 2014-01-28T21:41:39.610 回答