/**
  * Returns TRUE whether the given site matches the given request
  *
  * @param SiteInterface $site    A site instance
  * @param Request       $request A request instance
  *
  * @return string|boolean FALSE whether the site does not match
  */
 protected function matchRequest(SiteInterface $site, Request $request)
 {
     $results = array();
     // we read the value from the attribute to handle fragment support
     $requestPathInfo = $request->get('pathInfo', $request->getPathInfo());
     foreach ($site->getLanguageVersions() as $lv) {
         if (preg_match(sprintf('@^(%s)(/.*|$)@', $lv->getRelativePath()), $requestPathInfo, $results)) {
             $site->setHost($lv->getHost());
             $site->setLocale($lv->getLocale());
             $site->setRelativePath($lv->getRelativePath());
             $site->setTitle($lv->getTitle());
             $site->setMetaDescription($lv->getMetaDescription());
             $site->setMetaKeywords($lv->getMetaKeywords());
             $this->site = $site;
             $request->setLocale($lv->getLocale());
             $request->attributes->set('_locale', $lv->getLocale());
             return $results[2];
         }
     }
     return false;
 }