Closed gcarreno closed 2 years ago
Hello @gcarreno , you are right, it was implemented illogically!
Hi @gcarreno , I already fixed it, you can close the issue!
Hey Andrii (@pasichDev),
you are right, it was implemented illogically!
Not completely illogical, no. A lot of the frameworks have some kind of variable with the same info. The difference is that they try and get it from the running environment and avoid being a fixed constant :smiley:
I already fixed it, you can close the issue!
That is awesome, I'll do that :smiley:
Cheers, Gus
Hey Andrii (@pasichDev),
I've noticed that in both your initial code and this new version that you always have a config variable with the site and port.
This should either be inferred from the
$_SERVER
array, or never be mentioned anywhere by always using relative paths.This allows for very easy deployments without having to have another variable to configure.
We have config vars for the stuff we can't get from
$_SERVER
and/or$_ENV
, like database credentials and such. The rest must be collected from the environment that the app is residing, not ask the person that deploys to have another variable to mess up :smiley: Humans tend to make mistakes. Collecting data from the environment is safer that having a human guess what it is.Cheers, Gus