示例#1
0
文件: SiteService.php 项目: reliv/Rcm
 /**
  * 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;
 }
示例#2
0
 /**
  * getSiteFromRequest
  *
  * @param RequestInterface $request
  *
  * @return void
  */
 public function getSiteFromRequest(RequestInterface $request)
 {
     $domain = PhpServer::getDomainFormHost($request->getUri()->getHost());
     $this->siteService->getSite($domain);
 }
示例#3
0
 /**
  * getRequestUrl
  *
  * @return string
  */
 public function getRequestUrl()
 {
     $requestUri = PhpServer::getRequestUri();
     $baseUri = explode('?', $requestUri);
     return $baseUri[0];
 }