/**
  * Determine the environment and set a global identifier.
  */
 public static function setEnvironment()
 {
     $envs = CShell::environments();
     $domain = $_SERVER["SERVER_NAME"];
     if (CShell::debug()) {
         mysqli_report(MYSQLI_REPORT_ALL);
         error_reporting(E_ALL ^ E_NOTICE);
     } else {
         error_reporting(0);
     }
     foreach ($envs as $key => $value) {
         if ($domain == $envs[$key]["domain"]) {
             define('ENV', $key);
             break;
         }
     }
     if (!defined('ENV')) {
         echo 'The domain was not found in the configuration.';
         exit;
     }
 }