0

I was watching the following video on codeigniter tv website and wanted to work with my application in the various stages and wanted to set it up with the different configuration variables so it would be easier to manage.

http://codeigniter.tv/a-9/Dynamically-distinguish-between-development-staging-and-production-servers

The problem is I believe with my install of the codeigniter files and the location of my dev sever.

Here's my file structure. Anyone see a better way of doing this so I don't have to do multiple installs and what not for codeigniter from production and development.

/
/dev
/dev/site1
/dev/site1/application
/dev/site1/system
/dev/site1/index.php

/public_html
/public_html/application
/public_html/system
/public_html/index.php

1 Answer 1

2

As long as all of the relative files and paths stay the same from dev to production you should be good. So, the structure you propose would be just fine.

Sign up to request clarification or add additional context in comments.

4 Comments

Well, yes. I handle my sites through source control, and as long as I checkout the code to the root of the docroot - then all my relative paths stay the same from each environment -- I keep a DEV, STAGING, and PRODUCTION environment. My dev is my local machine, my staging is a subdomain on my production server, and my production is the actual website. Three different docroots, tied to their respective domains. As long as I don't use any absolute physical paths, everything works fine.
What is the difference between a staging and dev environment. After a few sites of information I'm not seeing a difference.
The staging environment is my test environment. I will develop features in different branches on my local machine. When one of those features is tested and complete, I will push it to my staging environment. There, I can test it on my production server with the production database, etc. Once I've tested it enough, then I'll push it to my production codebase.
I like that. Good answer. What I don't understand is with how they talk about the config variables in the database and config.php file. So basically I'd create the switch statement like they have in the video and just keep those files for all testing environments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.