HI,
I need to use eZ Components with my CI application, how can I include the eZ Components directory with CI?
I create new helper called (ezc_helper) which include the base class that auto load any class for the eZ Components
//the helper
require_once '/var/www/my_ci_dir/system/application/ezcomponent/Base/src/base.php';
function __autoload($className)
{
ezcBase::autoload($className);
}
//test model
function __construct(){
parent::Model();
$this->load->helper('ezc');
$this->load->library('Images_converter','/var/www/test/ez_images/boathouse.jpg');
}
//here the 'Images_converter' library which used the ez component class
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Images_converter{
private $CI;
private $image;
function __construct($file_path){
//create codeigniter instance
$this->CI = get_instance();
//create ez image analyzer instance
$this->image = new ezcImageAnalyzer( $file_path );
}
}
but when I load the helper and use any ez component class following error happened, and note the bold class name , it send the CI class name to the ez component autoload function
Fatal error: Uncaught exception ‘ezcBaseAutoloadException’ with message ‘Could not find a class to file mapping for ‘CI_Images_converter’. Searched for c_i_autoload.php and c_autoload.php in: /var/www/sharekna/vpsharing/system/application/ezcomponent/autoload’ in /var/www/sharekna/vpsharing/system/application/ezcomponent/Base/src/base.php:157 Stack trace: #0 /var/www/sharekna/vpsharing/system/helpers/ezc_helper.php(25): ezcBase::autoload(‘CI_Images_conve…’) #1 [internal function]: __autoload(‘CI_Images_conve…’) #2 /var/www/sharekna/vpsharing/system/libraries/Loader.php(758): class_exists(‘CI_Images_conve…’) #3 /var/www/sharekna/vpsharing/system/libraries/Loader.php(721): CI_Loader->_ci_init_class(‘Images_converte…’, ‘’, ‘/var/www/test/e…’) #4 /var/www/sharekna/vpsharing/system/libraries/Loader.php(90): CI_Loader->_ci_load_class(‘Images_converte…’, ‘/var/www/test/e…’) #5 /var/www/sharekna/vpsharing/system/application/models/test_model.php(13): CI_Loader->library(‘Images_converte…’, ‘/var/www/test/e…’) #6 in
Thanks for Help, :)
hafez
