/** * Returns the name of the web server. * * Returns 'n/a' in case the web server could not be determined. * * @return string */ public static function getWebServer() { // get server information as array $serverSoftware = StringUtil::split('/', strip_tags(EnvironmentUtil::getEnvironmentVariable('SERVER_SOFTWARE')), 2); // check for web server name if (isset($serverSoftware[0])) { // try to get web server version if (isset($serverSoftware[1])) { // get web server version $webServerVersion = StringUtil::split(' ', $serverSoftware[1], 2)[0]; // append web server version to web server name if ($webServerVersion !== '') { return $serverSoftware[0] . ' ' . $webServerVersion; } } // return web server return $serverSoftware[0]; } // unable to determine web server return 'n/a'; }
/** * @see \Ableron\Core\Session\Validators\ValidatorInterface::setValidationData() */ public function setValidationData(SessionEntity $session) { $session->setData('sessionValidation.lastAccessUserAgent', EnvironmentUtil::getEnvironmentVariable('HTTP_USER_AGENT')); }
/** * @see \Ableron\Core\Session\Validators\ValidatorInterface::setValidationData() */ public function setValidationData(SessionEntity $session) { $session->setData('sessionValidation.lastAccessIpAddress', EnvironmentUtil::getEnvironmentVariable('REMOTE_ADDR')); }
/** * Returns the request URI. * * @return \Ableron\Lib\Net\Uri */ private function getRequestUri() { return (new Uri(sprintf('%s://%s/%s', EnvironmentUtil::getRequestProtocol(), EnvironmentUtil::getEnvironmentVariable('HTTP_HOST', ''), isset($_SERVER['REQUEST_URI']) ? ltrim($_SERVER['REQUEST_URI'], '/') : ltrim(EnvironmentUtil::getScriptName(), '/') . (($queryString = EnvironmentUtil::getEnvironmentVariable('QUERY_STRING')) !== null ? '?' . $queryString : ''))))->normalize(); }