Part of the EllisLab Network
   
 
using eZ Components with codeigniter
Posted: 22 February 2007 03:22 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  12-20-2006

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

 Signature 

“The world we have created is a product of our thinking; it cannot be changed without changing our thinking.” — Albert Einstein
blog.hafezadnan.com

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 66432 Total Logged-in Users: 31
Total Topics: 84799 Total Anonymous Users: 2
Total Replies: 455096 Total Guests: 239
Total Posts: 539895    
Members ( View Memberlist )
Newest Members:  GlennJHurlyBurlyDylan1978X_franbaguasllogocsaturkeyPeter BryanttherendStudioGeorgiaJ