+ /**
+ * Tries to load environment specific variables, based on the `env.config.php` mapping table
+ *
+ * @param array $server The $_SERVER variable
+ *
+ * @return array The config array (empty if no config was found)
+ *
+ * @throws Exception if the configuration file isn't readable
+ */
+ public function loadEnvConfig(array $server)
+ {
+ $filepath = $this->baseDir . DIRECTORY_SEPARATOR . // /var/www/html/
+ self::STATIC_DIR . DIRECTORY_SEPARATOR . // static/
+ "env.config.php"; // env.config.php
+
+ if (!file_exists($filepath)) {
+ return [];
+ }
+
+ $envConfig = $this->loadConfigFile($filepath);
+
+ $return = [];
+
+ foreach ($envConfig as $envKey => $configStructure) {
+ if (isset($server[$envKey])) {
+ $return[$configStructure[0]][$configStructure[1]] = $server[$envKey];
+ }
+ }
+
+ return $return;
+ }
+