DotEnv file is better loaded from the index.php |
CodeIgniter is by far the most ideal framework that is truly versatile. In some instances, especially for cloud based applications, where many instances will run the same "app" code but with different index.php files and .env files. That flexibility should be retained.
The current location in the Boot.php file is not so cool, as it will bring sudden limitation to CI4. Thanks
I don't know your directory structure. Where do you put .env files?
In any case, you can extend or replace Boot.php, and use it in your index.php. So there is no limitations. (06-06-2024, 01:54 AM)kenjis Wrote: I don't know your directory structure. Where do you put .env files?I keep them in a folder called "app_settings/client_name/". so several clients have their env file, but they run exactly the same code base(app, system). My concern over modifying the Boot.php is for updates, I wouldn't want to do any modification in the system directory. Best place to do that is the index.php file, because it's what stays in the public_html/. the index.php file and the .env files are not "really part" of the "framework code", so they can be modified based on the ideal configuration for the project. Besides, I can't have multiple "Boot.php" files, but I can have multiple index.php and env files. Thanks, really hope this is considered.
@chenzen You can add code to load .env file in your index.php.
|
Welcome Guest, Not a member yet? Register Sign In |