This article explains how to use Zend in Codeigniter.http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/
I am using XAMPP and having difficulties with path.
Q1. I am not sure what is going on here. Why do I need to set this one?
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'libraries');
Q2. After some tweak, I changed the above code to the following.
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . BASEPATH . 'libraries');
The output of above line is
.;C:\xampp\php\pear\;application\libraries
However I get an error such as
Message: require_once(Zend/Validate/Between.php) [function.require-once]: failed to open stream: No such file or directory
Filename: Service/Flickr.php
and
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Validate/Between.php' (include_path='.;C:\xampp\php\pear\;C:\xampp\htdocs\ci_day6_working_copy\system\libraries') in C:\xampp\htdocs\ci_day6_working_copy\application\libraries\Zend\Service\Flickr.php on line 476
Original code:
<?php if (!defined('BASEPATH')) {exit('No direct script access allowed');}
/**
* Zend Framework Loader
*
* Put the 'Zend' folder (unpacked from the Zend Framework package, under 'Library')
* in CI installation's 'application/libraries' folder
* You can put it elsewhere but remember to alter the script accordingly
*
* Usage:
* 1) $this->load->library('zend', 'Zend/Package/Name');
* or
* 2) $this->load->library('zend');
* then $this->zend->load('Zend/Package/Name');
*
* * the second usage is useful for autoloading the Zend Framework library
* * Zend/Package/Name does not need the '.php' at the end
*/
class CI_Zend
{
/**
* Constructor
*
* @param string $class class name
*/
function __construct($class = NULL)
{
// include path for Zend Framework
// alter it accordingly if you have put the 'Zend' folder elsewhere
ini_set('include_path',
ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'libraries');
if ($class)
{
require_once (string) $class . EXT;
log_message('debug', "Zend Class $class Loaded");
}
else
{
log_message('debug', "Zend Class Initialized");
}
}
/**
* Zend Class Loader
*
* @param string $class class name
*/
function load($class)
{
require_once (string) $class . EXT;
log_message('debug', "Zend Class $class Loaded");
}
}
?>