Welcome Guest, Not a member yet? Register   Sign In
Default application path doesn't work
#1

[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.


Messages In This Thread
Default application path doesn't work - by El Forum - 07-11-2011, 09:13 PM
Default application path doesn't work - by El Forum - 07-11-2011, 09:20 PM
Default application path doesn't work - by El Forum - 07-12-2011, 04:37 AM
Default application path doesn't work - by El Forum - 07-12-2011, 07:20 AM
Default application path doesn't work - by El Forum - 07-12-2011, 09:41 PM
Default application path doesn't work - by El Forum - 07-13-2011, 07:24 AM
Default application path doesn't work - by El Forum - 07-13-2011, 07:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB