从 zend 框架开始的问题
我下载了 zend Framework 1.10 full。解压后,将该文件夹重命名为zf。 我将使用 zend 框架作为独立框架,仅在需要时调用加载器并包含库。
我将解压的 zend 框架放入 http://localhost/r/zf
然后从 r/test2.php 我把这些代码进行测试调用,但失败了。
我错过了什么吗?
<?php
define( 'ROOT_DIR', dirname(__FILE__) );
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('log_errors',FALSE);
ini_set('html_errors',FALSE);
ini_set('error_log', ROOT_DIR.'/admin/logfile/error_log.txt');
ini_set('display_errors',FALSE);
require_once 'zf/library/Zend/Loader.php'; //successfully go through
echo "aaa";
//It will fail as long as i enable Zend loader lines at below....
//Zend_Loader::loadClass('Zend_Gdata');
//Zend_Loader::loadClass('Zend_Gdata_AuthSub');
//Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
//Zend_Loader::loadClass('Zend_Gdata_Calendar');
echo "bbb";
?>
I downloaded the zend framework 1.10 full. Unzipped, rename this folder to zf.
I am going to use zend framework as independent, will only call loader and include libraries when needed.
I put the unzipped zend framework into http://localhost/r/zf
Then from r/test2.php I put these code to do test call, but it fail.
Anything I miss out?
<?php
define( 'ROOT_DIR', dirname(__FILE__) );
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('log_errors',FALSE);
ini_set('html_errors',FALSE);
ini_set('error_log', ROOT_DIR.'/admin/logfile/error_log.txt');
ini_set('display_errors',FALSE);
require_once 'zf/library/Zend/Loader.php'; //successfully go through
echo "aaa";
//It will fail as long as i enable Zend loader lines at below....
//Zend_Loader::loadClass('Zend_Gdata');
//Zend_Loader::loadClass('Zend_Gdata_AuthSub');
//Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
//Zend_Loader::loadClass('Zend_Gdata_Calendar');
echo "bbb";
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,ZF 希望 Zend(即:library/Zend)位于 include_path 中的某个目录中。
许多 ZF 代码执行以下操作:
您可以简单地设置 include_path,而无需移动任何文件。在加载任何 ZF 文件之前的某个位置:
您还可以将 Zend 目录(library/ 内的目录)复制/移动/符号链接到 include_path 中已有的某个位置。具体位置取决于您的平台和设置。使用 get_include_path 或 phpinfo() 找出位置。
By default, ZF wants the the Zend (ie: library/Zend) in some directory in your include_path.
Lots of ZF code does things like:
You can simply set the include_path, without moving any files around. Some place before you load any ZF files:
You could also copy/move/symlink the Zend directory (the one inside library/) to some place that is already in your include_path. Where that is depends on your platform and setup. Use get_include_path or phpinfo() to figure out where.