Evaluate Config enviroment from External file

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
onoboa
User
Posts: 94
Location: Guayaquil - Ecuador

Evaluate Config enviroment from External file

Post 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


mobhar
User
Posts: 11790

Post by mobhar »

It won't work if you only wrote that code.

You may refer to viewtopic.php?t=59063.


onoboa
User
Posts: 94
Location: Guayaquil - Ecuador

Post by onoboa »

Thanks,

I will check this topic.


arbei
User
Posts: 9501

Post by arbei »

onoboa wrote:

$environment = $CONFIG("ENVIRONMENT");

You have wrong syntax. Note that $CONFIG is an array.


Post Reply