ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
341 stars 45 forks source link

Env, add environment component #219

Closed mruz closed 5 years ago

Yahasana commented 5 years ago

why don't place env.zep into config folder?

mruz commented 5 years ago

It's a helper for global variable like Session, so I put it in the root folder. Do you think it should go to Config folder?

Yahasana commented 5 years ago

I don't think this helper is worth adding to Ice but hiding it in config folder is ok

Please note that writing to $_ENV does not actually set an environment variable, i.e. the variable will not propagate to any child processes you launch (except forked script processes, in which case it's just a variable in the script's memory). To set real environment variables, you must use putenv().

Basically, setting a variable in $_ENV does not have any meaning besides setting or overriding a script-wide global variable. Thus, one should never modify $_ENV except for testing purposes (and then be careful to use putenv() too, if appropriate).

PHP will not trigger any kind of error or notice when writing to $_ENV.