public function __construct(Request $req) { $this->mapkey = $req->getMapStack(); $this->ajax = (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) and strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'); $this->params = $req->parseParams(); $this->url = $_SERVER['REQUEST_URI']; $this->path = $_SERVER['QUERY_PATH']; $this->method = strtolower($_SERVER['REQUEST_METHOD']); if (isset($_SERVER['SERVER_PROTOCOL'])) { $this->protocol = $_SERVER['SERVER_PROTOCOL']; } if (isset($_SERVER['SERVER_PORT'])) { $this->port = (int) $_SERVER['SERVER_PORT']; } if (isset($_SERVER['SERVER_NAME'])) { $this->host = $_SERVER['SERVER_NAME']; } $this->secure = self::isHTTPS(); if (isset($_SERVER['HTTP_REFERER'])) { $this->referer = $_SERVER['HTTP_REFERER']; } }