CodeIgniter Forums

Full Version: Extended Controller not working on App Engine
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my CI 2.2 setup, I have MY_Controller extending CI_Controller, then Admin_Controller extend MY_Controller.

On LAMP/WAMP, this worked perfectly, using the following code in config.php to load the files

Code:
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;
        }
    }
}

I have recently moved to using Googles App Engine and now I am having issues with getting the Admin_Controller to work. MY_Controller seems to load fine, no issues.

I even tried renaming the admin controller to MY_Admin_Controller, but that didn't help.

Any ideas?

EDIT - right, so I tried adding "include_once( APPPATH . 'core/Admin_Controller.php' );" to the autoload function. No luck. I then added it to the top of the admin index.php script, and it works. So, why isn't it being autoloaded?
Try putting your Admin_Controller class inside your MY_Controller class and see if it will work, that's how I do it.
So literally:

Code:
<?php
class MY_Controller extends CI_Controller
{
    public function __construct() {
        parent::__construct();
    }
}

class Admin_Controller extends MY_Controller
{
    public function __construct() {
        parent::__construct();
    }
}

?