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

(01-25-2018, 03:26 PM)daveĀ friend Wrote: What difference does it make? All the constants in both files will be defined either way.

I makes a difference because I can define any defaults in the primary constants file that may have not been defined in the environment constants file.

For example suppose I want to say in config/ENVIRONMENT/constants.php:

PHP Code:
define('EMAIL''[email protected]'); 

Then in config/constants.php I can say:
PHP Code:
defined('EMAIL') OR define('EMAIL''[email protected]'); 

That way, if an environment doesn't have it defined, I can have a fallback default. The way it works now, if I define the defaults in the global constants file, I can't redefine then in the environment-specific constants file.

But all the same, your proposed solution cuts through all of that! Simple and easy, thank you. It's a bit of a kludge, but it works which is what I'm after.

Messages In This Thread
RE: Order of loading config and constants - by pbarney - 01-26-2018, 09:43 AM

Theme © iAndrew 2016 - Forum software by © MyBB