Welcome Guest, Not a member yet? Register   Sign In
Class 'CI_Controller' not found after upgrading CI 2.0.x -> latest - in MY_Router.php
#1

[eluser]Out of Control[/eluser]
I have this in MY_Router.php:
Code:
/* Check for static pages */
        require_once( BASEPATH . "database/DB.php" );
        $DB = &DB;();
        $query = $DB->query( 'SELECT statp_url FROM hn_static_page' );

I believe CI doesn't load CI_Controller until after MY_Router.php, however this did work in CI 2.0.x. I've just upgraded to the latest version of CI, and I upgraded HMVC and now I get the "Class 'CI_Controller' not found" error.

I'm sure this is a fairly simple solution, but I simply can't get my brain around it. Any suggestions to help point me in the right direction?

Thank you.
#2

[eluser]InsiteFX[/eluser]
Try removing the &, also you have a semicolon after $DB
Code:
$DB = DB();
#3

[eluser]Out of Control[/eluser]
I actually had &DB;();

Not sure where the extra semicolon came from in my post. Regardless, removing & made no difference. Same error as the router gets run before CI_Controller is loaded in CodeIgniter.php. The only idea I can come up with is that I had hacked the core before I upgraded.

Note to self: Less Guiness and more sleep Smile




Theme © iAndrew 2016 - Forum software by © MyBB