Welcome Guest, Not a member yet? Register   Sign In
Using Sturgeon's native __autoload code, tons of errors on log file
#2

[eluser]InsiteFX[/eluser]
Thats because your using his old code! Here is the new code...
Code:
/*
| -------------------------------------------------------------------
|  Native Autoload - by Phil Sturgeon. New Version!
| -------------------------------------------------------------------
|
| Nothing to do with config/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
| If using HMVC you do not need this! HMVC will autoload.
|
| Place this code at the bottom of your application/config/config.php file.
*/
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        if (file_exists($file = APPPATH . 'core/' . $class . EXT))
        {
            include $file;
        }

        elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT))
        {
            include $file;
        }
    }
}
Also only CodeIgniter Core files go into the Core your MY_Tasks should be in libraries!

InsiteFX


Messages In This Thread
Using Sturgeon's native __autoload code, tons of errors on log file - by El Forum - 06-08-2011, 11:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB