Codeigniter4: Feature Request : support the db config instead of .env while the core is initialzed

Created on 17 Dec 2018  路  6Comments  路  Source: codeigniter4/CodeIgniter4


name: Feature Request
about: It would be a great thing if, the core initializator take custom config instead those of env or app


Describe the bug
I used to use the db table settings as the main for the core initializator, to avoid editing Config/App.php every time i change the server or domain or any other extra-param that I need to use on runtime .

Usine a base controller is fine a bit, but the baseURL is not overwrite because the \CodeIgniter initializator take as params the Config\App before any initialization of other dependencies including DB instance.

CodeIgniter 4 version
All

Affected module(s)
CodeIgniter Initializator

Expected behavior, and steps to reproduce if appropriate
autoloading some custom db table configs to overwrite the app before any other dependencies that can be used globaly

Context

  • OS: Win/Linux
  • Apache/Nginx
  • PHP version : 7x

Most helpful comment

That's something we can look into, and I can see it being handy to provide some other type of method for that. However, we're not doing any new features at the moment, so this will have to be looked at after 4.0 final for a 4.1 release.

All 6 comments

I'm confused on what exactly you're wanting to do. The .env file seems to solve what you're asking for. Could yo provide more concrete details?

that would be an awesome feature 馃憤

His point is to use database stored configuration - like App.php variables loaded from database instead of local file
-> makes multiple configuration/installation much easier.

@puschie286 explained exactly what I want to say due to my bad English ^^
I used to put the settings,administrator, user ...etc object as a global variable which I can access every where using a helper, this feature is suportted but not avalaible untill the core is initialzed.
What I want is to use the my database settings instead of the file .env or App.php configs for the initializer of the CodeIgniter
the main problem is that the baseURL is not altered by my app settings stored in db, which urge me always to edit that file everytime i changed the domain or the machine.

@TatwiraT
i know that problem^^ currently i use a install script, that configure CI for the target - but many costumers php installations doesn't have any write rights, so we need to ask the admin to change the stuff and configure our product :/ not to say this leaded to many problems, many admins can neither program nor script... so changing a variable is a bigger problem than you can imagine :D

That's something we can look into, and I can see it being handy to provide some other type of method for that. However, we're not doing any new features at the moment, so this will have to be looked at after 4.0 final for a 4.1 release.

@puschie286 Yes, we drink from the same mug ^^
@lonnieezell thank you ^^

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lonnieezell picture lonnieezell  路  7Comments

crustamet picture crustamet  路  4Comments

lonnieezell picture lonnieezell  路  6Comments

AcidSlide picture AcidSlide  路  6Comments

Jack-Dane picture Jack-Dane  路  4Comments