TeraWurflUserAgentMatchers
[ class tree: TeraWurflUserAgentMatchers ] [ index: TeraWurflUserAgentMatchers ] [ all elements ]

Source for file OperaMiniUserAgentMatcher.php

Documentation is available at OperaMiniUserAgentMatcher.php

  1. <?php
  2. /**
  3.  * Tera_WURFL - PHP MySQL driven WURFL
  4.  * 
  5.  * Tera-WURFL was written by Steve Kamerman, and is based on the
  6.  * Java WURFL Evolution package by Luca Passani and WURFL PHP Tools by Andrea Trassati.
  7.  * This version uses a MySQL database to store the entire WURFL file, multiple patch
  8.  * files, and a persistent caching mechanism to provide extreme performance increases.
  9.  * 
  10.  * @package TeraWurflUserAgentMatchers
  11.  * @author Steve Kamerman <stevekamerman AT gmail.com>
  12.  * @version Stable 2.1.3 $Date: 2010/09/18 15:43:21
  13.  * @license http://www.mozilla.org/MPL/ MPL Vesion 1.1
  14.  */
  15. /**
  16.  * Provides a specific user agent matching technique
  17.  * @package TeraWurflUserAgentMatchers
  18.  */
  19.     
  20.     public static $constantIDs array(
  21.         "browser_opera_mini_release1",
  22.         "browser_opera_mini_release2",
  23.         "browser_opera_mini_release3",
  24.         "browser_opera_mini_release4",
  25.         "browser_opera_mini_release4"
  26.     );
  27.     
  28.     public function __construct(TeraWurfl $wurfl){
  29.         parent::__construct($wurfl);
  30.     }
  31.     public function applyConclusiveMatch($ua{
  32.         $tolerance UserAgentUtils::firstSlash($ua);
  33.         $this->wurfl->toLog("Applying ".get_class($this)." Conclusive Match: RIS with threshold $tolerance",LOG_INFO);
  34.         return $this->risMatch($ua$tolerance);
  35.     }
  36.     public function recoveryMatch($ua){
  37.        $this->wurfl->toLog("Applying ".get_class($this)." recovery match ($ua)",LOG_INFO);
  38.         if(self::contains($ua,"Opera Mini/1")){
  39.             return "browser_opera_mini_release1";
  40.         }
  41.         if(self::contains($ua,"Opera Mini/2")){
  42.             return "browser_opera_mini_release2";
  43.         }
  44.         if(self::contains($ua,"Opera Mini/3")){
  45.             return "browser_opera_mini_release3";
  46.         }
  47.         if(self::contains($ua,"Opera Mini/4")){
  48.             return "browser_opera_mini_release4";
  49.         }
  50.         if(self::contains($ua,"Opera Mini/5")){
  51.             return "browser_opera_mini_release5";
  52.         }
  53.         if(self::contains($ua,"Opera Mobi")){
  54.             return "browser_opera_mini_release4";
  55.         }
  56.         return "browser_opera_mini_release1";
  57.     }
  58. }

Documentation generated on Sun, 19 Sep 2010 00:15:52 +0000 by phpDocumentor 1.4.3