CodeIgniter Forums

Full Version: Local configuration for different app
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On the root of my server i have the application and system folders, then i set up N folders for each app, for eg. app_1, app_2, app_3, etc.



-> global_application_folder
-> global_system_folder

-> app_1_folder
    - index.php
    - local_config_file.php
    - local_database_file.php

-> app_2_folder
    - index.php
    - local_config_file.php
    - local_database_file.php

-> app_3_folder
    - index.php
    - local_config_file.php
    - local_database_file.php

Everything works, but the configurations are the same, the database is the same…
For the rest the apps are the same throughout for all.

Now i have to change some configurations locally, we take as an example "app_1".
Visiting the app_1, for example, i have to load the different configurations for this app, such as the name of the cookie, the language, database, etc.

On the internet i found this:, but it does not work, perhaps because it dated or perhaps for some code error, and by the way does not seem nice to take one foreach cycle to every request, for eg. for the data of the database…

The solution i found at the moment is to include, at the end of the file, my "local_config_file.php" inside "global_application_folder/config/config.php" in this way :
include_once(FCPATH . 'config.local.php');

FCPATH is responsible for loading the correct one from the app folder visited properly

Could you tell me a more elegant, clean and functioning way?