As you might know, when you create a new project with CI you'll have to manually enter base url, encryption key in config/config.php. I'm trying to overcome this and is hence looking for a way to read those values from a database instead - making the installation for a customer and the set up time as a whole decrease a lot.
A customer isn't able to edit a PHP file's variables, but is most likely able to, with some guidance, enter base url and have a encryption key automatically filled in by the system.
Is there any way to accomplish this?
As far Codeigniter 3.1.7
pre_controller
won't work because it will return NULL value while initializing$CI =& get_instance();
To solve this:
Change the hook point from
pre_controller
topost_controller_constructor
Modified source:
config/hooks.php
and in
hooks/myotherclass.php
Now it will work!
Of course! Add a hook - post_controller and set these config values through that file.
config/hooks.php
hooks/myotherclass.php
Basicly you set these values before they're used in any controller or similiar.