Welcome Guest, Not a member yet? Register   Sign In
Make own objects
#17

[eluser]wiredesignz[/eluser]
CodeIgniter is not PHP5 compatible. It uses PHP4 style "class_exists()" function calls in other libraries which will initiate a call to your __autload function and cause you errors.

Alter your __autoload function to prevent CI from using it.
Code:
/** Library object class autoload **/
    function __autoload($class) {
        
        /* don't autoload CI_ or MY_ prefixed classes */
        if (strstr($class, 'CI_') OR strstr($class, 'MY_')) return;
            
        if(is_file($location = APPPATH.'libraries/objects/'.$class.EXT)) {
            include_once $location;
        }        
    }

You could also place this function into the MY_Controller class and then add the PHP5 spl autoload register function into global context:
Code:
spl_autoload_register('MY_Controller::__autoload');


Messages In This Thread
Make own objects - by El Forum - 06-11-2009, 02:03 PM
Make own objects - by El Forum - 06-11-2009, 02:06 PM
Make own objects - by El Forum - 06-11-2009, 02:08 PM
Make own objects - by El Forum - 06-11-2009, 02:11 PM
Make own objects - by El Forum - 06-11-2009, 02:13 PM
Make own objects - by El Forum - 06-11-2009, 02:33 PM
Make own objects - by El Forum - 06-11-2009, 02:35 PM
Make own objects - by El Forum - 06-13-2009, 02:49 PM
Make own objects - by El Forum - 06-13-2009, 02:58 PM
Make own objects - by El Forum - 06-13-2009, 03:06 PM
Make own objects - by El Forum - 06-13-2009, 03:11 PM
Make own objects - by El Forum - 06-13-2009, 03:18 PM
Make own objects - by El Forum - 06-13-2009, 03:39 PM
Make own objects - by El Forum - 06-13-2009, 05:00 PM
Make own objects - by El Forum - 06-13-2009, 05:26 PM
Make own objects - by El Forum - 06-13-2009, 05:51 PM
Make own objects - by El Forum - 06-13-2009, 11:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB