/** * getCurrentDomain * * @param null $default * * @return null|string */ public function getCurrentDomain($default = null) { $currentDomain = PhpServer::getRequestDomain(); //Use the default site if the requested domain name is an IP address $ipValidator = new Ip(); if ($ipValidator->isValid($currentDomain)) { $currentDomain = $default; } return $currentDomain; }
/** * getSiteFromRequest * * @param RequestInterface $request * * @return void */ public function getSiteFromRequest(RequestInterface $request) { $domain = PhpServer::getDomainFormHost($request->getUri()->getHost()); $this->siteService->getSite($domain); }
/** * getRequestUrl * * @return string */ public function getRequestUrl() { $requestUri = PhpServer::getRequestUri(); $baseUri = explode('?', $requestUri); return $baseUri[0]; }