Example #1
0
 /**
  * Routine to determine the browser type.
  *
  * @param Browser $browser
  * @param UserAgent $userAgent
  *
  * @return bool
  */
 public static function detect(Browser $browser, UserAgent $userAgent = null)
 {
     self::$browser = $browser;
     if (is_null($userAgent)) {
         $userAgent = self::$browser->getUserAgent();
     }
     self::$userAgentString = $userAgent->getUserAgentString();
     self::$browser->setName(Browser::UNKNOWN);
     self::$browser->setVersion(Browser::VERSION_UNKNOWN);
     self::checkChromeFrame();
     foreach (self::$browsersList as $browserName) {
         $funcName = self::FUNC_PREFIX . $browserName;
         if (self::$funcName()) {
             return true;
         }
     }
     return false;
 }
Example #2
0
 /**
  * Used to determine if the browser is actually "chromeframe".
  *
  * @return bool
  */
 public function getIsChromeFrame()
 {
     if (!isset($this->name)) {
         BrowserDetector::detect($this, $this->getUserAgent());
     }
     return $this->isChromeFrame;
 }