Welcome Guest, Not a member yet? Register   Sign In
Directory placement
#1

[eluser]HeartlandTech[/eluser]
I'm working on creating an application, I'm using the CodeIgniter structure, but instead of having an individual project for each application, I'm using the following structure:

---> CodeIgniter
---> Applications
---> AppName_DEV
---> AppName_PROD
---> AppName_TEST

The index.php file decides based on the URL what application base to use:

Code:
// Just add to this to determine the live URL's for the site.
    $live_domain_array = array("localhost","appnameprod");
    // Just add to this to determine the test URL's for the site.
    $testing_domain_array = array("appnamedev");
    
    switch(true)
    {
        // ***************************************************
        // **   D E V E L O P M E N T   S E R V E R         **
        // ***************************************************
        // First see if we're on on the live server
        case in_array(strtolower($_SERVER['HTTP_HOST']),$testing_domain_array):
            {
                $application_folder = "application/appname_dev";    
                $GLOBALS['server'] = 'test';
                break;    
            }
        // ***************************************************
        // **   T E S T   S E R V E R                       **
        // ***************************************************
        // First see if we're on on the live server        
        case in_array(strtolower($_SERVER['HTTP_HOST']),$testing_domain_array):
            {
                $application_folder = "application/appname_test";    
                $GLOBALS['server'] = 'test';
                break;    
            }
        // ***************************************************
        // **   P R O D U C T I O N   S E R V E R           **
        // ***************************************************
        // First see if we're on on the live server            
        default:
            {
                $application_folder = "application/appname_prod";    
                $GLOBALS['server'] = 'production';
            }
        
    }

What I'm looking for a way to do is to handle where the /images,/css,/js can live without interferring with the directory structure. Right now I have everything in the main codeigniter area, but any changes are reflected immediately in all three environments. (http://myappname/images/new_logo.jpg for example.) I want the referenced files to be under their respective application directory.

Any ideas?


Messages In This Thread
Directory placement - by El Forum - 01-16-2009, 02:55 PM
Directory placement - by El Forum - 01-16-2009, 04:45 PM
Directory placement - by El Forum - 01-16-2009, 06:20 PM
Directory placement - by El Forum - 01-16-2009, 08:00 PM
Directory placement - by El Forum - 01-16-2009, 09:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB