Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] config file outside application folder - possible?
#1

[eluser]takasia[/eluser]
maybe someone have some experience - what I need is:

one application folder for all (or some) apps -> I know I can set it up in index.php BUT I nedd also:
separate config.php and database.php (or the config folder) for every app

Is this possible? If yes - how?
Can I make my CI ignore the default config folder and make it read from a custom /app/config/config.php?

I have a separate system folders for versioning of the CI, and the index.php and css soterd in /public_html/app/

There would be a lots of apps (about 100) and the best for me would be if I could have the same controllers models and views files for all of them, but I need to change DB settings and URL settings for every app.

I don't want to have modules, and I'm not happy with symbolic links although they work fine - I just want some more CI-like solution :-)

BTW - the CI is 2.0, php5.
#2

[eluser]takasia[/eluser]
Anwering myself:

Put this in your application/config/config.php -> the default one:

require_once CONFIGPATH.‘config’.EXT;

(the same goes to the rest of the config files)

In the index.php:

$this_app_config_folder = “the_path”;

// after defining the BASEPATH
define(‘CONFIGPATH’, str_replace(”\\”, “/”, $this_app_config_folder));

Here is a post that helped me a lot (THANK YOU!):

http://ellislab.com/forums/viewthread/86563/

If anyone have another, more safe way to do this - share please :-)




Theme © iAndrew 2016 - Forum software by © MyBB