/** * Get host name of the given URL * * @param string $url * @return string */ public static function getHostName() { $hostConfig = ConfigManager::getConfig("Host")->AuxConfig; if (empty($_SERVER['HTTP_HOST'])) { $_SERVER['HTTP_HOST'] = $hostConfig->cgiHost; } if (SiteMode::get() == SiteMode::MODE_DEVELOPMENT and static::getDevHostName() !== false) { $host_name = static::getDevHostName(); } else { $host_name = static::noWWW($_SERVER['HTTP_HOST']); } return $host_name; }
/** * Is site now in development mode * * @return boolean */ function isInDevelopmentMode() { if (SiteMode::get() == SiteMode::MODE_DEVELOPMENT) { return true; } return false; }