[eluser]tarsusc81[/eluser]
I just did an upgrade from 1.7 to 2, and my controller is not loading. Here's why:
1. The v.2 installation now has the application and system directories side by side in the web root. So I used that structure; I moved all my custom or modified files from /system/application to /application.
2. The new index.php defines an application folder with a relative string by default:
Code:
$application_folder = 'application';
3. APPPATH is defined with this conditional:
Code:
if (is_dir($application_folder))
{
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
The first block executes, because from this context (in the webroot), the relative path does exist, so I end up with an APPPATH of "application/"
Again, this is all default.
4. But in /system/core/Codeigniter.php, this include of the default controller file fails:
Code:
include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT);
Because now in this context (within /system/core/) the relative path that it's looking for does NOT exist: "application/controllers/welcome.php"
It would if the application directory were still in /system, but that's not the default file structure in v.2.
So, granted, I know how to fix this. But I want to know what I'm missing: I can't figure out how this would ever work with a default install.