简体   繁体   English

从zend框架开始的问题

[英]problem starting with zend framework

I downloaded the zend framework 1.10 full. 我下载了完整的zend Framework 1.10。 Unzipped, rename this folder to zf. 解压缩后,将此文件夹重命名为zf。 I am going to use zend framework as independent, will only call loader and include libraries when needed. 我将使用zend框架作为独立框架,仅在需要时调用加载程序并包括库。

I put the unzipped zend framework into http://localhost/r/zf 我将解压缩的zend框架放入http:// localhost / r / zf

Then from r/test2.php I put these code to do test call, but it fail. 然后从r / test2.php我把这些代码进行测试调用,但是失败了。

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";

?>

By default, ZF wants the the Zend (ie: library/Zend) in some directory in your include_path. 默认情况下,ZF希望在include_path中的某个目录中使用Zend(即library / Zend)。

Lots of ZF code does things like: ZF代码很多,例如:

require_once 'Zend/Db/Table/Row/Exception.php';

You can simply set the include_path, without moving any files around. 您只需设置include_path,而无需移动任何文件。 Some place before you load any ZF files: 加载任何ZF文件之前的某个位置:

<?PHP
$path = '/path/to/your/webroot/r/zf/library';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

You could also copy/move/symlink the Zend directory (the one inside library/) to some place that is already in your include_path. 您还可以将Zend目录(位于library /中的那个目录)复制/移动/符号链接到include_path中已经存在的某个位置。 Where that is depends on your platform and setup. 那取决于您的平台和设置。 Use get_include_path or phpinfo() to figure out where. 使用get_include_path或phpinfo()找出位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM