Changeset 18188 for branches/comu-ver2/data/module/Net/UserAgent
- Timestamp:
- 2009/07/13 21:29:58 (15 years ago)
- Location:
- branches/comu-ver2/data/module/Net/UserAgent
- Files:
-
- 3 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/module/Net/UserAgent/Mobile.php
r17140 r18188 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 * @since File available since Release 0.1 … … 21 39 22 40 require_once dirname(__FILE__) . '/../../PEAR.php'; 23 24 // {{{ constants 25 26 /** 27 * Constants for error handling. 28 */ 29 define('NET_USERAGENT_MOBILE_OK', 1); 30 define('NET_USERAGENT_MOBILE_ERROR', -1); 31 define('NET_USERAGENT_MOBILE_ERROR_NOMATCH', -2); 32 define('NET_USERAGENT_MOBILE_ERROR_NOT_FOUND', -3); 33 34 // }}} 41 require_once dirname(__FILE__) . '/Mobile/Error.php'; 42 35 43 // {{{ GLOBALS 36 44 … … 38 46 * globals for fallback on no match 39 47 * 40 * @global boolean $GLOBALS[' _NET_USERAGENT_MOBILE_FALLBACK_ON_NOMATCH']48 * @global boolean $GLOBALS['NET_USERAGENT_MOBILE_FallbackOnNomatch'] 41 49 */ 42 $GLOBALS[' _NET_USERAGENT_MOBILE_FALLBACK_ON_NOMATCH'] = false;50 $GLOBALS['NET_USERAGENT_MOBILE_FallbackOnNomatch'] = false; 43 51 44 52 // }}} … … 48 56 * HTTP mobile user agent string parser 49 57 * 50 * Net_UserAgent_Mobile parses HTTP_USER_AGENT strings of (mainly Japanese) 51 * mobile HTTP user agents. It'll be useful in page dispatching by user 52 * agents. 58 * Net_UserAgent_Mobile parses HTTP_USER_AGENT strings of (mainly Japanese) mobile 59 * HTTP user agents. It'll be useful in page dispatching by user agents. 53 60 * This package was ported from Perl's HTTP::MobileAgent. 54 61 * See {@link http://search.cpan.org/search?mode=module&query=HTTP-MobileAgent} 55 * The author of the HTTP::MobileAgent module is Tatsuhiko Miyagawa56 * <miyagawa@bulknews.net>57 62 * 58 63 * SYNOPSIS: … … 68 73 * // it's NTT DoCoMo i-mode 69 74 * // see what's available in Net_UserAgent_Mobile_DoCoMo 70 * } elseif ($agent->is Vodafone()) {71 * // it's Vodafone(J-PHONE)72 * // see what's available in Net_UserAgent_Mobile_ Vodafone75 * } elseif ($agent->isSoftBank()) { 76 * // it's SoftBank 77 * // see what's available in Net_UserAgent_Mobile_SoftBank 73 78 * } elseif ($agent->isEZweb()) { 74 79 * // it's KDDI/EZWeb … … 87 92 * @category Networking 88 93 * @package Net_UserAgent_Mobile 89 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>90 * @copyright 2003-200 8 KUBO Atsuhiro <iteman@users.sourceforge.net>91 * @license http://www. php.net/license/3_0.txt PHP License 3.092 * @version Release: 0.31.094 * @author KUBO Atsuhiro <kubo@iteman.jp> 95 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 96 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 97 * @version Release: 1.0.0 93 98 * @since Class available since Release 0.1 94 99 */ … … 126 131 * 127 132 * @param string $userAgent User-Agent string 128 * @return mixed a newly created Net_UserAgent_Mobile object, or a PEAR 129 * error object on error 133 * @return Net_UserAgent_Mobile_Common a newly created or an existing 134 * Net_UserAgent_Mobile_Common object 135 * @throws Net_UserAgent_Mobile_Error 130 136 */ 131 137 function &factory($userAgent = null) 132 138 { 133 139 if (is_null($userAgent)) { 134 $userAgent = $_SERVER['HTTP_USER_AGENT'];140 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 135 141 } 136 142 … … 151 157 152 158 if (!class_exists($class)) { 153 154 159 $file = dirname(__FILE__) . "/Mobile/{$driver}.php"; 155 160 if (!include_once $file) { … … 163 168 } 164 169 165 $instance = &new $class($userAgent); 166 $error = &$instance->isError(); 170 PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); 171 $instance = new $class($userAgent); 172 PEAR::staticPopErrorHandling(); 173 $error = &$instance->getError(); 167 174 if (Net_UserAgent_Mobile::isError($error)) { 168 if ($GLOBALS[' _NET_USERAGENT_MOBILE_FALLBACK_ON_NOMATCH']175 if ($GLOBALS['NET_USERAGENT_MOBILE_FallbackOnNomatch'] 169 176 && $error->getCode() == NET_USERAGENT_MOBILE_ERROR_NOMATCH 170 177 ) { … … 173 180 } 174 181 175 $instance = &$error;182 return PEAR::raiseError($error); 176 183 } 177 184 … … 183 190 184 191 /** 185 * creates a new {@link Net_UserAgent_Mobile_Common} subclass instance or 186 * returnsa instance from existent ones192 * creates a new {@link Net_UserAgent_Mobile_Common} subclass instance or returns 193 * a instance from existent ones 187 194 * 188 195 * @param string $userAgent User-Agent string 189 * @return mixed a newly created or a existent Net_UserAgent_Mobile190 * object, or a PEAR error object on error191 * @ see Net_UserAgent_Mobile::factory()196 * @return Net_UserAgent_Mobile_Common a newly created or an existing 197 * Net_UserAgent_Mobile_Common object 198 * @throws Net_UserAgent_Mobile_Error 192 199 */ 193 200 function &singleton($userAgent = null) … … 200 207 201 208 if (is_null($userAgent)) { 202 $userAgent = $_SERVER['HTTP_USER_AGENT'];209 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 203 210 } 204 211 … … 214 221 215 222 /** 216 * tell whether a result code from a Net_UserAgent_Mobile method 217 * is an error 223 * tell whether a result code from a Net_UserAgent_Mobile method is an error 218 224 * 219 225 * @param integer $value result code … … 222 228 function isError($value) 223 229 { 224 return is_a($value, 'Net_UserAgent_Mobile_Error'); 230 return is_object($value) 231 && (strtolower(get_class($value)) == strtolower('Net_UserAgent_Mobile_Error') 232 || is_subclass_of($value, 'Net_UserAgent_Mobile_Error')); 225 233 } 226 234 … … 232 240 * 233 241 * @param integer $value error code 234 * @return string error message, or false if the error code was not 235 * recognized 242 * @return string error message, or null if the error code was not recognized 236 243 */ 237 244 function errorMessage($value) … … 260 267 261 268 /** 262 * Checks whether or not the user agent is mobile by a given user agent 263 * string. 269 * Checks whether or not the user agent is mobile by a given user agent string. 264 270 * 265 271 * @param string $userAgent … … 286 292 287 293 /** 288 * Checks whether or not the user agent is DoCoMo by a given user agent 289 * string. 294 * Checks whether or not the user agent is DoCoMo by a given user agent string. 290 295 * 291 296 * @param string $userAgent … … 296 301 { 297 302 if (is_null($userAgent)) { 298 $userAgent = $_SERVER['HTTP_USER_AGENT'];303 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 299 304 } 300 305 … … 310 315 311 316 /** 312 * Checks whether or not the user agent is EZweb by a given user agent 313 * string. 317 * Checks whether or not the user agent is EZweb by a given user agent string. 314 318 * 315 319 * @param string $userAgent … … 320 324 { 321 325 if (is_null($userAgent)) { 322 $userAgent = $_SERVER['HTTP_USER_AGENT'];326 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 323 327 } 324 328 … … 336 340 337 341 /** 338 * Checks whether or not the user agent is SoftBank by a given user agent 339 * string. 342 * Checks whether or not the user agent is SoftBank by a given user agent string. 340 343 * 341 344 * @param string $userAgent … … 346 349 { 347 350 if (is_null($userAgent)) { 348 $userAgent = $_SERVER['HTTP_USER_AGENT'];351 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 349 352 } 350 353 … … 374 377 375 378 /** 376 * Checks whether or not the user agent is Willcom by a given user agent 377 * string. 379 * Checks whether or not the user agent is Willcom by a given user agent string. 378 380 * 379 381 * @param string $userAgent … … 384 386 { 385 387 if (is_null($userAgent)) { 386 $userAgent = $_SERVER['HTTP_USER_AGENT'];388 $userAgent = @$_SERVER['HTTP_USER_AGENT']; 387 389 } 388 390 … … 392 394 393 395 return false; 394 }395 396 /**#@-*/397 398 /**#@+399 * @access private400 */401 402 /**#@-*/403 404 // }}}405 }406 407 // }}}408 // {{{ Net_UserAgent_Mobile_Error409 410 /**411 * Net_UserAgent_Mobile_Error implements a class for reporting user412 * agent error messages413 *414 * @category Networking415 * @package Net_UserAgent_Mobile416 * @author KUBO Atsuhiro <iteman@users.sourceforge.net>417 * @copyright 2003-2007 KUBO Atsuhiro <iteman@users.sourceforge.net>418 * @license http://www.php.net/license/3_0.txt PHP License 3.0419 * @version Release: 0.31.0420 * @since Class available since Release 0.1421 */422 class Net_UserAgent_Mobile_Error extends PEAR_Error423 {424 425 // {{{ properties426 427 /**#@+428 * @access public429 */430 431 /**#@-*/432 433 /**#@+434 * @access private435 */436 437 /**#@-*/438 439 /**#@+440 * @access public441 */442 443 // }}}444 // {{{ constructor445 446 /**447 * constructor448 *449 * @param mixed $code Net_UserAgent_Mobile error code, or string450 * with error message.451 * @param integer $mode what 'error mode' to operate in452 * @param integer $level what error level to use for $mode and453 * PEAR_ERROR_TRIGGER454 * @param mixed $userinfo additional user/debug info455 * @access public456 */457 function Net_UserAgent_Mobile_Error($code = NET_USERAGENT_MOBILE_ERROR,458 $mode = PEAR_ERROR_RETURN,459 $level = E_USER_NOTICE,460 $userinfo = null461 )462 {463 if (is_int($code)) {464 $this->PEAR_Error('Net_UserAgent_Mobile Error: ' .465 Net_UserAgent_Mobile::errorMessage($code),466 $code, $mode, $level, $userinfo467 );468 } else {469 $this->PEAR_Error("Net_UserAgent_Mobile Error: $code",470 NET_USERAGENT_MOBILE_ERROR, $mode, $level,471 $userinfo472 );473 }474 396 } 475 397 -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/Common.php
r17140 r18188 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 * @since File available since Release 0.1 20 38 */ 21 39 22 require_once dirname(__FILE__) . '/../Mobile.php'; 40 require_once dirname(__FILE__) . '/Error.php'; 41 require_once dirname(__FILE__) . '/../../../PEAR.php'; 23 42 24 43 // {{{ Net_UserAgent_Mobile_Common … … 32 51 * @category Networking 33 52 * @package Net_UserAgent_Mobile 34 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>35 * @copyright 2003-200 8 KUBO Atsuhiro <iteman@users.sourceforge.net>36 * @license http://www. php.net/license/3_0.txt PHP License 3.037 * @version Release: 0.31.053 * @author KUBO Atsuhiro <kubo@iteman.jp> 54 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 55 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 56 * @version Release: 1.0.0 38 57 * @since Class available since Release 0.1 39 58 */ 40 class Net_UserAgent_Mobile_Common extends PEAR59 class Net_UserAgent_Mobile_Common 41 60 { 42 61 … … 72 91 73 92 /** 74 * {@link Net_UserAgent_Mobile_Error} object for error handling in the 75 * constructor 93 * {@link Net_UserAgent_Mobile_Error} object for error handling in the constructor 76 94 * @var object 77 95 **/ … … 117 135 function Net_UserAgent_Mobile_Common($userAgent) 118 136 { 119 parent::PEAR('Net_UserAgent_Mobile_Error');137 $this->_userAgent = $userAgent; 120 138 121 139 $result = $this->parse($userAgent); 122 if ( Net_UserAgent_Mobile::isError($result)) {123 $this-> isError($result);140 if (PEAR::isError($result)) { 141 $this->_error = &$result; 124 142 } 125 126 $this->_userAgent = $userAgent; 127 } 128 129 // }}} 130 // {{{ isError 131 132 /** 133 * Returns/set an error when the instance couldn't initialize properly 134 * 135 * @param object {@link Net_UserAgent_Mobile_Error} object when setting 136 * an error 137 * @return object {@link Net_UserAgent_Mobile_Error} object 138 */ 139 function &isError($error = null) 140 { 141 if ($error !== null) { 142 $this->_error = &$error; 143 } 144 145 // }}} 146 // {{{ getError 147 148 /** 149 * Gets a Net_UserAgent_Mobile_Error object. 150 * 151 * @param object {@link Net_UserAgent_Mobile_Error} object when setting an error 152 * @return Net_UserAgent_Mobile_Error 153 * @since Method available since Release 1.0.0RC2 154 */ 155 function &getError() 156 { 157 if (is_null($this->_error)) { 158 $return = null; 159 return $return; 143 160 } 144 161 … … 147 164 148 165 // }}} 149 // {{{ raiseError()150 151 /**152 * This method is used to communicate an error and invoke error153 * callbacks etc. Basically a wrapper for PEAR::raiseError without154 * the message string.155 *156 * @param mixed $code integer error code, or a PEAR error object (all157 * other parameters are ignored if this parameter is an object158 * @param int $mode error mode, see PEAR_Error docs159 * @param mixed $options If error mode is PEAR_ERROR_TRIGGER, this is the160 * error level (E_USER_NOTICE etc). If error mode is161 * PEAR_ERROR_CALLBACK, this is the callback function, either as a162 * function name, or as an array of an object and method name. For163 * other error modes this parameter is ignored.164 * @param string $userinfo Extra debug information. Defaults to the last165 * query and native error code.166 * @return object a PEAR error object167 * @see PEAR_Error168 */169 function &raiseError($code = NET_USERAGENT_MOBILE_ERROR, $mode = null,170 $options = null, $userinfo = null171 )172 {173 174 // The error is yet a Net_UserAgent_Mobile error object175 if (is_object($code)) {176 $error = &PEAR::raiseError($code, null, null, null, null, null,177 true178 );179 return $error;180 }181 182 $error = &PEAR::raiseError(null, $code, $mode, $options, $userinfo,183 'Net_UserAgent_Mobile_Error', true184 );185 return $error;186 }187 188 // }}}189 166 // {{{ getUserAgent() 190 167 … … 232 209 * returns {@link Net_UserAgent_Mobile_Disply} object 233 210 * 234 * @return object a {@link Net_UserAgent_Mobile_Display} object, or a 235 * PEAR error object on error 236 * @see Net_UserAgent_Mobile_Display 211 * @return Net_UserAgent_Mobile_Display 237 212 */ 238 213 function getDisplay() 239 214 { 240 if ( !is_object($this->_display)) {215 if (is_null($this->_display)) { 241 216 $this->_display = $this->makeDisplay(); 242 217 } 218 243 219 return $this->_display; 244 220 } … … 263 239 * generates a warning message for new variants 264 240 * 265 * @ return object a PEAR error object241 * @throws Net_UserAgent_Mobile_Error 266 242 */ 267 243 function noMatch() 268 244 { 269 return $this->raiseError(NET_USERAGENT_MOBILE_ERROR_NOMATCH, null, 270 null, $this->getUserAgent() . 271 ': might be new variants. Please contact the author of Net_UserAgent_Mobile!' 272 ); 245 return PEAR::raiseError($this->getUserAgent() . ': might be new variants. Please contact the author of Net_UserAgent_Mobile!', 246 NET_USERAGENT_MOBILE_ERROR_NOMATCH, 247 null, 248 null, 249 null, 250 'Net_UserAgent_Mobile_Error' 251 ); 273 252 } 274 253 … … 291 270 * implemented in subclasses) 292 271 * 272 * @return Net_UserAgent_Mobile_Display 293 273 * @abstract 294 274 */ 295 function makeDisplay() 296 { 297 die(); 298 } 275 function makeDisplay() {} 299 276 300 277 // }}} … … 500 477 return $this->_rawModel; 501 478 } 479 480 // }}} 481 // {{{ getUID() 482 483 /** 484 * Gets the UID of a subscriber. 485 * 486 * @return string 487 * @since Method available since Release 1.0.0RC1 488 */ 489 function getUID() {} 502 490 503 491 /**#@-*/ -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/Display.php
r17140 r18188 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 7 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 * @since File available since Release 0.1 … … 49 67 * 50 68 * USING EXTERNAL MAP FILE: 51 * If the environment variable DOCOMO_MAP exists, the specified XML data will 52 * be usedfor DoCoMo display information.69 * If the environment variable DOCOMO_MAP exists, the specified XML data will be used 70 * for DoCoMo display information. 53 71 * 54 72 * ex) Please add the following code. … … 57 75 * @category Networking 58 76 * @package Net_UserAgent_Mobile 59 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>60 * @copyright 2003-200 7 KUBO Atsuhiro <iteman@users.sourceforge.net>61 * @license http://www. php.net/license/3_0.txt PHP License 3.062 * @version Release: 0.31.077 * @author KUBO Atsuhiro <kubo@iteman.jp> 78 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 79 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 80 * @version Release: 1.0.0 63 81 * @since Class available since Release 0.1 64 82 */ -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/DoCoMo.php
r17140 r18188 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.nttdocomo.co.jp/service/imode/make/content/spec/useragent/index.html 20 * @ see Net_UserAgent_Mobile_Common38 * @link http://www.nttdocomo.co.jp/service/imode/make/content/browser/browser2/useragent/index.html 21 39 * @since File available since Release 0.1 22 40 */ … … 24 42 require_once dirname(__FILE__) . '/Common.php'; 25 43 require_once dirname(__FILE__) . '/Display.php'; 26 require_once dirname(__FILE__) . '/ DoCoMoDisplayMap.php';44 require_once dirname(__FILE__) . '/../Mobile.php'; 27 45 28 46 // {{{ Net_UserAgent_Mobile_DoCoMo … … 31 49 * NTT DoCoMo implementation 32 50 * 33 * Net_UserAgent_Mobile_DoCoMo is a subclass of 34 * {@link Net_UserAgent_Mobile_Common}, which implements NTT docomo i-mode 35 * user agents. 51 * Net_UserAgent_Mobile_DoCoMo is a subclass of {@link Net_UserAgent_Mobile_Common}, 52 * which implements NTT docomo i-mode user agents. 36 53 * 37 54 * SYNOPSIS: … … 74 91 * @category Networking 75 92 * @package Net_UserAgent_Mobile 76 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>77 * @copyright 2003-200 8 KUBO Atsuhiro <iteman@users.sourceforge.net>78 * @license http://www. php.net/license/3_0.txt PHP License 3.079 * @version Release: 0.31.093 * @author KUBO Atsuhiro <kubo@iteman.jp> 94 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 95 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 96 * @version Release: 1.0.0 80 97 * @link http://www.nttdocomo.co.jp/service/imode/make/content/spec/useragent/index.html 81 * @ see Net_UserAgent_Mobile_Common98 * @link http://www.nttdocomo.co.jp/service/imode/make/content/browser/browser2/useragent/index.html 82 99 * @since Class available since Release 0.1 83 100 */ … … 145 162 var $_displayBytes; 146 163 164 /** 165 * The model names which have GPS capability. 166 * 167 * @var array 168 * @since Property available since Release 1.0.0RC1 169 */ 170 var $_gpsModels = array('F884i', 171 'F801i', 172 'F905iBiz', 173 'SO905iCS', 174 'N905iBiz', 175 'N905imyu', 176 'SO905i', 177 'F905i', 178 'P905i', 179 'N905i', 180 'D905i', 181 'SH905i', 182 'P904i', 183 'D904i', 184 'F904i', 185 'N904i', 186 'SH904i', 187 'F883iESS', 188 'F883iES', 189 'F903iBSC', 190 'SO903i', 191 'F903i', 192 'D903i', 193 'N903i', 194 'P903i', 195 'SH903i', 196 'SA800i', 197 'SA702i', 198 'SA700iS', 199 'F505iGPS', 200 'F661i', 201 'F884iES', 202 'N906iL', 203 'P906i', 204 'SO906i', 205 'SH906i', 206 'N906imyu', 207 'F906i', 208 'N906i', 209 'F01A', 210 'F03A', 211 'F06A', 212 'F05A', 213 'P01A', 214 'P02A', 215 'SH01A', 216 'SH02A', 217 'SH03A', 218 'SH04A', 219 'N01A', 220 'N02A', 221 'P07A3', 222 'N06A3', 223 'N08A3', 224 'P08A3', 225 'P09A3', 226 'N09A3', 227 'F09A3', 228 'SH05A3', 229 'SH06A3', 230 'SH07A3' 231 ); 232 233 /** 234 * The HTML versions which maps models to HTML versions. 235 * 236 * @var array 237 * @since Property available since Release 1.0.0RC1 238 */ 239 var $_htmlVersions = array( 240 'D501i' => '1.0', 241 'F501i' => '1.0', 242 'N501i' => '1.0', 243 'P501i' => '1.0', 244 'D502i' => '2.0', 245 'F502i' => '2.0', 246 'N502i' => '2.0', 247 'P502i' => '2.0', 248 'NM502i' => '2.0', 249 'SO502i' => '2.0', 250 'F502it' => '2.0', 251 'N502it' => '2.0', 252 'SO502iWM' => '2.0', 253 'SH821i' => '2.0', 254 'N821i' => '2.0', 255 'P821i' => '2.0', 256 'D209i' => '2.0', 257 'ER209i' => '2.0', 258 'F209i' => '2.0', 259 'KO209i' => '2.0', 260 'N209i' => '2.0', 261 'P209i' => '2.0', 262 'P209iS' => '2.0', 263 'R209i' => '2.0', 264 'P651ps' => '2.0', 265 'R691i' => '2.0', 266 'F210i' => '2.0', 267 'N210i' => '2.0', 268 'P210i' => '2.0', 269 'KO210i' => '2.0', 270 'F671i' => '2.0', 271 'D210i' => '3.0', 272 'SO210i' => '3.0', 273 'F503i' => '3.0', 274 'F503iS' => '3.0', 275 'P503i' => '3.0', 276 'P503iS' => '3.0', 277 'N503i' => '3.0', 278 'N503iS' => '3.0', 279 'SO503i' => '3.0', 280 'SO503iS' => '3.0', 281 'D503i' => '3.0', 282 'D503iS' => '3.0', 283 'F211i' => '3.0', 284 'D211i' => '3.0', 285 'N211i' => '3.0', 286 'N211iS' => '3.0', 287 'P211i' => '3.0', 288 'P211iS' => '3.0', 289 'SO211i' => '3.0', 290 'R211i' => '3.0', 291 'SH251i' => '3.0', 292 'SH251iS' => '3.0', 293 'R692i' => '3.0', 294 'N2001' => '3.0', 295 'N2002' => '3.0', 296 'P2002' => '3.0', 297 'D2101V' => '3.0', 298 'P2101V' => '3.0', 299 'SH2101V' => '3.0', 300 'T2101V' => '3.0', 301 'D504i' => '4.0', 302 'F504i' => '4.0', 303 'F504iS' => '4.0', 304 'N504i' => '4.0', 305 'N504iS' => '4.0', 306 'SO504i' => '4.0', 307 'P504i' => '4.0', 308 'P504iS' => '4.0', 309 'D251i' => '4.0', 310 'D251iS' => '4.0', 311 'F251i' => '4.0', 312 'N251i' => '4.0', 313 'N251iS' => '4.0', 314 'P251iS' => '4.0', 315 'F671iS' => '4.0', 316 'F212i' => '4.0', 317 'SO212i' => '4.0', 318 'F661i' => '4.0', 319 'F672i' => '4.0', 320 'SO213i' => '4.0', 321 'SO213iS' => '4.0', 322 'SO213iWR' => '4.0', 323 'F2051' => '4.0', 324 'N2051' => '4.0', 325 'P2102V' => '4.0', 326 'F2102V' => '4.0', 327 'N2102V' => '4.0', 328 'N2701' => '4.0', 329 'NM850iG' => '4.0', 330 'NM705i' => '4.0', 331 'NM706i' => '4.0', 332 'D505i' => '5.0', 333 'SO505i' => '5.0', 334 'SH505i' => '5.0', 335 'N505i' => '5.0', 336 'F505i' => '5.0', 337 'P505i' => '5.0', 338 'D505iS' => '5.0', 339 'P505iS' => '5.0', 340 'N505iS' => '5.0', 341 'SO505iS' => '5.0', 342 'SH505iS' => '5.0', 343 'F505iGPS' => '5.0', 344 'D252i' => '5.0', 345 'SH252i' => '5.0', 346 'P252i' => '5.0', 347 'N252i' => '5.0', 348 'P252iS' => '5.0', 349 'D506i' => '5.0', 350 'F506i' => '5.0', 351 'N506i' => '5.0', 352 'P506iC' => '5.0', 353 'SH506iC' => '5.0', 354 'SO506iC' => '5.0', 355 'N506iS' => '5.0', 356 'SO506i' => '5.0', 357 'SO506iS' => '5.0', 358 'N506iS2' => '5.0', 359 'D253i' => '5.0', 360 'N253i' => '5.0', 361 'P253i' => '5.0', 362 'D253iWM' => '5.0', 363 'P253iS' => '5.0', 364 'P213i' => '5.0', 365 'F900i' => '5.0', 366 'N900i' => '5.0', 367 'P900i' => '5.0', 368 'SH900i' => '5.0', 369 'F900iT' => '5.0', 370 'P900iV' => '5.0', 371 'N900iS' => '5.0', 372 'D900i' => '5.0', 373 'F900iC' => '5.0', 374 'N900iL' => '5.0', 375 'N900iG' => '5.0', 376 'F880iES' => '5.0', 377 'SH901iC' => '5.0', 378 'F901iC' => '5.0', 379 'N901iC' => '5.0', 380 'D901i' => '5.0', 381 'P901i' => '5.0', 382 'SH901iS' => '5.0', 383 'F901iS' => '5.0', 384 'D901iS' => '5.0', 385 'P901iS' => '5.0', 386 'N901iS' => '5.0', 387 'P901iTV' => '5.0', 388 'F700i' => '5.0', 389 'SH700i' => '5.0', 390 'N700i' => '5.0', 391 'P700i' => '5.0', 392 'F700iS' => '5.0', 393 'SH700iS' => '5.0', 394 'SA700iS' => '5.0', 395 'SH851i' => '5.0', 396 'P851i' => '5.0', 397 'F881iES' => '5.0', 398 'D701i' => '5.0', 399 'N701i' => '5.0', 400 'P701iD' => '5.0', 401 'D701iWM' => '5.0', 402 'N701iECO' => '5.0', 403 'SA800i' => '5.0', 404 'L600i' => '5.0', 405 'N600i' => '5.0', 406 'L601i' => '5.0', 407 'M702iS' => '5.0', 408 'M702iG' => '5.0', 409 'L602i' => '5.0', 410 'F902i' => '6.0', 411 'D902i' => '6.0', 412 'N902i' => '6.0', 413 'P902i' => '6.0', 414 'SH902i' => '6.0', 415 'SO902i' => '6.0', 416 'SH902iS' => '6.0', 417 'P902iS' => '6.0', 418 'N902iS' => '6.0', 419 'D902iS' => '6.0', 420 'F902iS' => '6.0', 421 'SO902iWP+' => '6.0', 422 'SH902iSL' => '6.0', 423 'N902iX' => '6.0', 424 'N902iL' => '6.0', 425 'P702i' => '6.0', 426 'N702iD' => '6.0', 427 'F702iD' => '6.0', 428 'SH702iD' => '6.0', 429 'D702i' => '6.0', 430 'SO702i' => '6.0', 431 'D702iBCL' => '6.0', 432 'SA702i' => '6.0', 433 'SH702iS' => '6.0', 434 'N702iS' => '6.0', 435 'P702iD' => '6.0', 436 'D702iF' => '6.0', 437 'D851iWM' => '6.0', 438 'F882iES' => '6.0', 439 'N601i' => '6.0', 440 'D800iDS' => '6.0', 441 'P703imyu' => '6.0', 442 'F883i' => '6.0', 443 'F883iS' => '6.0', 444 'P704imyu' => '6.0', 445 'L704i' => '6.0', 446 'L705i' => '6.0', 447 'L705iX' => '6.0', 448 'L852i' => '6.0', 449 'L706ie' => '6.0', 450 'L01A' => '6.0', 451 'L03A' => '6.0', 452 'SH903i' => '7.0', 453 'P903i' => '7.0', 454 'N903i' => '7.0', 455 'D903i' => '7.0', 456 'F903i' => '7.0', 457 'SO903i' => '7.0', 458 'D903iTV' => '7.0', 459 'F903iX' => '7.0', 460 'P903iTV' => '7.0', 461 'SH903iTV' => '7.0', 462 'F903iBSC' => '7.0', 463 'P903iX' => '7.0', 464 'SO903iTV' => '7.0', 465 'N703iD' => '7.0', 466 'F703i' => '7.0', 467 'P703i' => '7.0', 468 'D703i' => '7.0', 469 'SH703i' => '7.0', 470 'N703imyu' => '7.0', 471 'SO703i' => '7.0', 472 'SH904i' => '7.0', 473 'N904i' => '7.0', 474 'F904i' => '7.0', 475 'D904i' => '7.0', 476 'P904i' => '7.0', 477 'SO704i' => '7.0', 478 'F704i' => '7.0', 479 'N704imyu' => '7.0', 480 'SH704i' => '7.0', 481 'D704i' => '7.0', 482 'P704i' => '7.0', 483 'F883iES' => '7.0', 484 'F883iESS' => '7.0', 485 'F801i' => '7.0', 486 'F705i' => '7.0', 487 'D705i' => '7.0', 488 'D705imyu' => '7.0', 489 'SH705i' => '7.0', 490 'SH705i2' => '7.0', 491 'SH706ie' => '7.0', 492 'F05A' => '7.0', 493 'SH905i' => '7.1', 494 'D905i' => '7.1', 495 'N905i' => '7.1', 496 'P905i' => '7.1', 497 'F905i' => '7.1', 498 'SO905i' => '7.1', 499 'N905imyu' => '7.1', 500 'N905iBiz' => '7.1', 501 'SH905iTV' => '7.1', 502 'SO905iCS' => '7.1', 503 'F905iBiz' => '7.1', 504 'P905iTV' => '7.1', 505 'P705i' => '7.1', 506 'N705i' => '7.1', 507 'N705imyu' => '7.1', 508 'P705imyu' => '7.1', 509 'SO705i' => '7.1', 510 'P705iCL' => '7.1', 511 'F884i' => '7.1', 512 'F884iES' => '7.1', 513 'N906iL' => '7.1', 514 'N706i' => '7.1', 515 'SO706i' => '7.1', 516 'P706imyu' => '7.1', 517 'N706ie' => '7.1', 518 'N706i2' => '7.1', 519 'N03A' => '7.1', 520 'N05A' => '7.1', 521 'F07A' => '7.1', 522 'P906i' => '7.2', 523 'SO906i' => '7.2', 524 'SH906i' => '7.2', 525 'N906imyu' => '7.2', 526 'F906i' => '7.2', 527 'N906i' => '7.2', 528 'SH906iTV' => '7.2', 529 'F706i' => '7.2', 530 'SH706i' => '7.2', 531 'P706ie' => '7.2', 532 'SH706iw' => '7.2', 533 'F01A' => '7.2', 534 'F02A' => '7.2', 535 'F03A' => '7.2', 536 'F04A' => '7.2', 537 'F06A' => '7.2', 538 'P01A' => '7.2', 539 'P02A' => '7.2', 540 'P03A' => '7.2', 541 'P04A' => '7.2', 542 'P05A' => '7.2', 543 'P06A' => '7.2', 544 'SH01A' => '7.2', 545 'SH02A' => '7.2', 546 'SH03A' => '7.2', 547 'SH04A' => '7.2', 548 'N01A' => '7.2', 549 'N02A' => '7.2', 550 'N04A' => '7.2', 551 'P10A' => '7.2', 552 ); 553 147 554 /**#@-*/ 148 555 … … 171 578 * 172 579 * @param string $userAgent User-Agent string 173 * @ return mixed void, or a PEAR error object on error580 * @throws Net_UserAgent_Mobile_Error 174 581 */ 175 582 function parse($userAgent) … … 188 595 // DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789) 189 596 $this->_isFOMA = true; 190 list($this->name, $this->version) = explode('/', $main);597 @list($this->name, $this->version) = explode('/', $main); 191 598 $result = $this->_parseFOMA($foma_or_comment); 192 599 } else { … … 207 614 * create a new {@link Net_UserAgent_Mobile_Display} class instance 208 615 * 209 * @return object a newly created {@link Net_UserAgent_Mobile_Display} 210 * object 211 * @see Net_UserAgent_Mobile_Display 212 * @see Net_UserAgent_Mobile_DoCoMoDisplayMap::get() 616 * @return Net_UserAgent_Mobile_Display 213 617 */ 214 618 function makeDisplay() 215 619 { 216 $display = Net_UserAgent_Mobile_DoCoMoDisplayMap::get($this->getModel()); 620 include_once dirname(__FILE__) . '/DoCoMo/ScreenInfo.php'; 621 622 $screenInfo = &Net_UserAgent_Mobile_DoCoMo_ScreenInfo::singleton(); 623 $display = $screenInfo->get($this->getModel()); 217 624 if (!is_null($this->_displayBytes)) { 218 list($widthBytes, $heightBytes) = 219 explode('*', $this->_displayBytes); 625 @list($widthBytes, $heightBytes) = explode('*', $this->_displayBytes); 220 626 $display['width_bytes'] = $widthBytes; 221 627 $display['height_bytes'] = $heightBytes; 222 628 } 629 223 630 return new Net_UserAgent_Mobile_Display($display); 224 631 } … … 228 635 229 636 /** 230 * returns supported HTML version like '3.0'. retuns null if unknown.637 * Gets the HTML version like '3.0'. Returns null if unknown. 231 638 * 232 639 * @return string … … 234 641 function getHTMLVersion() 235 642 { 236 static $htmlVersionMap; 237 if (!isset($htmlVersionMap)) { 238 $htmlVersionMap = array( 239 '[DFNP]501i' => '1.0', 240 '502i|821i|209i|651|691i|(F|N|P|KO)210i|^F671i$' => '2.0', 241 '(D210i|SO210i)|503i|211i|SH251i|692i|200[12]|2101V' => '3.0', 242 '504i|251i|^F671iS$|212i|2051|2102V|661i|2701|672i|SO213i|850i' => '4.0', 243 'eggy|P751v' => '3.2', 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' 248 ); 249 } 250 251 foreach ($htmlVersionMap as $key => $value) { 252 if (preg_match("/$key/", $this->_rawModel)) { 253 return $value; 254 } 255 } 256 return null; 643 return @$this->_htmlVersions[ $this->getModel() ]; 257 644 } 258 645 … … 271 658 } 272 659 273 static $defaultCacheSize; 274 if (!isset($defaultCacheSize)) { 275 $defaultCacheSize = 5; 276 } 277 return $defaultCacheSize; 660 return 5; 278 661 } 279 662 … … 288 671 function getSeries() 289 672 { 290 if ( $this->isFOMA() &&preg_match('/(\d{4})/', $this->_rawModel)) {673 if (preg_match('/(\d{4})/', $this->_rawModel)) { 291 674 return 'FOMA'; 292 675 } … … 299 682 return '651'; 300 683 } 301 302 return null;303 684 } 304 685 … … 316 697 return $matches[1]; 317 698 } 318 319 return null;320 699 } 321 700 … … 412 791 413 792 /** 793 * Returns whether a user agent is a GPS model or not. 794 * 414 795 * @return boolean 415 796 */ 416 797 function isGPS() 417 798 { 418 static $gpsModels; 419 if (!isset($gpsModels)) { 420 $gpsModels = array('F661i', 'F505iGPS'); 421 } 422 return in_array($this->_rawModel, $gpsModels); 799 return in_array($this->_rawModel, $this->_gpsModels); 423 800 } 424 801 … … 447 824 { 448 825 return 'DoCoMo'; 826 } 827 828 // }}} 829 // {{{ getUID() 830 831 /** 832 * Gets the UID of a subscriber. 833 * 834 * @return string 835 * @since Method available since Release 1.0.0RC1 836 */ 837 function getUID() 838 { 839 if (array_key_exists('HTTP_X_DCMGUID', $_SERVER)) { 840 return $_SERVER['HTTP_X_DCMGUID']; 841 } 842 } 843 844 // }}} 845 // {{{ getBrowserVersion() 846 847 /** 848 * Gets the i-mode browser version. 849 * 850 * @return string 851 * @since Method available since Release 1.0.0RC3 852 */ 853 function getBrowserVersion() 854 { 855 return $this->getCacheSize() == 500 ? '2.0' : '1.0'; 449 856 } 450 857 … … 462 869 * 463 870 * @param string $main main part of HTTP_USER_AGENT string 464 * @ return mixed void, or a PEAR error object on error871 * @throws Net_UserAgent_Mobile_Error 465 872 */ 466 873 function _parseMain($main) … … 509 916 * 510 917 * @param string $foma main part of HTTP_USER_AGENT string 511 * @ return mixed void, or a PEAR error object on error918 * @throws Net_UserAgent_Mobile_Error 512 919 */ 513 920 function _parseFOMA($foma) … … 522 929 } 523 930 524 if (preg_match('/^[^(\s]+\s?\(( .*?)\)$/', $foma, $matches)) {931 if (preg_match('/^[^(\s]+\s?\(([^)]+)\)(?:\(([^)]+)\))?$/', $foma, $matches)) { 525 932 if (preg_match('/^compatible/', $matches[1])) { // The user-agent is DoCoMo compatible. 526 933 $this->_comment = $matches[1]; 527 934 return; 935 } 936 937 if (count($matches) == 3) { 938 if (preg_match('/^compatible/', $matches[2])) { // The user-agent is DoCoMo compatible. 939 $this->_comment = $matches[2]; 940 } 528 941 } 529 942 … … 538 951 continue; 539 952 } 540 if (preg_match('/^( T[CDBJ])$/', $value, $matches)) {953 if (preg_match('/^([A-Z]+)$/', $value, $matches)) { 541 954 $this->_status = $matches[1]; 542 955 continue; -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/EZweb.php
r17140 r18188 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 -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/NonMobile.php
r17140 r18188 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 * @see Net_UserAgent_Mobile_Common20 37 * @since File available since Release 0.1.0 21 38 */ … … 30 47 * 31 48 * Net_UserAgent_Mobile_NonMobile is a subclass of 32 * {@link Net_UserAgent_Mobile_Common}, which implements non-mobile or 33 * u nimplemented user agents.49 * {@link Net_UserAgent_Mobile_Common}, which implements non-mobile or unimplemented 50 * user agents. 34 51 * 35 52 * SYNOPSIS: … … 43 60 * @category Networking 44 61 * @package Net_UserAgent_Mobile 45 * @author KUBO Atsuhiro <iteman@users.sourceforge.net> 46 * @copyright 2003-2008 KUBO Atsuhiro <iteman@users.sourceforge.net> 47 * @license http://www.php.net/license/3_0.txt PHP License 3.0 48 * @version Release: 0.31.0 49 * @see Net_UserAgent_Mobile_Common 62 * @author KUBO Atsuhiro <kubo@iteman.jp> 63 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 64 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 65 * @version Release: 1.0.0 50 66 * @since Class available since Release 0.1.0 51 67 */ … … 103 119 * create a new {@link Net_UserAgent_Mobile_Display} class instance 104 120 * 105 * @return object a newly created {@link Net_UserAgent_Mobile_Display} 106 * object 107 * @see Net_UserAgent_Mobile_Display 121 * @return Net_UserAgent_Mobile_Display 108 122 */ 109 123 function makeDisplay() -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/SoftBank.php
r17140 r18188 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$ 37 * @link http://creation.mb.softbank.jp/ 19 38 * @since File available since Release 0.20.0 20 39 */ … … 22 41 require_once dirname(__FILE__) . '/Common.php'; 23 42 require_once dirname(__FILE__) . '/Display.php'; 43 require_once dirname(__FILE__) . '/../Mobile.php'; 24 44 25 45 // {{{ Net_UserAgent_Mobile_SoftBank … … 28 48 * SoftBank implementation 29 49 * 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. 32 52 * 33 53 * SYNOPSIS: … … 59 79 * @category Networking 60 80 * @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/ 68 86 * @since Class available since Release 0.20.0 69 87 */ … … 93 111 * @var string 94 112 */ 95 var $_serialNumber = null;113 var $_serialNumber; 96 114 97 115 /** … … 105 123 * @var string 106 124 */ 107 var $_vendorVersion = null;125 var $_vendorVersion; 108 126 109 127 /** … … 164 182 * 165 183 * @param string $userAgent User-Agent string 166 * @ return mixed void, or a PEAR error object on error184 * @throws Net_UserAgent_Mobile_Error 167 185 */ 168 186 function parse($userAgent) … … 208 226 * create a new {@link Net_UserAgent_Mobile_Display} class instance 209 227 * 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 213 229 */ 214 230 function makeDisplay() 215 231 { 216 @list($width, $height) = 217 explode('*', $this->getHeader('X-JPHONE-DISPLAY')); 232 @list($width, $height) = explode('*', $this->getHeader('X-JPHONE-DISPLAY')); 218 233 $color = false; 219 234 $depth = 0; … … 223 238 $depth = $matches[2]; 224 239 } 225 return new Net_UserAgent_Mobile_Display(array( 226 240 241 return new Net_UserAgent_Mobile_Display(array('width' => $width, 227 242 'height' => $height, 228 243 'depth' => $depth, … … 248 263 249 264 /** 250 * return terminal unique serial number. returns null if user forbids to 251 * sendhis/her serial number.265 * return terminal unique serial number. returns null if user forbids to send 266 * his/her serial number. 252 267 * 253 268 * @return string … … 419 434 } 420 435 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 421 452 /**#@-*/ 422 453 … … 432 463 * 433 464 * @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 { 439 469 $this->_packetCompliant = true; 440 470 … … 448 478 return $this->noMatch(); 449 479 } 480 450 481 $this->_serialNumber = $matches[1]; 451 482 } … … 458 489 $this->_vendorVersion = $matches[2]; 459 490 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]); 462 493 $this->_javaInfo[$key] = $value; 463 494 } … … 471 502 * 472 503 * @param array $agent parts of the User-Agent string 473 * @ return mixed void, or a PEAR error object on error474 */ 475 function _parseJphone( &$agent)504 * @throws Net_UserAgent_Mobile_Error 505 */ 506 function _parseJphone($agent) 476 507 { 477 508 $count = count($agent); … … 482 513 // J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0 483 514 $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]); 486 517 if ($serialNumber) { 487 518 if (!preg_match('!^SN(.+)!', $serialNumber, $matches)) { 488 519 return $this->noMatch(); 489 520 } 521 490 522 $this->_serialNumber = $matches[1]; 491 523 } 492 524 493 list($this->_vendor, $this->_vendorVersion) = 494 explode('/', $agent[1]); 525 @list($this->_vendor, $this->_vendorVersion) = explode('/', $agent[1]); 495 526 for ($i = 2; $i < $count; ++$i) { 496 list($key, $value) = explode('/', $agent[$i]);527 @list($key, $value) = explode('/', $agent[$i]); 497 528 $this->_javaInfo[$key] = $value; 498 529 } … … 500 531 501 532 // 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]); 504 535 if ($serialNumber) { 505 536 if (!preg_match('!^SN(.+)!', $serialNumber, $matches)) { 506 537 return $this->noMatch(); 507 538 } 539 508 540 $this->_serialNumber = $matches[1]; 509 541 } … … 526 558 * 527 559 * @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 { 533 563 $this->_packetCompliant = true; 534 564 $this->_vendor = 'MOT'; 535 565 536 566 // 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]); 538 568 $this->_model = substr(strrchr($this->_rawModel, '-'), 1); 539 569 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]); 542 572 $this->_javaInfo[$key] = $value; 543 573 } -
branches/comu-ver2/data/module/Net/UserAgent/Mobile/Willcom.php
r17140 r18188 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.willcom-inc.com/ja/service/contents_service/club_air_edge/for_phone/homepage/index.html … … 29 47 * AirH"PHONE implementation 30 48 * 31 * Net_UserAgent_Mobile_Willcom is a subclass of 32 * {@link Net_UserAgent_Mobile_Common}, which implements Willcom's user 33 * agents. 49 * Net_UserAgent_Mobile_Willcom is a subclass of {@link Net_UserAgent_Mobile_Common}, 50 * which implements Willcom's user agents. 34 51 * 35 52 * SYNOPSIS: … … 51 68 * @category Networking 52 69 * @package Net_UserAgent_Mobile 53 * @author KUBO Atsuhiro < iteman@users.sourceforge.net>54 * @copyright 2003-200 8 KUBO Atsuhiro <iteman@users.sourceforge.net>55 * @license http://www. php.net/license/3_0.txt PHP License 3.056 * @version Release: 0.31.070 * @author KUBO Atsuhiro <kubo@iteman.jp> 71 * @copyright 2003-2009 KUBO Atsuhiro <kubo@iteman.jp> 72 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License 73 * @version Release: 1.0.0 57 74 * @link http://www.willcom-inc.com/ja/service/contents_service/club_air_edge/for_phone/homepage/index.html 58 * @see Net_UserAgent_Mobile_Common59 75 * @since Class available since Release 0.5 60 76 */ … … 154 170 * create a new {@link Net_UserAgent_Mobile_Display} class instance 155 171 * 156 * @return object a newly created {@link Net_UserAgent_Mobile_Display} 157 * object 158 * @see Net_UserAgent_Mobile_Display 172 * @return Net_UserAgent_Mobile_Display 159 173 */ 160 174 function makeDisplay()
Note: See TracChangeset
for help on using the changeset viewer.