Welcome Guest, Not a member yet? Register   Sign In
Application for Dev and Productuion Environments
#1

[eluser]xtremer360[/eluser]
I think I have this almost figured out. I'm going to be using GIT and my live file structure and I'm trying to figure out how I should be doing this. My question is I'll be having a branch for the development(dev) and one for the production site(public_html). Should they be having a same index.php file because of how the index.php file is for CI there's if statements that handle what environment you are currently in. I was curious because of the if statements that can be performed based on the environment. Is this a proper set up or should I be doing something different. I will also being using GIT with branches for dev and production.

I was told this before:

Quote:Yes, you can have one index.php file and let it decide how to set the constant for each environment. More important is your database.php file.

My current idea for setup:
Code:
/root
    /application
    /dev
        /site1
            /assets
            index.php
    /public_html
        /assets
        index.php
    /system

#2

[eluser]TheFuzzy0ne[/eluser]
Whatever you find easiest. I have 4 different environments set up within my index.php file. However, if you're hosting this on GIT, it might make more sense to leave the current index.php file intact, and to use a different Web root, and a new index.php. This means you can make any changes you need to make it fit into your environment, and it won't affect the index.php hosted on GIT. You can also have your own config directory for your specific environment, and git ignore it, so no-one else will ever see your database details or personal configuration.




Theme © iAndrew 2016 - Forum software by © MyBB