在CakePHP中包含Zend API路径不起作用

时间:2014-04-09 06:46:32

标签: php cakephp zend-framework

这是代码适用于localhost,但不能在服务器上运行。

在服务器上,代码无法获取Zend/Loader.php

在CakePHP中,我将Zend框架放在app/vendors中,目录名为Zend

$clientLibraryPath = '../Vendor/Zend/library';
$oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath);

require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');

$serviceName = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $serviceName);
$service = new Zend_Gdata_Calendar($client);

0 个答案:

没有答案