Ignore:
Timestamp:
2008/03/12 16:43:11 (18 years ago)
Author:
satou
Message:

PEARモジュールの更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2/data/module/Net/UserAgent/Mobile/EZweb.php

    r15532 r17127  
    1414 * @package    Net_UserAgent_Mobile 
    1515 * @author     KUBO Atsuhiro <[email protected]> 
    16  * @copyright  2003-2007 KUBO Atsuhiro <[email protected]> 
     16 * @copyright  2003-2008 KUBO Atsuhiro <[email protected]> 
    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 'Net/UserAgent/Mobile/Common.php'; 
     26require_once 'Net/UserAgent/Mobile/Display.php'; 
    2727 
    2828// {{{ Net_UserAgent_Mobile_EZweb 
     
    5959 * @package    Net_UserAgent_Mobile 
    6060 * @author     KUBO Atsuhiro <[email protected]> 
    61  * @copyright  2003-2007 KUBO Atsuhiro <[email protected]> 
     61 * @copyright  2003-2008 KUBO Atsuhiro <[email protected]> 
    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 ?> 
Note: See TracChangeset for help on using the changeset viewer.