- Timestamp:
- 2010/03/11 10:35:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/module/Net/UserAgent/Mobile/EZweb.php
r18562 r18609 5 5 * PHP versions 4 and 5 6 6 * 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. 12 30 * 13 31 * @category Networking 14 32 * @package Net_UserAgent_Mobile 15 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>16 * @copyright 2003-200 8 KUBO Atsuhiro <iteman@users.sourceforge.net>17 * @license http://www. php.net/license/3_0.txt PHP License 3.033 * @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 18 36 * @version CVS: $Id$ 19 37 * @link http://www.au.kddi.com/ezfactory/tec/spec/4_4.html 20 38 * @link http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html 21 * @see Net_UserAgent_Mobile_Common22 39 * @since File available since Release 0.1.0 23 40 */ … … 31 48 * EZweb implementation 32 49 * 33 * Net_UserAgent_Mobile_EZweb is a subclass of 34 * {@link Net_UserAgent_Mobile_Common}, which implements EZweb (WAP1.0/2.0) 35 * user agents. 50 * Net_UserAgent_Mobile_EZweb is a subclass of {@link Net_UserAgent_Mobile_Common}, 51 * which implements EZweb (WAP1.0/2.0) user agents. 36 52 * 37 53 * SYNOPSIS: … … 58 74 * @category Networking 59 75 * @package Net_UserAgent_Mobile 60 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>61 * @copyright 2003-200 8 KUBO Atsuhiro <iteman@users.sourceforge.net>62 * @license http://www. php.net/license/3_0.txt PHP License 3.063 * @version Release: 0.31.076 * @author KUBO Atsuhiro <kubo@iteman.jp> 77 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 78 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 79 * @version Release: 1.0.0 64 80 * @link http://www.au.kddi.com/ezfactory/tec/spec/4_4.html 65 81 * @link http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html 66 * @see Net_UserAgent_Mobile_Common67 82 * @since Class available since Release 0.1.0 68 83 */ … … 157 172 // KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 158 173 $this->_xhtmlCompliant = true; 159 list($this->_rawModel, $browser, $opt, $this->_serverName) =174 @list($this->_rawModel, $browser, $opt, $this->_serverName) = 160 175 explode(' ', $matches[1], 4); 161 list($this->name, $version) = explode('/', $browser);176 @list($this->name, $version) = explode('/', $browser); 162 177 $this->version = "$version $opt"; 163 178 } else { … … 166 181 @list($browser, $this->_serverName, $comment) = 167 182 explode(' ', $userAgent, 3); 168 list($this->name, $software) = explode('/', $browser); 169 list($this->version, $this->_rawModel) = 170 explode('-', $software); 183 @list($this->name, $software) = explode('/', $browser); 184 @list($this->version, $this->_rawModel) = explode('-', $software); 171 185 if ($comment) { 172 $this->_comment = 173 preg_replace('/^\((.*)\)$/', '$1', $comment); 186 $this->_comment = preg_replace('/^\((.*)\)$/', '$1', $comment); 174 187 } 175 188 } … … 182 195 * create a new {@link Net_UserAgent_Mobile_Display} class instance 183 196 * 184 * @return object a newly created {@link Net_UserAgent_Mobile_Display} 185 * object 186 * @see Net_UserAgent_Mobile_Display 197 * @return Net_UserAgent_Mobile_Display 187 198 */ 188 199 function makeDisplay() … … 190 201 @list($width, $height) = 191 202 explode(',', $this->getHeader('X-UP-DEVCAP-SCREENPIXELS')); 192 $screenDepth = 193 explode(',', $this->getHeader('X-UP-DEVCAP-SCREENDEPTH')); 203 $screenDepth = explode(',', $this->getHeader('X-UP-DEVCAP-SCREENDEPTH')); 194 204 $depth = $screenDepth[0] ? pow(2, (integer)$screenDepth[0]) : 0; 195 $color = 196 $this->getHeader('X-UP-DEVCAP-ISCOLOR') === '1' ? true : false; 197 return new Net_UserAgent_Mobile_Display(array( 198 'width' => $width, 205 $color = $this->getHeader('X-UP-DEVCAP-ISCOLOR') === '1' ? true : false; 206 return new Net_UserAgent_Mobile_Display(array('width' => $width, 199 207 'height' => $height, 200 208 'color' => $color, 201 'depth' => $depth 202 ) 209 'depth' => $depth) 203 210 ); 204 211 } … … 293 300 { 294 301 return substr($this->_rawModel, 2, 1) == 3 ? true : false; 302 } 303 304 // }}} 305 // {{{ getUID() 306 307 /** 308 * Gets the UID of a subscriber. 309 * 310 * @return string 311 * @since Method available since Release 1.0.0RC1 312 */ 313 function getUID() 314 { 315 if (array_key_exists('HTTP_X_UP_SUBNO', $_SERVER)) { 316 return $_SERVER['HTTP_X_UP_SUBNO']; 317 } 295 318 } 296 319
Note: See TracChangeset
for help on using the changeset viewer.