Barry

maybe those are parsed before _config.php

Barry

yeah - i’ve tried that, but using setenv in _config.php is not picked up by the yml files

Barry

@theruss is there any way to modify the value in PHP before it’s evaluated?

theruss

What's the value you want to modify and where is it first declared?

Barry

its first declared as a system envvar

theruss

So via your webserver or some CLI process using export or some such?

Barry

its just a url - a redis connection string

theruss

Right...and (dumb question) but why can't the right URL be declared in the first place on the desired/applicable env?

theruss

Yeah, but before we come up with solutions, I just want to know why the value of that is "wrong" such that you need to modify it in the way that you're asking 🙂

Barry

good point @theruss - i will check first and get back to you 🙂

theruss

Cool - cos that's the general idea with these vars: They're environment specific

Barry

Just thinking about options, I wonder if I could avoid relying on backticks and use Config::modify() to set a constructor param instead

MichalKleiner

@Barry@theruss is right here, why do you need to be able to update the value per request (which is what php gives you)… it might signal a non-standard architecture, a misconfiguration somewhere etc.

MichalKleiner

you can define different sections in the YAML and have them applied per some other env variable if needed

MichalKleiner

e.g. different config per dev/test/live env type or based on e.g. a ENV_CUSTOM_TYPE defined in your virtual host etc…

theruss

@Barry FYI the relevant docs are here: FAhzl2HMmThVN

Barry

@MichalKleiner thanks - i understand what you’re saying. Still waiting to hear back we can just do what you’re suggesting


Show less replies
Barry

e.g. can I specify SMTP_HOST in _config.php ? or does it need to be done earlier in the pipeline?

Barry

at what point can i define that value to have it be picked up by the yml file?

Barry

Hi all, some .yml config files use envars inside of backticks like Host: ‘SMTP_HOST

Barry

but you reckon if set to live, its not run on every request?

Barry

ah I see - I was using debug bar, so probably set the SS_ENVIRONMENT_TYPE to dev

Barry

is it safe to cache that query? - i’m guessing the list of tables wont change between deploys

Barry

hi all, i see that the query SHOW FULL TABLES WHERE Table_Type != 'VIEW'; is being run on every request. This takes 3.5ms locally, but 2seconds when deployed to mysql azure