Page 1 of 1
Evaluate Config enviroment from External file
Posted: Thu May 23, 2024 10:54 pm
by onoboa
Hi,
I need to evaluate if my environment is Development or Production from external file (non project file, in php).
I wrote this:
require_once('../src/config.php');
$environment = $CONFIG("ENVIRONMENT");
echo $environment;
But no get the value, can you indicates me the way to access from external file?
Thanks,
Omar
Re: Evaluate Config enviroment from External file
Posted: Thu May 23, 2024 11:17 pm
by mobhar
It won't work if you only wrote that code.
You may refer to viewtopic.php?t=59063.
Re: Evaluate Config enviroment from External file
Posted: Thu May 23, 2024 11:48 pm
by onoboa
Thanks,
I will check this topic.
Re: Evaluate Config enviroment from External file
Posted: Fri May 24, 2024 9:00 am
by arbei
onoboa wrote:
$environment = $CONFIG("ENVIRONMENT");
You have wrong syntax. Note that $CONFIG
is an array.