views:

15

answers:

1

Hi guys,

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

?>
A: 

By default, ZF wants the the Zend (ie: library/Zend) in some directory in your include_path.

Lots of ZF code does things like:

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

You can simply set the include_path, without moving any files around. Some place before you load any ZF files:

<?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. Where that is depends on your platform and setup. Use get_include_path or phpinfo() to figure out where.

timdev