Welcome Guest, Not a member yet? Register   Sign In
Retrieving configs from a file other than config.php
#11

[eluser]merik[/eluser]
[quote author="Jan from Hamburg" date="1364288056"]Why not just feed the .gitignore-file like
Code:
*/application/config/database.php
*/config/development
*/logs/log-*.php
*/logs/!index.html
*/cache/*
*/cache/!index.html
and let an example-file in the folder like database_example.php or config_example.php with all needed info..[/quote]

This is what I ended up doing. This works for the DB stuff, but not for the site config stuff. Each of us is using different configs for their own local instance ( for example, they host it locally as mydomain.com or mydomain.net, and modify their hosts file so that URL will refer to 127.0.0.1), so the configs like the site's base name, etc are not identical.

In the end, I wish there was a way to load configs from an external file, say from within index.php; but there is none. Sad

Thanks anyways. These are all very good comments and suggestions.
#12

[eluser]TheFuzzy0ne[/eluser]
I'm confused... Anything that goes in ./application/config can be overridden on a per environment basis. Not just database configuration files.
#13

[eluser]Aken[/eluser]
[quote author="TheFuzzy0ne" date="1364327373"]I'm confused... Anything that goes in ./application/config can be overridden on a per environment basis. Not just database configuration files.[/quote]

This. You should use code in your index.php file to determine what environment you are in (based on an IP, host name, web address, etc.). You can use the .htaccess to do the same. Then, each person would have their own environment name and separate config directory.




Theme © iAndrew 2016 - Forum software by © MyBB