setVersion() public method

Set the version of the browser
public setVersion ( string $version )
$version string The version of the Browser
Exemplo n.º 1
0
 /**
  * Determine if the browser is Android.
  *
  * @return bool
  */
 public static function checkBrowserAndroid()
 {
     // Navigator
     if (stripos(self::$userAgentString, 'Android') !== false) {
         if (preg_match('/Version\\/([\\d\\.]*)/i', self::$userAgentString, $matches)) {
             self::$browser->setVersion($matches[1]);
         } else {
             self::$browser->setVersion(Browser::VERSION_UNKNOWN);
         }
         self::$browser->setName(Browser::NAVIGATOR);
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * Determine if the browser is Android.
  *
  * @param Browser $browser
  * @param UserAgent $userAgent
  * @return bool
  */
 private static function checkBrowserAndroid(Browser $browser, UserAgent $userAgent)
 {
     // Navigator
     if (stripos($userAgent->getUserAgentString(), 'Android') !== false) {
         if (preg_match('/Version\\/([\\d\\.]*)/i', $userAgent->getUserAgentString(), $matches)) {
             $browser->setVersion($matches[1]);
         } else {
             $browser->setVersion($browser::VERSION_UNKNOWN);
         }
         $browser->setName($browser::NAVIGATOR);
         return true;
     }
     return false;
 }