Changeset 17140


Ignore:
Timestamp:
2008/03/12 21:08:31 (16 years ago)
Author:
adachi
Message:

merge r17127:17138 (update Net_UserAgent_Mobile)

Location:
branches/comu-ver2/data/module/Net/UserAgent
Files:
3 deleted
7 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile.php

    r15532 r17140  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    1818 * @version    CVS: $Id$ 
     
    2121 
    2222require_once dirname(__FILE__) . '/../../PEAR.php'; 
    23 require_once dirname(__FILE__) . '/Mobile/Request.php'; 
    2423 
    2524// {{{ constants 
     
    8988 * @package    Net_UserAgent_Mobile 
    9089 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    91  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     90 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    9291 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    93  * @version    Release: 0.30.0 
     92 * @version    Release: 0.31.0 
    9493 * @since      Class available since Release 0.1 
    9594 */ 
     
    126125     * If no argument is supplied, $_SERVER{'HTTP_*'} is used. 
    127126     * 
    128      * @param mixed $stuff User-Agent string or object that works with 
    129      *     HTTP_Request (not implemented) 
     127     * @param string $userAgent User-Agent string 
    130128     * @return mixed a newly created Net_UserAgent_Mobile object, or a PEAR 
    131129     *     error object on error 
    132      * @see Net_UserAgent_Mobile_Request::factory() 
    133      */ 
    134     function &factory($stuff = null) 
    135     { 
    136         static $mobileRegex; 
    137         if (!isset($mobileRegex)) { 
    138             $docomoRegex    = '^DoCoMo/\d\.\d[ /]'; 
    139             $vodafoneRegex  = '^(?:(?:SoftBank|Vodafone|J-PHONE|Vemulator|J-EMULATOR)/\d\.\d|(?:MOT|MOTEMULATOR)-)'; 
    140             $ezwebRegex     = '^(?:KDDI-[A-Z]+\d+[A-Z]? )?UP\.Browser\/'; 
    141             $airhphoneRegex = '^Mozilla/3\.0\((?:DDIPOCKET|WILLCOM);'; 
    142             $mobileRegex = 
    143                 "(?:($docomoRegex)|($vodafoneRegex)|($ezwebRegex)|($airhphoneRegex))"; 
    144         } 
    145  
    146         $request = &Net_UserAgent_Mobile_Request::factory($stuff); 
     130     */ 
     131    function &factory($userAgent = null) 
     132    { 
     133        if (is_null($userAgent)) { 
     134            $userAgent = $_SERVER['HTTP_USER_AGENT']; 
     135        } 
    147136 
    148137        // parse User-Agent string 
    149         $ua = $request->get('User-Agent'); 
    150         $sub = 'NonMobile'; 
    151         if (preg_match("!$mobileRegex!", $ua, $matches)) { 
    152             $sub = @$matches[1] ? 'DoCoMo' : 
    153                 (@$matches[2] ? 'Vodafone' : 
    154                  (@$matches[3] ? 'EZweb' : 'AirHPhone')); 
    155         } 
    156         $className = "Net_UserAgent_Mobile_{$sub}"; 
    157  
    158         if (!class_exists($className)) { 
    159             $file = dirname(__FILE__) . "/Mobile/{$sub}.php"; 
     138        if (Net_UserAgent_Mobile::isDoCoMo($userAgent)) { 
     139            $driver = 'DoCoMo'; 
     140        } elseif (Net_UserAgent_Mobile::isEZweb($userAgent)) { 
     141            $driver = 'EZweb'; 
     142        } elseif (Net_UserAgent_Mobile::isSoftBank($userAgent)) { 
     143            $driver = 'SoftBank'; 
     144        } elseif (Net_UserAgent_Mobile::isWillcom($userAgent)) { 
     145            $driver = 'Willcom'; 
     146        } else { 
     147            $driver = 'NonMobile'; 
     148        } 
     149 
     150        $class = "Net_UserAgent_Mobile_$driver"; 
     151 
     152        if (!class_exists($class)) { 
     153             
     154            $file = dirname(__FILE__) . "/Mobile/{$driver}.php"; 
    160155            if (!include_once $file) { 
    161156                return PEAR::raiseError(null, 
     
    168163        } 
    169164 
    170         $instance = &new $className($request); 
     165        $instance = &new $class($userAgent); 
    171166        $error = &$instance->isError(); 
    172167        if (Net_UserAgent_Mobile::isError($error)) { 
     
    191186     * returns a instance from existent ones 
    192187     * 
    193      * @param mixed $stuff User-Agent string or object that works with 
    194      *     HTTP_Request (not implemented) 
     188     * @param string $userAgent User-Agent string 
    195189     * @return mixed a newly created or a existent Net_UserAgent_Mobile 
    196190     *     object, or a PEAR error object on error 
    197191     * @see Net_UserAgent_Mobile::factory() 
    198192     */ 
    199      function &singleton($stuff = null) 
    200      { 
    201          static $instance; 
    202          if (!isset($instance)) { 
    203              $instance = Net_UserAgent_Mobile::factory($stuff); 
    204          } 
    205  
    206          return $instance; 
    207      } 
     193    function &singleton($userAgent = null) 
     194    { 
     195        static $instances; 
     196 
     197        if (!isset($instances)) { 
     198            $instances = array(); 
     199        } 
     200 
     201        if (is_null($userAgent)) { 
     202            $userAgent = $_SERVER['HTTP_USER_AGENT']; 
     203        } 
     204 
     205        if (!array_key_exists($userAgent, $instances)) { 
     206            $instances[$userAgent] = Net_UserAgent_Mobile::factory($userAgent); 
     207        } 
     208 
     209        return $instances[$userAgent]; 
     210    } 
    208211 
    209212    // }}} 
     
    253256    } 
    254257 
     258    // }}} 
     259    // {{{ isMobile() 
     260 
     261    /** 
     262     * Checks whether or not the user agent is mobile by a given user agent 
     263     * string. 
     264     * 
     265     * @param string $userAgent 
     266     * @return boolean 
     267     * @since Method available since Release 0.31.0 
     268     */ 
     269    function isMobile($userAgent = null) 
     270    { 
     271        if (Net_UserAgent_Mobile::isDoCoMo($userAgent)) { 
     272            return true; 
     273        } elseif (Net_UserAgent_Mobile::isEZweb($userAgent)) { 
     274            return true; 
     275        } elseif (Net_UserAgent_Mobile::isSoftBank($userAgent)) { 
     276            return true; 
     277        } elseif (Net_UserAgent_Mobile::isWillcom($userAgent)) { 
     278            return true; 
     279        } 
     280 
     281        return false; 
     282    } 
     283 
     284    // }}} 
     285    // {{{ isDoCoMo() 
     286 
     287    /** 
     288     * Checks whether or not the user agent is DoCoMo by a given user agent 
     289     * string. 
     290     * 
     291     * @param string $userAgent 
     292     * @return boolean 
     293     * @since Method available since Release 0.31.0 
     294     */ 
     295    function isDoCoMo($userAgent = null) 
     296    { 
     297        if (is_null($userAgent)) { 
     298            $userAgent = $_SERVER['HTTP_USER_AGENT']; 
     299        } 
     300 
     301        if (preg_match('!^DoCoMo!', $userAgent)) { 
     302            return true; 
     303        } 
     304 
     305        return false; 
     306    } 
     307 
     308    // }}} 
     309    // {{{ isEZweb() 
     310 
     311    /** 
     312     * Checks whether or not the user agent is EZweb by a given user agent 
     313     * string. 
     314     * 
     315     * @param string $userAgent 
     316     * @return boolean 
     317     * @since Method available since Release 0.31.0 
     318     */ 
     319    function isEZweb($userAgent = null) 
     320    { 
     321        if (is_null($userAgent)) { 
     322            $userAgent = $_SERVER['HTTP_USER_AGENT']; 
     323        } 
     324 
     325        if (preg_match('!^KDDI-!', $userAgent)) { 
     326            return true; 
     327        } elseif (preg_match('!^UP\.Browser!', $userAgent)) { 
     328            return true; 
     329        } 
     330 
     331        return false; 
     332    } 
     333 
     334    // }}} 
     335    // {{{ isSoftBank() 
     336 
     337    /** 
     338     * Checks whether or not the user agent is SoftBank by a given user agent 
     339     * string. 
     340     * 
     341     * @param string $userAgent 
     342     * @return boolean 
     343     * @since Method available since Release 0.31.0 
     344     */ 
     345    function isSoftBank($userAgent = null) 
     346    { 
     347        if (is_null($userAgent)) { 
     348            $userAgent = $_SERVER['HTTP_USER_AGENT']; 
     349        } 
     350 
     351        if (preg_match('!^SoftBank!', $userAgent)) { 
     352            return true; 
     353        } elseif (preg_match('!^Semulator!', $userAgent)) { 
     354            return true; 
     355        } elseif (preg_match('!^Vodafone!', $userAgent)) { 
     356            return true; 
     357        } elseif (preg_match('!^Vemulator!', $userAgent)) { 
     358            return true; 
     359        } elseif (preg_match('!^MOT-!', $userAgent)) { 
     360            return true; 
     361        } elseif (preg_match('!^MOTEMULATOR!', $userAgent)) { 
     362            return true; 
     363        } elseif (preg_match('!^J-PHONE!', $userAgent)) { 
     364            return true; 
     365        } elseif (preg_match('!^J-EMULATOR!', $userAgent)) { 
     366            return true; 
     367        } 
     368 
     369        return false; 
     370    } 
     371 
     372    // }}} 
     373    // {{{ isWillcom() 
     374 
     375    /** 
     376     * Checks whether or not the user agent is Willcom by a given user agent 
     377     * string. 
     378     * 
     379     * @param string $userAgent 
     380     * @return boolean 
     381     * @since Method available since Release 0.31.0 
     382     */ 
     383    function isWillcom($userAgent = null) 
     384    { 
     385        if (is_null($userAgent)) { 
     386            $userAgent = $_SERVER['HTTP_USER_AGENT']; 
     387        } 
     388 
     389        if (preg_match('!^Mozilla/3\.0\((?:DDIPOCKET|WILLCOM);!', $userAgent)) { 
     390            return true; 
     391        } 
     392 
     393        return false; 
     394    } 
     395 
    255396    /**#@-*/ 
    256397 
     
    276417 * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    277418 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    278  * @version    Release: 0.30.0 
     419 * @version    Release: 0.31.0 
    279420 * @since      Class available since Release 0.1 
    280421 */ 
     
    356497 * End: 
    357498 */ 
    358 ?> 
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile/Common.php

    r15532 r17140  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    1818 * @version    CVS: $Id$ 
    1919 * @since      File available since Release 0.1 
    2020 */ 
     21 
     22require_once dirname(__FILE__) . '/../Mobile.php'; 
    2123 
    2224// {{{ Net_UserAgent_Mobile_Common 
     
    3133 * @package    Net_UserAgent_Mobile 
    3234 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    33  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     35 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    3436 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    35  * @version    Release: 0.30.0 
     37 * @version    Release: 0.31.0 
    3638 * @since      Class available since Release 0.1 
    3739 */ 
     
    4951     * @var string 
    5052     */ 
    51     var $name = ''; 
     53    var $name; 
    5254 
    5355    /** 
     
    5557     * @var string 
    5658     */ 
    57     var $version = ''; 
     59    var $version; 
    5860 
    5961    /**#@-*/ 
     
    6870     */ 
    6971    var $_display; 
    70  
    71     /** 
    72      * Net_UserAgent_Mobile_Request_XXX object 
    73      * @var object {@link Net_UserAgent_Mobile_Request_Env} 
    74      */ 
    75     var $_request; 
    7672 
    7773    /** 
     
    8076     * @var object 
    8177     **/ 
    82     var $_error = null; 
     78    var $_error; 
     79 
     80    /** 
     81     * The User-Agent string. 
     82     * @var string 
     83     * @since Property available since Release 0.31.0 
     84     **/ 
     85    var $_userAgent; 
     86 
     87    /** 
     88     * The model name of the user agent. 
     89     * 
     90     * @var string 
     91     * @since Property available since Release 0.31.0 
     92     */ 
     93    var $_model; 
     94 
     95    /** 
     96     * The raw model name of the user agent. 
     97     * 
     98     * @var string 
     99     * @since Property available since Release 0.31.0 
     100     */ 
     101    var $_rawModel; 
    83102 
    84103    /**#@-*/ 
     
    94113     * constructor 
    95114     * 
    96      * @param object $request a {@link Net_UserAgent_Mobile_Request_Env} 
    97      *     object 
    98      */ 
    99     function Net_UserAgent_Mobile_Common($request) 
     115     * @param string $userAgent User-Agent string 
     116     */ 
     117    function Net_UserAgent_Mobile_Common($userAgent) 
    100118    { 
    101119        parent::PEAR('Net_UserAgent_Mobile_Error'); 
    102         $this->_request = $request; 
    103         if (Net_UserAgent_Mobile::isError($result = $this->parse())) { 
     120 
     121        $result = $this->parse($userAgent); 
     122        if (Net_UserAgent_Mobile::isError($result)) { 
    104123            $this->isError($result); 
    105124        } 
     125 
     126        $this->_userAgent = $userAgent; 
    106127    } 
    107128 
     
    175196    function getUserAgent() 
    176197    { 
    177         return $this->getHeader('User-Agent'); 
     198        return $this->_userAgent; 
    178199    } 
    179200 
     
    189210    function getHeader($header) 
    190211    { 
    191         return $this->_request->get($header); 
     212        return @$_SERVER[ 'HTTP_' . str_replace('-', '_', $header) ]; 
    192213    } 
    193214 
     
    256277 
    257278    /** 
    258      * parse HTTP_USER_AGENT string (should be implemented in subclasses) 
    259      * 
     279     * Parses HTTP_USER_AGENT string. 
     280     * 
     281     * @param string $userAgent User-Agent string 
    260282     * @abstract 
    261283     */ 
    262     function parse() 
    263     { 
    264         die(); 
    265     } 
     284    function parse($userAgent) {} 
    266285 
    267286    // }}} 
     
    420439    { 
    421440        die(); 
     441    } 
     442 
     443    // }}} 
     444    // {{{ isSoftBank() 
     445 
     446    /** 
     447     * Returns whether the agent is SoftBank or not. 
     448     * 
     449     * @return boolean 
     450     * @since Method available since Release 0.31.0 
     451     */ 
     452    function isSoftBank() 
     453    { 
     454        return false; 
     455    } 
     456 
     457    // }}} 
     458    // {{{ isWillcom() 
     459 
     460    /** 
     461     * Returns whether the agent is Willcom or not. 
     462     * 
     463     * @return boolean 
     464     * @since Method available since Release 0.31.0 
     465     */ 
     466    function isWillcom() 
     467    { 
     468        return false; 
     469    } 
     470 
     471    // }}} 
     472    // {{{ getModel() 
     473 
     474    /** 
     475     * Returns the model name of the user agent. 
     476     * 
     477     * @return string 
     478     * @since Method available since Release 0.31.0 
     479     */ 
     480    function getModel() 
     481    { 
     482        if (is_null($this->_model)) { 
     483            return $this->_rawModel; 
     484        } else { 
     485            return $this->_model; 
     486        } 
     487    } 
     488 
     489    // }}} 
     490    // {{{ getRawModel() 
     491 
     492    /** 
     493     * Returns the raw model name of the user agent. 
     494     * 
     495     * @return string 
     496     * @since Method available since Release 0.31.0 
     497     */ 
     498    function getRawModel() 
     499    { 
     500        return $this->_rawModel; 
    422501    } 
    423502 
     
    445524 * End: 
    446525 */ 
    447 ?> 
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile/Display.php

    r15532 r17140  
    6060 * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    6161 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    62  * @version    Release: 0.30.0 
     62 * @version    Release: 0.31.0 
    6363 * @since      Class available since Release 0.1 
    6464 */ 
     
    266266 * End: 
    267267 */ 
    268 ?> 
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile/DoCoMo.php

    r15532 r17140  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    1818 * @version    CVS: $Id$ 
     
    7575 * @package    Net_UserAgent_Mobile 
    7676 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    77  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     77 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    7878 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    79  * @version    Release: 0.30.0 
     79 * @version    Release: 0.31.0 
    8080 * @link       http://www.nttdocomo.co.jp/service/imode/make/content/spec/useragent/index.html 
    8181 * @see        Net_UserAgent_Mobile_Common 
     
    9898 
    9999    /** 
    100      * name of the model like 'P502i' 
    101      * @var string 
    102      */ 
    103     var $_model = ''; 
    104  
    105     /** 
    106100     * status of the cache (TC, TB, TD, TJ) 
    107101     * @var string 
    108102     */ 
    109     var $_status = ''; 
     103    var $_status; 
    110104 
    111105    /** 
     
    113107     * @var integer 
    114108     */ 
    115     var $_bandwidth = null; 
     109    var $_bandwidth; 
    116110 
    117111    /** 
     
    119113     * @var string 
    120114     */ 
    121     var $_serialNumber = null; 
     115    var $_serialNumber; 
    122116 
    123117    /** 
     
    131125     * @var string 
    132126     */ 
    133     var $_cardID = null; 
     127    var $_cardID; 
    134128 
    135129    /** 
     
    137131     * @var string 
    138132     */ 
    139     var $_comment = null; 
     133    var $_comment; 
    140134 
    141135    /** 
     
    149143     * @var string 
    150144     */ 
    151     var $_displayBytes = ''; 
     145    var $_displayBytes; 
    152146 
    153147    /**#@-*/ 
     
    174168 
    175169    /** 
    176      * parse HTTP_USER_AGENT string 
    177      * 
     170     * Parses HTTP_USER_AGENT string. 
     171     * 
     172     * @param string $userAgent User-Agent string 
    178173     * @return mixed void, or a PEAR error object on error 
    179174     */ 
    180     function parse() 
    181     { 
    182         @list($main, $foma_or_comment) = 
    183             explode(' ', $this->getUserAgent(), 2); 
     175    function parse($userAgent) 
     176    { 
     177        @list($main, $foma_or_comment) = explode(' ', $userAgent, 2); 
    184178 
    185179        if ($foma_or_comment 
     
    220214    function makeDisplay() 
    221215    { 
    222         $display = Net_UserAgent_Mobile_DoCoMoDisplayMap::get($this->_model); 
    223         if ($this->_displayBytes !== '') { 
     216        $display = Net_UserAgent_Mobile_DoCoMoDisplayMap::get($this->getModel()); 
     217        if (!is_null($this->_displayBytes)) { 
    224218            list($widthBytes, $heightBytes) = 
    225219                explode('*', $this->_displayBytes); 
     
    248242                                    '504i|251i|^F671iS$|212i|2051|2102V|661i|2701|672i|SO213i|850i' => '4.0', 
    249243                                    'eggy|P751v' => '3.2', 
    250                                     '505i|252i|900i|506i|880i|253i|P213i|901i|700i|851i|701i|881i|^SA800i$|600i|^L601i$|^M702i(S|G)$' => '5.0', 
    251                                     '902i|702i|851i|882i|^N601i$|^D800iDS$|^P703imyu$' => '6.0', 
    252                                     '903i|703i' => '7.0' 
     244                                    '505i|252i|900i|506i|880i|253i|P213i|901i|700i|^(SH|P)851i|701i|881i|^SA800i$|600i|^L601i$|^M702i(S|G)$|^L602i$' => '5.0', 
     245                                    '902i|702i|851i|882i|^N601i$|^D800iDS$|^P703imyu$|^P704imyu$|^L70[45]i$|^F883i$' => '6.0', 
     246                                    '903i|703i|904i|704i|883i|801i|^[FD]705i' => '7.0', 
     247                                    '905i|705i' => '7.1' 
    253248                                    ); 
    254249        } 
    255250 
    256251        foreach ($htmlVersionMap as $key => $value) { 
    257             if (preg_match("/$key/", $this->_model)) { 
     252            if (preg_match("/$key/", $this->_rawModel)) { 
    258253                return $value; 
    259254            } 
     
    293288    function getSeries() 
    294289    { 
    295         if ($this->isFOMA() && preg_match('/(\d{4})/', $this->_model)) { 
     290        if ($this->isFOMA() && preg_match('/(\d{4})/', $this->_rawModel)) { 
    296291            return 'FOMA'; 
    297292        } 
    298293 
    299         if (preg_match('/(\d{3}i)/', $this->_model, $matches)) { 
     294        if (preg_match('/(\d{3}i)/', $this->_rawModel, $matches)) { 
    300295            return $matches[1]; 
    301296        } 
    302297 
    303         if ($this->_model == 'P651ps') { 
     298        if ($this->_rawModel == 'P651ps') { 
    304299            return '651'; 
    305300        } 
     
    318313    function getVendor() 
    319314    { 
    320         if (preg_match('/([A-Z]+)\d/', $this->_model, $matches)) { 
     315        if (preg_match('/([A-Z]+)\d/', $this->_rawModel, $matches)) { 
    321316            return $matches[1]; 
    322317        } 
     318 
    323319        return null; 
    324     } 
    325  
    326     // }}} 
    327     // {{{ getModel() 
    328  
    329     /** 
    330      * returns name of the model like 'P502i' 
    331      * 
    332      * @return string 
    333      */ 
    334     function getModel() 
    335     { 
    336         return $this->_model; 
    337320    } 
    338321 
     
    437420            $gpsModels = array('F661i', 'F505iGPS'); 
    438421        } 
    439         return in_array($this->_model, $gpsModels); 
     422        return in_array($this->_rawModel, $gpsModels); 
    440423    } 
    441424 
     
    483466    function _parseMain($main) 
    484467    { 
    485         @list($this->name, $this->version, $this->_model, $cache, $rest) = 
     468        @list($this->name, $this->version, $this->_rawModel, $cache, $rest) = 
    486469            explode('/', $main, 5); 
    487         if ($this->_model === 'SH505i2') { 
     470        if ($this->_rawModel == 'SH505i2') { 
    488471            $this->_model = 'SH505i'; 
    489472        } 
    490473 
    491474        if ($cache) { 
    492             if (!preg_match('/^c(\d+)/', $cache, $matches)) { 
     475            if (!preg_match('/^c(\d+)$/', $cache, $matches)) { 
    493476                return $this->noMatch(); 
    494477            } 
     
    530513    function _parseFOMA($foma) 
    531514    { 
    532         if (!preg_match('/^([^(]+)/', $foma, $matches)) { 
     515        if (!preg_match('/^([^(\s]+)/', $foma, $matches)) { 
    533516            return $this->noMatch(); 
    534517        } 
    535         $this->_model = $matches[1]; 
    536         if ($matches[1] === 'MST_v_SH2101V') { 
     518 
     519        $this->_rawModel = $matches[1]; 
     520        if ($this->_rawModel == 'MST_v_SH2101V') { 
    537521            $this->_model = 'SH2101V'; 
    538522        } 
    539523 
    540         if (preg_match('/^[^(]+\((.*?)\)$/', $foma, $matches)) { 
     524        if (preg_match('/^[^(\s]+\s?\((.*?)\)$/', $foma, $matches)) { 
     525            if (preg_match('/^compatible/', $matches[1])) { // The user-agent is DoCoMo compatible. 
     526                $this->_comment = $matches[1]; 
     527                return; 
     528            } 
     529 
    541530            $rest = explode(';', $matches[1]); 
    542531            foreach ($rest as $value) { 
    543                 if (preg_match('/^c(\d+)/', $value, $matches)) { 
     532                if (preg_match('/^c(\d+)$/', $value, $matches)) { 
    544533                    $this->_cacheSize = (integer)$matches[1]; 
    545534                    continue; 
     
    585574 * End: 
    586575 */ 
    587 ?> 
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile/DoCoMoDisplayMap.php

    r15532 r17140  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    1818 * @version    CVS: $Id$ 
     
    3030 * @package    Net_UserAgent_Mobile 
    3131 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    32  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     32 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    3333 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    34  * @version    Release: 0.30.0 
     34 * @version    Release: 0.31.0 
    3535 * @link       http://www.nttdocomo.co.jp/service/imode/make/content/spec/screen_area/index.html 
    3636 * @see        Net_UserAgent_Mobile_Display 
     
    823823                                                       'color'  => 1 
    824824                                                       ), 
    825                                     'N506ISII' => array( 
    826                                                         'width'  => 240, 
    827                                                         'height' => 295, 
    828                                                         'depth'  => 262144, 
    829                                                         'color'  => 1 
    830                                                         ), 
     825                                    'N506IS2' => array( 
     826                                                       'width'  => 240, 
     827                                                       'height' => 295, 
     828                                                       'depth'  => 262144, 
     829                                                       'color'  => 1 
     830                                                       ), 
    831831                                    'P506ICII' => array( 
    832832                                                        'width'  => 240, 
     
    11101110                                                      ), 
    11111111                                    'L600I' => array( 
    1112                                                      'width'  => 176, 
     1112                                                     'width'  => 170, 
    11131113                                                     'height' => 189, 
    11141114                                                     'depth'  => 65536, 
     
    11221122                                                     ), 
    11231123                                    'L601I' => array( 
    1124                                                      'width'  => 176, 
     1124                                                     'width'  => 170, 
    11251125                                                     'height' => 189, 
    11261126                                                     'depth'  => 65536, 
     
    11371137                                                      'height' => 267, 
    11381138                                                      'depth'  => 262144, 
     1139                                                      'color'  => 1 
     1140                                                      ), 
     1141                                    'L602I' => array( 
     1142                                                      'width'  => 170, 
     1143                                                      'height' => 189, 
     1144                                                      'depth'  => 65536, 
    11391145                                                      'color'  => 1 
    11401146                                                      ), 
     
    11501156                                    'D902I' => array( 
    11511157                                                     'width'  => 230, 
    1152                                                      'height' => 240, 
     1158                                                     'height' => 320, 
    11531159                                                     'depth'  => 262144, 
    11541160                                                     'color'  => 1 
     
    13341340                                                        'color'  => 1 
    13351341                                                        ), 
     1342                                    'F883I' => array( 
     1343                                                     'width'  => 240, 
     1344                                                     'height' => 256, 
     1345                                                     'depth'  => 65536, 
     1346                                                     'color'  => 1 
     1347                                                     ), 
     1348                                    'P704IMYU' => array( 
     1349                                                        'width'  => 240, 
     1350                                                        'height' => 270, 
     1351                                                        'depth'  => 262144, 
     1352                                                        'color'  => 1 
     1353                                                        ), 
     1354                                    'L704I' => array( 
     1355                                                     'width'  => 240, 
     1356                                                     'height' => 280, 
     1357                                                     'depth'  => 262144, 
     1358                                                     'color'  => 1 
     1359                                                     ), 
     1360                                    'L705I' => array( 
     1361                                                     'width'  => 240, 
     1362                                                     'height' => 280, 
     1363                                                     'depth'  => 262144, 
     1364                                                     'color'  => 1 
     1365                                                     ), 
    13361366 
    13371367                                    // i-mode compliant HTML 7.0 
     
    13741404                                                      ), 
    13751405                                    'D903ITV' => array( 
    1376                                                       'width'  => 230, 
    1377                                                       'height' => 320, 
    1378                                                       'depth'  => 262144, 
    1379                                                       'color'  => 1 
    1380                                                       ), 
     1406                                                       'width'  => 230, 
     1407                                                       'height' => 320, 
     1408                                                       'depth'  => 262144, 
     1409                                                       'color'  => 1 
     1410                                                       ), 
    13811411                                    'F903IX' => array( 
    13821412                                                      'width'  => 230, 
     
    13911421                                                       'color'  => 1 
    13921422                                                       ), 
     1423                                    'SH903ITV' => array( 
     1424                                                        'width'  => 240, 
     1425                                                        'height' => 320, 
     1426                                                        'depth'  => 262144, 
     1427                                                        'color'  => 1 
     1428                                                        ), 
     1429                                    'F903IBSC' => array( 
     1430                                                        'width'  => 230, 
     1431                                                        'height' => 240, 
     1432                                                        'depth'  => 262144, 
     1433                                                        'color'  => 1 
     1434                                                        ), 
     1435                                    'P903IX' => array( 
     1436                                                      'width'  => 240, 
     1437                                                      'height' => 270, 
     1438                                                      'depth'  => 262144, 
     1439                                                      'color'  => 1 
     1440                                                      ), 
     1441                                    'SO903ITV' => array( 
     1442                                                        'width'  => 240, 
     1443                                                        'height' => 368, 
     1444                                                        'depth'  => 262144, 
     1445                                                        'color'  => 1 
     1446                                                        ), 
    13931447                                    'N703ID' => array( 
    13941448                                                      'width'  => 240, 
     
    14381492                                                      'depth'  => 262144, 
    14391493                                                      'color'  => 1 
    1440                                                       ) 
     1494                                                      ), 
     1495                                    'P904I' => array( 
     1496                                                     'width'  => 240, 
     1497                                                     'height' => 350, 
     1498                                                     'depth'  => 262144, 
     1499                                                     'color'  => 1 
     1500                                                     ), 
     1501                                    'D904I' => array( 
     1502                                                     'width'  => 240, 
     1503                                                     'height' => 320, 
     1504                                                     'depth'  => 262144, 
     1505                                                     'color'  => 1 
     1506                                                     ), 
     1507                                    'F904I' => array( 
     1508                                                     'width'  => 240, 
     1509                                                     'height' => 352, 
     1510                                                     'depth'  => 262144, 
     1511                                                     'color'  => 1 
     1512                                                     ), 
     1513                                    'N904I' => array( 
     1514                                                     'width'  => 240, 
     1515                                                     'height' => 352, 
     1516                                                     'depth'  => 262144, 
     1517                                                     'color'  => 1 
     1518                                                     ), 
     1519                                    'SH904I' => array( 
     1520                                                      'width'  => 240, 
     1521                                                      'height' => 320, 
     1522                                                      'depth'  => 262144, 
     1523                                                      'color'  => 1 
     1524                                                      ), 
     1525                                    'P704I' => array( 
     1526                                                     'width'  => 240, 
     1527                                                     'height' => 270, 
     1528                                                     'depth'  => 262144, 
     1529                                                     'color'  => 1 
     1530                                                     ), 
     1531                                    'D704I' => array( 
     1532                                                     'width'  => 230, 
     1533                                                     'height' => 240, 
     1534                                                     'depth'  => 262144, 
     1535                                                     'color'  => 1 
     1536                                                     ), 
     1537                                    'SH704I' => array( 
     1538                                                      'width'  => 240, 
     1539                                                      'height' => 320, 
     1540                                                      'depth'  => 262144, 
     1541                                                      'color'  => 1 
     1542                                                      ), 
     1543                                    'N704IMYU' => array( 
     1544                                                        'width'  => 240, 
     1545                                                        'height' => 270, 
     1546                                                        'depth'  => 262144, 
     1547                                                        'color'  => 1 
     1548                                                        ), 
     1549                                    'F704I' => array( 
     1550                                                     'width'  => 230, 
     1551                                                     'height' => 240, 
     1552                                                     'depth'  => 262144, 
     1553                                                     'color'  => 1 
     1554                                                     ), 
     1555                                    'SO704I' => array( 
     1556                                                      'width'  => 240, 
     1557                                                      'height' => 368, 
     1558                                                      'depth'  => 262144, 
     1559                                                      'color'  => 1 
     1560                                                      ), 
     1561                                    'F883IES' => array( 
     1562                                                       'width'  => 240, 
     1563                                                       'height' => 256, 
     1564                                                       'depth'  => 65536, 
     1565                                                       'color'  => 1 
     1566                                                       ), 
     1567                                    'F801I' => array( 
     1568                                                     'width'  => 240, 
     1569                                                     'height' => 352, 
     1570                                                     'depth'  => 65536, 
     1571                                                     'color'  => 1 
     1572                                                     ), 
     1573                                    'F705I' => array( 
     1574                                                     'width'  => 240, 
     1575                                                     'height' => 352, 
     1576                                                     'depth'  => 262144, 
     1577                                                     'color'  => 1 
     1578                                                     ), 
     1579                                    'D705I' => array( 
     1580                                                     'width'  => 240, 
     1581                                                     'height' => 320, 
     1582                                                     'depth'  => 262144, 
     1583                                                     'color'  => 1 
     1584                                                     ), 
     1585                                    'D705IMYU' => array( 
     1586                                                        'width'  => 240, 
     1587                                                        'height' => 240, 
     1588                                                        'depth'  => 262144, 
     1589                                                        'color'  => 1 
     1590                                                        ), 
     1591  
     1592                                    // i-mode compliant HTML 7.1 
     1593                                    // (FOMA 905i etc.) 
     1594                                    'SH905I' => array( 
     1595                                                      'width'  => 240, 
     1596                                                      'height' => 320, 
     1597                                                      'depth'  => 16777216, 
     1598                                                      'color'  => 1 
     1599                                                      ), 
     1600                                    'D905I' => array( 
     1601                                                     'width'  => 240, 
     1602                                                     'height' => 352, 
     1603                                                     'depth'  => 262144, 
     1604                                                     'color'  => 1 
     1605                                                     ), 
     1606                                    'N905I' => array( 
     1607                                                     'width'  => 240, 
     1608                                                     'height' => 320, 
     1609                                                     'depth'  => 262144, 
     1610                                                     'color'  => 1 
     1611                                                     ), 
     1612                                    'P905I' => array( 
     1613                                                     'width'  => 240, 
     1614                                                     'height' => 350, 
     1615                                                     'depth'  => 262144, 
     1616                                                     'color'  => 1 
     1617                                                     ), 
     1618                                    'F905I' => array( 
     1619                                                     'width'  => 240, 
     1620                                                     'height' => 352, 
     1621                                                     'depth'  => 16777216, 
     1622                                                     'color'  => 1 
     1623                                                     ), 
     1624                                    'SO905I' => array( 
     1625                                                      'width'  => 240, 
     1626                                                      'height' => 368, 
     1627                                                      'depth'  => 16777216, 
     1628                                                      'color'  => 1 
     1629                                                      ), 
     1630                                    'N905IMYU' => array( 
     1631                                                        'width'  => 240, 
     1632                                                        'height' => 320, 
     1633                                                        'depth'  => 262144, 
     1634                                                        'color'  => 1 
     1635                                                        ), 
     1636                                    'N905IBIZ' => array( 
     1637                                                        'width'  => 240, 
     1638                                                        'height' => 320, 
     1639                                                        'depth'  => 262144, 
     1640                                                        'color'  => 1 
     1641                                                        ), 
     1642                                    'SH905ITV' => array( 
     1643                                                        'width'  => 240, 
     1644                                                        'height' => 320, 
     1645                                                        'depth'  => 16777216, 
     1646                                                        'color'  => 1 
     1647                                                        ), 
     1648                                    'P705I' => array( 
     1649                                                     'width'  => 240, 
     1650                                                     'height' => 350, 
     1651                                                     'depth'  => 262144, 
     1652                                                     'color'  => 1 
     1653                                                     ), 
     1654                                    'N705I' => array( 
     1655                                                     'width'  => 240, 
     1656                                                     'height' => 320, 
     1657                                                     'depth'  => 262144, 
     1658                                                     'color'  => 1 
     1659                                                     ) 
    14411660                                    ); 
    14421661            } 
     
    14691688 * End: 
    14701689 */ 
    1471 ?> 
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile/EZweb.php

    r15532 r17140  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    1818 * @version    CVS: $Id$ 
     
    2323 */ 
    2424 
    25 require_once(dirname(__FILE__) . '/Common.php'); 
    26 require_once(dirname(__FILE__) . '/Display.php'); 
     25require_once dirname(__FILE__) . '/Common.php'; 
     26require_once dirname(__FILE__) . '/Display.php'; 
    2727 
    2828// {{{ Net_UserAgent_Mobile_EZweb 
     
    5959 * @package    Net_UserAgent_Mobile 
    6060 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    61  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     61 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    6262 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    63  * @version    Release: 0.30.0 
     63 * @version    Release: 0.31.0 
    6464 * @link       http://www.au.kddi.com/ezfactory/tec/spec/4_4.html 
    6565 * @link       http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html 
     
    8383 
    8484    /** 
    85      * name of the model like 'P502i' 
    86      * @var string 
    87      */ 
    88     var $_model = ''; 
    89  
    90     /** 
    91      * device ID like 'TS21' 
    92      * @var string 
    93      */ 
    94     var $_deviceID = ''; 
    95  
    96     /** 
    9785     * server string like 'UP.Link/3.2.1.2' 
    9886     * @var string 
     
    141129    function isTUKa() 
    142130    { 
    143         $tuka = substr($this->_deviceID, 2, 1); 
     131        $tuka = substr($this->_rawModel, 2, 1); 
    144132        if ($this->isWAP2()) { 
    145133            if ($tuka == 'U') { 
     
    159147 
    160148    /** 
    161      * parse HTTP_USER_AGENT string 
    162      */ 
    163     function parse() 
    164     { 
    165         $agent = $this->getUserAgent(); 
    166  
    167         if (preg_match('/^KDDI-(.*)/', $agent, $matches)) { 
     149     * Parses HTTP_USER_AGENT string. 
     150     * 
     151     * @param string $userAgent User-Agent string 
     152     */ 
     153    function parse($userAgent) 
     154    { 
     155        if (preg_match('/^KDDI-(.*)/', $userAgent, $matches)) { 
    168156 
    169157            // KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 
    170158            $this->_xhtmlCompliant = true; 
    171             list($this->_deviceID, $browser, $opt, $this->_serverName) = 
     159            list($this->_rawModel, $browser, $opt, $this->_serverName) = 
    172160                explode(' ', $matches[1], 4); 
    173161            list($this->name, $version) = explode('/', $browser); 
     
    177165            // UP.Browser/3.01-HI01 UP.Link/3.4.5.2 
    178166            @list($browser, $this->_serverName, $comment) = 
    179                 explode(' ', $agent, 3); 
     167                explode(' ', $userAgent, 3); 
    180168            list($this->name, $software) = explode('/', $browser); 
    181             list($this->version, $this->_deviceID) = 
     169            list($this->version, $this->_rawModel) = 
    182170                explode('-', $software); 
    183171            if ($comment) { 
     
    186174            } 
    187175        } 
    188  
    189         $this->_model = $this->_deviceID; 
    190176    } 
    191177 
     
    203189    { 
    204190        @list($width, $height) = 
    205             explode(',', $this->getHeader('x-up-devcap-screenpixels')); 
     191            explode(',', $this->getHeader('X-UP-DEVCAP-SCREENPIXELS')); 
    206192        $screenDepth = 
    207             explode(',', $this->getHeader('x-up-devcap-screendepth')); 
     193            explode(',', $this->getHeader('X-UP-DEVCAP-SCREENDEPTH')); 
    208194        $depth = $screenDepth[0] ? pow(2, (integer)$screenDepth[0]) : 0; 
    209195        $color = 
    210             $this->getHeader('x-up-devcap-iscolor') === '1' ? true : false; 
     196            $this->getHeader('X-UP-DEVCAP-ISCOLOR') === '1' ? true : false; 
    211197        return new Net_UserAgent_Mobile_Display(array( 
    212198                                                      'width'  => $width, 
     
    219205 
    220206    // }}} 
    221     // {{{ getModel() 
    222  
    223     /** 
    224      * returns name of the model (device ID) like 'TS21' 
     207    // {{{ getDeviceID() 
     208 
     209    /** 
     210     * Returns the device ID of the user agent. 
    225211     * 
    226212     * @return string 
    227213     */ 
    228     function getModel() 
    229     { 
    230         return $this->_model; 
    231     } 
    232  
    233     // }}} 
    234     // {{{ getDeviceID() 
    235  
    236     /** 
    237      * returns device ID like 'TS21' 
     214    function getDeviceID() 
     215    { 
     216        return $this->_rawModel; 
     217    } 
     218 
     219    // }}} 
     220    // {{{ getServer() 
     221 
     222    /** 
     223     * returns server string like 'UP.Link/3.2.1.2' 
    238224     * 
    239225     * @return string 
    240226     */ 
    241     function getDeviceID() 
    242     { 
    243         return $this->_deviceID; 
    244     } 
    245  
    246     // }}} 
    247     // {{{ getServer() 
    248  
    249     /** 
    250      * returns server string like 'UP.Link/3.2.1.2' 
     227    function getServer() 
     228    { 
     229        return $this->_serverName; 
     230    } 
     231 
     232    // }}} 
     233    // {{{ getComment() 
     234 
     235    /** 
     236     * returns comment like 'Google WAP Proxy/1.0'. returns null if nothinng. 
     237     * 
     238     * @return boolean 
     239     */ 
     240    function getComment() 
     241    { 
     242        return $this->_comment; 
     243    } 
     244 
     245    // }}} 
     246    // {{{ isXHTMLCompliant() 
     247 
     248    /** 
     249     * returns whether it's XHTML compliant or not 
     250     * 
     251     * @return boolean 
     252     */ 
     253    function isXHTMLCompliant() 
     254    { 
     255        return $this->_xhtmlCompliant; 
     256    } 
     257 
     258    // }}} 
     259    // {{{ getCarrierShortName() 
     260 
     261    /** 
     262     * returns the short name of the carrier 
    251263     * 
    252264     * @return string 
    253265     */ 
    254     function getServer() 
    255     { 
    256         return $this->_serverName; 
    257     } 
    258  
    259     // }}} 
    260     // {{{ getComment() 
    261  
    262     /** 
    263      * returns comment like 'Google WAP Proxy/1.0'. returns null if nothinng. 
    264      * 
    265      * @return boolean 
    266      */ 
    267     function getComment() 
    268     { 
    269         return $this->_comment; 
    270     } 
    271  
    272     // }}} 
    273     // {{{ isXHTMLCompliant() 
    274  
    275     /** 
    276      * returns whether it's XHTML compliant or not 
    277      * 
    278      * @return boolean 
    279      */ 
    280     function isXHTMLCompliant() 
    281     { 
    282         return $this->_xhtmlCompliant; 
    283     } 
    284  
    285     // }}} 
    286     // {{{ getCarrierShortName() 
    287  
    288     /** 
    289      * returns the short name of the carrier 
     266    function getCarrierShortName() 
     267    { 
     268        return 'E'; 
     269    } 
     270 
     271    // }}} 
     272    // {{{ getCarrierLongName() 
     273 
     274    /** 
     275     * returns the long name of the carrier 
    290276     * 
    291277     * @return string 
    292278     */ 
    293     function getCarrierShortName() 
    294     { 
    295         return 'E'; 
    296     } 
    297  
    298     // }}} 
    299     // {{{ getCarrierLongName() 
    300  
    301     /** 
    302      * returns the long name of the carrier 
    303      * 
    304      * @return string 
    305      */ 
    306279    function getCarrierLongName() 
    307280    { 
     
    319292    function isWIN() 
    320293    { 
    321         return substr($this->_deviceID, 2, 1) == 3 ? true : false; 
     294        return substr($this->_rawModel, 2, 1) == 3 ? true : false; 
    322295    } 
    323296 
     
    345318 * End: 
    346319 */ 
    347 ?> 
  • branches/comu-ver2/data/module/Net/UserAgent/Mobile/NonMobile.php

    r15532 r17140  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    1818 * @version    CVS: $Id$ 
     
    2121 */ 
    2222 
    23 require_once(dirname(__FILE__) . '/Common.php'); 
    24 require_once(dirname(__FILE__) . '/Display.php'); 
     23require_once dirname(__FILE__) . '/Common.php'; 
     24require_once dirname(__FILE__) . '/Display.php'; 
    2525 
    2626// {{{ Net_UserAgent_Mobile_NonMobile 
     
    4444 * @package    Net_UserAgent_Mobile 
    4545 * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    46  * @copyright  2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net> 
     46 * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    4747 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    48  * @version    Release: 0.30.0 
     48 * @version    Release: 0.31.0 
    4949 * @see        Net_UserAgent_Mobile_Common 
    5050 * @since      Class available since Release 0.1.0 
     
    8888 
    8989    /** 
    90      * parse HTTP_USER_AGENT string 
     90     * Parses HTTP_USER_AGENT string. 
     91     * 
     92     * @param string $userAgent User-Agent string 
    9193     */ 
    92     function parse() 
     94    function parse($userAgent) 
    9395    { 
    94         @list($this->name, $this->version) = 
    95             explode('/', $this->getUserAgent()); 
     96        @list($this->name, $this->version) = explode('/', $userAgent); 
    9697    } 
    9798 
     
    109110    { 
    110111        return new Net_UserAgent_Mobile_Display(null); 
    111     } 
    112  
    113     // }}} 
    114     // {{{ getModel() 
    115  
    116     /** 
    117      * returns name of the model 
    118      * 
    119      * @return string 
    120      */ 
    121     function getModel() 
    122     { 
    123         return ''; 
    124     } 
    125  
    126     // }}} 
    127     // {{{ getDeviceID() 
    128  
    129     /** 
    130      * returns device ID 
    131      * 
    132      * @return string 
    133      */ 
    134     function getDeviceID() 
    135     { 
    136         return ''; 
    137112    } 
    138113 
     
    186161 * End: 
    187162 */ 
    188 ?> 
Note: See TracChangeset for help on using the changeset viewer.