/**
  * Returns the device id for the device that matches the $request
  * @param WURFL_Request_GenericRequest $request WURFL Request object
  * @return string WURFL device id
  */
 private function deviceIdForRequest($request)
 {
     $deviceId = $this->_cacheProvider->load($request->id);
     if (empty($deviceId)) {
         $deviceId = $this->_userAgentHandlerChain->match($request);
         // save it in cache
         $this->_cacheProvider->save($request->id, $deviceId);
     }
     return $deviceId;
 }
Beispiel #2
0
 /**
  * Returns the device id for the device that matches the $request
  * @param WURFL_Request_GenericRequest $request WURFL Request object
  * @return string WURFL device id
  */
 private function deviceIdForRequest($request)
 {
     $deviceId = $this->_cacheProvider->load($request->id);
     if (empty($deviceId)) {
         $deviceId = $this->_userAgentHandlerChain->match($request);
         // save it in cache
         $this->_cacheProvider->save($request->id, $deviceId);
     } else {
         $request->matchInfo->from_cache = true;
         $request->matchInfo->lookup_time = 0.0;
     }
     return $deviceId;
 }
Beispiel #3
0
 /**
  * Returns the device id for the device that matches the $request
  * @param WURFL_Request_GenericRequest $request WURFL Request object
  * @return string WURFL device id
  */
 private function deviceIdForRequest($request)
 {
     $deviceId = $this->_cacheProvider->load($request->id);
     if (empty($deviceId)) {
         $generic_normalizer = WURFL_UserAgentHandlerChainFactory::createGenericNormalizers();
         $request->userAgentNormalized = $generic_normalizer->normalize($request->userAgent);
         if (WURFL_Configuration_ConfigHolder::getWURFLConfig()->isHighPerformance() && WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis($request->userAgentNormalized)) {
             // This device has been identified as a web browser programatically, so no call to WURFL is necessary
             return WURFL_Constants::GENERIC_WEB_BROWSER;
         }
         $deviceId = $this->_userAgentHandlerChain->match($request);
         // save it in cache
         $this->_cacheProvider->save($request->id, $deviceId);
     } else {
         $request->matchInfo->from_cache = true;
         $request->matchInfo->lookup_time = 0.0;
     }
     return $deviceId;
 }