You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I personally feel like having this happen automatically would not be desired at all, as it could be highly confusing. Especially when looking at a config file for something which would actually be deployed to a different environment.
Perhaps some wrapper script to pre-process it would suffice?
I'm with @keith-hall on this. Automatically expanding environment variables will likely cause confusion, even in code.
functionnewTempFile($tmpdir) {
$file = fopen("${tmpdir}/file.txt", "w");
if ($file === false) {
// do something
}
return$file;
}
If environment variables were replaced, it would lead the user into thinking the new temporary file is located at /tmp instead of the directory specified as the function parameter.
A preprocessing step would be a better place to do environment variable expansion.
Something like this:
should be replaced automatically by the env variable
HOME
The text was updated successfully, but these errors were encountered: