Welcome Guest, Not a member yet? Register   Sign In
Order of loading config and constants
#1

(This post was last modified: 01-24-2018, 10:40 PM by pbarney.)

When CI first loads the config.php file, it first grabs the one located at

    /application/config/config.php

and then it loads the one located at

    /application/config/ENVIRONMENT/config.php

But when loading constants.php, it does it in the reverse order:

    /application/config/ENVIRONMENT/constants.php

and then

    /application/config/constants.php

Is there any reason for the change in different order? I would like to load a global constant in /application/config/constants.php that is referenced in the ENVIRONMENT/constants.php file, but they load in a backwards order.

I see the order for config.php referenced at https://www.codeigniter.com/user_guide/l...vironments but nothing about the order for constants.php

Is this arbitrary? Any chance it could be changed in future releases?
Reply


Messages In This Thread
Order of loading config and constants - by pbarney - 01-24-2018, 09:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB