![]() |
Upgrade to 2.0.1 - config/autoload.php not loading - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Upgrade to 2.0.1 - config/autoload.php not loading (/showthread.php?tid=39625) Pages:
1
2
|
Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Webnet[/eluser] I just upgraded from 1.7 to 2.0.1 following the upgrade guide. I'm getting an error that indicates my autoload classes aren't being loaded before the page's controller, so I added Code: echo "test"; to the config/autoload.php and it's still loading the controller before these configurations. I'm not sure where I should begin testing as to what could be the problem, any suggestions? Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Phil Sturgeon[/eluser] The user guide there covers most things, but I feel that my instructions might be a little more in depth. They also have some invaluable comments on them so it could help you out: http://philsturgeon.co.uk/news/2010/05/upgrading-to-codeigniter-2.0 Can you post us up your autoload? Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Webnet[/eluser] I looked over your guide, It covered the same things I did. We don't use plugins, ecryption, or validation provided by CI so there wasn't as much to be concerned with. Here's the start of my autoload Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Phil Sturgeon[/eluser] That seems overly complicated and inaccurate. You cannot load MY_controller as a library because it is not a library, even if some tutorials (such as mine here http://philsturgeon.co.uk/blog/2010/02/CodeIgniter-Base-Classes-Keeping-it-DRY suggest you put it in that folder. Follow my tutorial and it should work fine for you. Especially moving it to the application/core folder. Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Webnet[/eluser] Phil, I might just be misunderstanding, but I don't quite see how the tutorial helps. I should point out that I'm completely new to CodeIgniter, I've been put into a project at work that uses it having never used it before. I'm trying to get started on the right foot - starting with upgrading our version of CI. -- The more I look at it, this seems like a hackish way of accomplishing this. Is there no better method that's supported by CI? Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Phil Sturgeon[/eluser] Take MY_Controller out of autoload, that wont work. What content are you trying to autoload that is not working? Explain what the problem is and I can give more accurate advice. Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Webnet[/eluser] Disclaimer: I didn't set this up!!! MY_controller.php is: Code: <?php abstract_controller.php is our actual base controller that's used everywhere. I'm not entirely sure the best way to change this setup. Code: class AbstractController extends CI_Controller Where should I put MY_controller.php? How should it be included so that I have access to it? Is there a better way than the catch all __autoload() ? Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Phil Sturgeon[/eluser] Yeah that won't work. Just put AbstractController in as class MY_Controller extends CI_Controller, put it in the application/core folder and extend MY_Controller. Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Webnet[/eluser] I updated my last post just before you responded. Now, I'm just now upgrading to 2.0, we haven't had a core folder until now. Where should I put the __autoload ? I can't think of a good place that would be outside of CodeIgniter. Upgrade to 2.0.1 - config/autoload.php not loading - El Forum - 03-16-2011 [eluser]Phil Sturgeon[/eluser] That is why I suggested you read my article. __autoload() goes at the bottom of config.php. |