Ignore:
Timestamp:
2010/03/11 10:35:11 (14 years ago)
Author:
kajiwara
Message:

正式版にナイトリービルド版をマージしてみるテスト

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tmp/version-2_5-test/data/module/Net/UserAgent/Mobile/SoftBank.php

    r17128 r18609  
    55 * PHP versions 4 and 5 
    66 * 
    7  * LICENSE: This source file is subject to version 3.0 of the PHP license 
    8  * that is available through the world-wide-web at the following URI: 
    9  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of 
    10  * the PHP License and are unable to obtain it through the web, please 
    11  * send a note to license@php.net so we can mail you a copy immediately. 
     7 * Copyright (c) 2003-2009 KUBO Atsuhiro <kubo@iteman.jp>, 
     8 * All rights reserved. 
     9 * 
     10 * Redistribution and use in source and binary forms, with or without 
     11 * modification, are permitted provided that the following conditions are met: 
     12 * 
     13 *     * Redistributions of source code must retain the above copyright 
     14 *       notice, this list of conditions and the following disclaimer. 
     15 *     * Redistributions in binary form must reproduce the above copyright 
     16 *       notice, this list of conditions and the following disclaimer in the 
     17 *       documentation and/or other materials provided with the distribution. 
     18 * 
     19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
     20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
     21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
     22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
     23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
     24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
     25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
     27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
     28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
     29 * POSSIBILITY OF SUCH DAMAGE. 
    1230 * 
    1331 * @category   Networking 
    1432 * @package    Net_UserAgent_Mobile 
    15  * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    16  * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    17  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
     33 * @author     KUBO Atsuhiro <kubo@iteman.jp> 
     34 * @copyright  2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 
     35 * @license    http://www.opensource.org/licenses/bsd-license.php  New BSD License 
    1836 * @version    CVS: $Id$ 
     37 * @link       http://creation.mb.softbank.jp/ 
    1938 * @since      File available since Release 0.20.0 
    2039 */ 
     
    2241require_once dirname(__FILE__) . '/Common.php'; 
    2342require_once dirname(__FILE__) . '/Display.php'; 
     43require_once dirname(__FILE__) . '/../Mobile.php'; 
    2444 
    2545// {{{ Net_UserAgent_Mobile_SoftBank 
     
    2848 * SoftBank implementation 
    2949 * 
    30  * Net_UserAgent_Mobile_SoftBank is a subclass of 
    31  * {@link Net_UserAgent_Mobile_Common}, which implements SoftBank user agents. 
     50 * Net_UserAgent_Mobile_SoftBank is a subclass of {@link Net_UserAgent_Mobile_Common}, 
     51 * which implements SoftBank user agents. 
    3252 * 
    3353 * SYNOPSIS: 
     
    5979 * @category   Networking 
    6080 * @package    Net_UserAgent_Mobile 
    61  * @author     KUBO Atsuhiro <iteman@users.sourceforge.net> 
    62  * @copyright  2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 
    63  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    64  * @version    Release: 0.31.0 
    65  * @link       http://developers.vodafone.jp/dp/tool_dl/web/useragent.php 
    66  * @link       http://developers.vodafone.jp/dp/tool_dl/web/position.php 
    67  * @see        Net_UserAgent_Mobile_Common 
     81 * @author     KUBO Atsuhiro <kubo@iteman.jp> 
     82 * @copyright  2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 
     83 * @license    http://www.opensource.org/licenses/bsd-license.php  New BSD License 
     84 * @version    Release: 1.0.0 
     85 * @link       http://creation.mb.softbank.jp/ 
    6886 * @since      Class available since Release 0.20.0 
    6987 */ 
     
    93111     * @var string 
    94112     */ 
    95     var $_serialNumber = null; 
     113    var $_serialNumber; 
    96114 
    97115    /** 
     
    105123     * @var string 
    106124     */ 
    107     var $_vendorVersion = null; 
     125    var $_vendorVersion; 
    108126 
    109127    /** 
     
    164182     * 
    165183     * @param string $userAgent User-Agent string 
    166      * @return mixed void, or a PEAR error object on error 
     184     * @throws Net_UserAgent_Mobile_Error 
    167185     */ 
    168186    function parse($userAgent) 
     
    208226     * create a new {@link Net_UserAgent_Mobile_Display} class instance 
    209227     * 
    210      * @return object a newly created {@link Net_UserAgent_Mobile_Display} 
    211      *     object 
    212      * @see Net_UserAgent_Mobile_Display 
     228     * @return Net_UserAgent_Mobile_Display 
    213229     */ 
    214230    function makeDisplay()  
    215231    { 
    216         @list($width, $height) = 
    217             explode('*', $this->getHeader('X-JPHONE-DISPLAY')); 
     232        @list($width, $height) = explode('*', $this->getHeader('X-JPHONE-DISPLAY')); 
    218233        $color = false; 
    219234        $depth = 0; 
     
    223238            $depth = $matches[2]; 
    224239        } 
    225         return new Net_UserAgent_Mobile_Display(array( 
    226                                                       'width'  => $width, 
     240 
     241        return new Net_UserAgent_Mobile_Display(array('width'  => $width, 
    227242                                                      'height' => $height, 
    228243                                                      'depth'  => $depth, 
     
    248263 
    249264    /** 
    250      * return terminal unique serial number. returns null if user forbids to 
    251      * send his/her serial number. 
     265     * return terminal unique serial number. returns null if user forbids to send 
     266     * his/her serial number. 
    252267     * 
    253268     * @return string 
     
    419434    } 
    420435 
     436    // }}} 
     437    // {{{ getUID() 
     438 
     439    /** 
     440     * Gets the UID of a subscriber. 
     441     * 
     442     * @return string 
     443     * @since Method available since Release 1.0.0RC1 
     444     */ 
     445    function getUID() 
     446    { 
     447        if (array_key_exists('HTTP_X_JPHONE_UID', $_SERVER)) { 
     448            return $_SERVER['HTTP_X_JPHONE_UID']; 
     449        } 
     450    } 
     451 
    421452    /**#@-*/ 
    422453 
     
    432463     * 
    433464     * @param array $agent parts of the User-Agent string 
    434      * @return mixed void, or a PEAR error object on error 
    435      */ 
    436     function _parseVodafone(&$agent) 
    437     { 
    438         $count = count($agent); 
     465     * @throws Net_UserAgent_Mobile_Error 
     466     */ 
     467    function _parseVodafone($agent) 
     468    { 
    439469        $this->_packetCompliant = true; 
    440470 
     
    448478                return $this->noMatch(); 
    449479            } 
     480 
    450481            $this->_serialNumber = $matches[1]; 
    451482        } 
     
    458489        $this->_vendorVersion = $matches[2]; 
    459490 
    460         for ($i = 2; $i < $count; ++$i) { 
    461             list($key, $value) = explode('/', $agent[$i]); 
     491        for ($i = 2, $count = count($agent); $i < $count; ++$i) { 
     492            @list($key, $value) = explode('/', $agent[$i]); 
    462493            $this->_javaInfo[$key] = $value; 
    463494        } 
     
    471502     * 
    472503     * @param array $agent parts of the User-Agent string 
    473      * @return mixed void, or a PEAR error object on error 
    474      */ 
    475     function _parseJphone(&$agent) 
     504     * @throws Net_UserAgent_Mobile_Error 
     505     */ 
     506    function _parseJphone($agent) 
    476507    { 
    477508        $count = count($agent); 
     
    482513            // J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0 
    483514            $this->_packetCompliant = true; 
    484             @list($this->name, $this->version, $this->_rawModel, 
    485                   $serialNumber) = explode('/', $agent[0]); 
     515            @list($this->name, $this->version, $this->_rawModel, $serialNumber) = 
     516                explode('/', $agent[0]); 
    486517            if ($serialNumber) { 
    487518                if (!preg_match('!^SN(.+)!', $serialNumber, $matches)) { 
    488519                    return $this->noMatch(); 
    489520                } 
     521 
    490522                $this->_serialNumber = $matches[1]; 
    491523            } 
    492524 
    493             list($this->_vendor, $this->_vendorVersion) = 
    494                 explode('/', $agent[1]); 
     525            @list($this->_vendor, $this->_vendorVersion) = explode('/', $agent[1]); 
    495526            for ($i = 2; $i < $count; ++$i) { 
    496                 list($key, $value) = explode('/', $agent[$i]); 
     527                @list($key, $value) = explode('/', $agent[$i]); 
    497528                $this->_javaInfo[$key] = $value; 
    498529            } 
     
    500531 
    501532            // J-PHONE/2.0/J-DN02 
    502             @list($this->name, $this->version, $this->_rawModel, 
    503                   $serialNumber) = explode('/', $agent[0]); 
     533            @list($this->name, $this->version, $this->_rawModel, $serialNumber) = 
     534                explode('/', $agent[0]); 
    504535            if ($serialNumber) { 
    505536                if (!preg_match('!^SN(.+)!', $serialNumber, $matches)) { 
    506537                    return $this->noMatch(); 
    507538                } 
     539 
    508540                $this->_serialNumber = $matches[1]; 
    509541            } 
     
    526558     * 
    527559     * @param array $agent parts of the User-Agent string 
    528      * @return mixed void, or a PEAR error object on error 
    529      */ 
    530     function _parseMotorola(&$agent) 
    531     { 
    532         $count = count($agent); 
     560     */ 
     561    function _parseMotorola($agent) 
     562    { 
    533563        $this->_packetCompliant = true; 
    534564        $this->_vendor = 'MOT'; 
    535565 
    536566        // MOT-V980/80.2F.2E. MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 
    537         list($this->_rawModel, $this->_vendorVersion) = explode('/', $agent[0]); 
     567        @list($this->_rawModel, $this->_vendorVersion) = explode('/', $agent[0]); 
    538568        $this->_model = substr(strrchr($this->_rawModel, '-'), 1); 
    539569 
    540         for ($i = 2; $i < $count; ++$i) { 
    541             list($key, $value) = explode('/', $agent[$i]); 
     570        for ($i = 2, $count = count($agent); $i < $count; ++$i) { 
     571            @list($key, $value) = explode('/', $agent[$i]); 
    542572            $this->_javaInfo[$key] = $value; 
    543573        } 
Note: See TracChangeset for help on using the changeset viewer.