Posts: 21
Threads: 8
Joined: Sep 2020
Reputation:
0
I'm just wondering if its possible to move Config directory into the root from App folder. Because i'm planning to release updates for my ci app and when users replace app directory they have re-correct their specific config values for example baseURL.
I think Config directory by default should be in the root directory. what you guys think?
Posts: 1,404
Threads: 3
Joined: Aug 2017
Reputation:
39
Instruct your clients to use the .env file, it does what you want.
Posts: 21
Threads: 8
Joined: Sep 2020
Reputation:
0
But the problem is config options like supportedLocales, appTimezone are not available in the .env file. but only available in the App.php config file. but those kind of config options are more likey get changed my the clients.
Is there any possibility that I can move config dir into app root from app dir?
Posts: 139
Threads: 4
Joined: Jul 2020
Reputation:
2
As long as the Config file is extending BaseConfig, you can practically leave that Config file unchanged and have all your local changes to the .env file. If there are missing settings in the .env file, you can add that. Although undocumented, please note that the .env file does not support setting up array values. Strings, numbers, booleans, and null are only allowed values in the .env file. So if you need to set up array values, you need to set those up in the Config file itself.
Posts: 490
Threads: 44
Joined: Oct 2014
Reputation:
2
@T.O.M.
Many thanks for the link, it is the first time I have read that .env values take priority over app/Config.php, etc. and I have been using CodeIgniter4 since the Alpha version!
Perhaps adding a mention in the manual every time .env is mentioned?
Unfortunately the .env file is limited to values being hard-coded strings and my defined constants, and variables, etc cannot be used.
Also I update from localhost to my server using RSYNC and need to have a different .env file online.