1.2.430. Environment Variables¶
Environment variables are used to interact with the hosting system.
They often provides configuration parameter that are set by the host of the application to be used. That way, information is not hardcoded in the application, and may be changed at production.
<?php
//ENVIRONMENT set the production context
if (getenv('ENVIRONMENT') === 'Production') {
$sshKey = getenv('HOST_KEY');
} elseif (getenv('ENVIRONMENT') === 'Developper') {
$sshKey = 'NO KEY';
} else {
header('No website here.');
die();
}
?>
See also $_ENV.
1.2.430.1. Connex PHP features¶
1.2.430.1.1. Specs¶
Short name |
Variables/UncommonEnvVar |
Rulesets |
|
Exakat since |
1.0.5 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Medium |
Available in |