Configure CodeIgniter to run on two servers |
[eluser]TWP Marketing[/eluser]
re: "This solution allows no changes to be made to the code after it’s been initially configured." I'm not sure what this means. Which solution does not allow code changes after initial install? Please clarify what you mean here.
[eluser]Ch!ps[/eluser]
Interesting...no one seems to worry about error_reporting...we don't want to display errors on live site...and to make application portable, we should address it as well... i think the environment constant should be set-up in the index.php file and error reporting adjusted accordingly...eg. Code: define('ENV', strpos($_SERVER['SERVER_NAME'], 'local') !== FALSE ? 'local' : 'live'); The ENV constant can be used elsewhere in the system as it will be available throughout...though... putting this clause in index.php is not exactly ideal but i don't think there is a better alternative... what do you think...would love to hear your thoughts...
[eluser]neillyons.co[/eluser]
Good idea Ch!ps, I have found that CodeIgniter has the perfect place to define constants. Have a look at this comment. http://ellislab.com/forums/viewthread/119072/#603470
[eluser]Ch!ps[/eluser]
@ neil i did read your write-up on the constants.php file and i normally define constants in that file only...the problem is error_reporting() is called in the index.php and re-calling error_reporting() function later (either in constants file or in config file) doesn't really work, at least not when i tried...it still retains the settings from the index.php file...eg....i would set-up a config item 'environment' in config.php and try to re-call error_reporting() again based on 'environment' config-item (E_ALL or 0) but the default settings from index.php would persist... one can keep separate index.php files for dev and live sites but i just don't like the idea of maintaining two separate files...more often than not, i would forget to make the change or overwrite the file...not good ;-) also, i think making changes/additions to the index.php file is fair game as it resides outside the 'system' folder...if one wants to take out the 'application' folder from the 'system' folder or rename application and/or system folder, you have to make changes to the index.php anyway...guess i am fine as long as the system folder is not hacked btw...nice write-up about db-driven routes on your blog :-) |
Welcome Guest, Not a member yet? Register Sign In |