Esempio n. 1
0
 /**
  * Apply special host settings,
  * Taken from "hosts" part of site config file
  *
  * @return void
  */
 public static function applyHostSettings($file)
 {
     self::$hosts = (require DOCUMENT_ROOT . "/{$file}");
     $server = preg_replace('|^www.|', '', $_SERVER['HTTP_HOST']);
     if (isset(self::$hosts[$server])) {
         $host = self::$hosts[$server];
         self::$settings = array_merge(self::$settings, $host);
     } else {
         throw new \Exception('wrong server config');
     }
 }