cvs: pear /Net_UserAgent_Mobile Mobile.php package.xml /Net_UserAgent_Mobile/Mobile Common.php Display.php DoCoMo.php DoCoMoDisplayMap.php EZweb.php
JPhone.php NonMobile.php Request.php /Net_UserAgent_Mobile/tests .cvsignore 00-compile.phpt 01-request.phpt 02-docomo.phpt 03-jphone.phpt
04-ezweb.phpt 05-display.phpt 06-nonmobile.phpt

From: Date: Wed, 19 Feb 2003 16:28:42 +0000
Subject: cvs: pear /Net_UserAgent_Mobile Mobile.php package.xml /Net_UserAgent_Mobile/Mobile Common.php Display.php DoCoMo.php DoCoMoDisplayMap.php EZweb.php
JPhone.php NonMobile.php Request.php /Net_UserAgent_Mobile/tests .cvsignore 00-compile.phpt 01-request.phpt 02-docomo.phpt 03-jphone.phpt
04-ezweb.phpt 05-display.phpt 06-nonmobile.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8958@lists.php.net to get a copy of this message
kuboa Wed Feb 19 11:28:42 2003 EDT Added files: /pear/Net_UserAgent_Mobile Mobile.php package.xml /pear/Net_UserAgent_Mobile/Mobile Common.php Display.php DoCoMo.php DoCoMoDisplayMap.php EZweb.php JPhone.php NonMobile.php Request.php /pear/Net_UserAgent_Mobile/tests .cvsignore 00-compile.phpt 01-request.phpt 02-docomo.phpt 03-jphone.phpt 04-ezweb.phpt 05-display.phpt 06-nonmobile.phpt Log: Initial commit

Index: pear/Net_UserAgent_Mobile/Mobile.php +++ pear/Net_UserAgent_Mobile/Mobile.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: Mobile.php,v 1.1 2003/02/19 16:28:41 kuboa Exp $ // // SYNOPSIS: // require_once('Net/UserAgent/Mobile.php'); // // $agent = &Net_UserAgent_Mobile::factory($agent_string); // // or $agent = &Net_UserAgent_Mobile::factory(); to get from $_SERVER // // if ($agent->isDoCoMo()) { // // or if ($agent->getName() === 'DoCoMo') // // or if (get_class($agent) === 'http_mobileagent_docomo') // // it's NTT DoCoMo i-mode // // see what's available in Net_UserAgent_Mobile_DoCoMo // } elseif ($agent->isJPhone()) { // // it's J-PHONE J-Sky // // see what's available in Net_UserAgent_Mobile_JPhone // } elseif ($agent->isEZweb()) { // // it's KDDI/EZWeb // // see what's available in Net_UserAgent_Mobile_EZweb // } else { // // may be PC // // $agent is Net_UserAgent_Mobile_NonMobile // } // // $display = $agent->getDisplay(); // Net_UserAgent_Mobile_Display // if ($display->isColor()) { // ... // } // require_once('PEAR.php'); require_once('Net/UserAgent/Mobile/Request.php'); // package dependent error codes /** * @const NET_USERAGENT_MOBILE_ERROR_NOMATCH */ define('NET_USERAGENT_MOBILE_ERROR_NOMATCH', -1); // no match /** * HTTP mobile user agent string parser * * Net_UserAgent_Mobile parses HTTP_USER_AGENT strings of (mainly Japanese) * mobile HTTP user agents. It'll be useful in page dispatching by user * agents. * This package was ported from Perl's HTTP::MobileAgent. * See http://search.cpan.org/search?mode=module&query=HTTP-MobileAgent * The author of the HTTP::MobileAgent module is Tatsuhiko Miyagawa * <miyagawa@bulknews.net> * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public */ class Net_UserAgent_Mobile { // }}} // {{{ factory() /** * create a new Net_UserAgent_Mobile_Common concrete class instance * * parses HTTP headers and constructs Net_UserAgent_Mobile_Common * subclass instance. * If no argument is supplied, $_SERVER{'HTTP_*'} is used. * * @param mixed $stuff User-Agent string or object that works with HTTP * Request (not implemented) * @return object Net_UserAgent_Mobile_Common subclass instance * @access public * @static * @see Net_UserAgent_Mobile_Request::factory() * @see PEAR::getStaticProperty() */ function &factory($stuff = NULL) { $mobile_regex = &PEAR::getStaticProperty('Net_UserAgent_Mobile', 'mobile_regex' ); if ($mobile_regex === NULL) { $docomo_regex = '^DoCoMo/\d\.\d[ /]'; $jphone_regex = '^J-PHONE/\d\.\d'; $ezweb_regex = '^(?:KDDI-[A-Z]+\d+ )?UP\.Browser\/'; $mobile_regex = "(?:($docomo_regex)|($jphone_regex)|($ezweb_regex))"; } $request = &Net_UserAgent_Mobile_Request::factory($stuff); // parse UA string $ua = $request->get('User-Agent'); $sub = 'NonMobile'; if (preg_match("!$mobile_regex!", $ua, $matches)) { $sub = @$matches[1] ? 'DoCoMo' : (@$matches[2] ? 'JPhone' : 'EZweb'); } $classname = "Net_UserAgent_Mobile_{$sub}"; @include_once("Net/UserAgent/Mobile/{$sub}.php"); @$instance = &new $classname($request); return $instance; } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/package.xml +++ pear/Net_UserAgent_Mobile/package.xml <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE package SYSTEM "../package.dtd"> <package version="1.0"> <name>Net_UserAgent_Mobile</name> <summary>HTTP mobile user agent string parser</summary> <description> Net_UserAgent_Mobile parses HTTP_USER_AGENT strings of (mainly Japanese) mobile HTTP user agents. It'll be useful in page dispatching by user agents. This package was ported from Perl's HTTP::MobileAgent. See http://search.cpan.org/search?mode=module&amp;query=HTTP-MobileAgent The author of the HTTP::MobileAgent module is Tatsuhiko Miyagawa &lt;miyagawa@bulknews.net&gt; </description> <license>PHP License</license> <maintainers> <maintainer> <user>kuboa</user> <role>lead</role> <name>KUBO Atsuhiro</name> <email>kubo@isite.co.jp</email> </maintainer> </maintainers> <release> <version>0.1</version> <state>beta</state> <date>2003-02-19</date> <notes> - initial release </notes> <filelist> <dir name="/" baseinstalldir="Net/UserAgent"> <file role="php">Mobile.php</file> <dir name="Mobile"> <file role="php">Common.php</file> <file role="php">Display.php</file> <file role="php">DoCoMo.php</file> <file role="php">DoCoMoDisplayMap.php</file> <file role="php">EZweb.php</file> <file role="php">JPhone.php</file> <file role="php">NonMobile.php</file> <file role="php">Request.php</file> </dir> </dir> <dir name="tests"> <file role="test">00-compile.phpt</file> <file role="test">01-request.phpt</file> <file role="test">02-docomo.phpt</file> <file role="test">03-jphone.phpt</file> <file role="test">04-ezweb.phpt</file> <file role="test">05-display.phpt</file> <file role="test">06-nonmobile.phpt</file> </dir> </filelist> </release> </package> Index: pear/Net_UserAgent_Mobile/Mobile/Common.php +++ pear/Net_UserAgent_Mobile/Mobile/Common.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: Common.php,v 1.1 2003/02/19 16:28:41 kuboa Exp $ // /** * Base class that is extended by each user agents implementor * * Net_UserAgent_Mobile_Common is a class for mobile user agent * abstraction layer on Net_UserAgent_Mobile. * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public */ class Net_UserAgent_Mobile_Common { // {{{ properties /** * User-Agent name like 'DoCoMo' * @var string * @access public */ var $name = ''; /** * User-Agent version number like '1.0' * @var string * @access public */ var $version = ''; /** * Net_UserAgent_Mobile_Display object * @var object Net_UserAgent_Mobile_Display * @access private */ var $_display = ''; /** * Net_UserAgent_Mobile_Request_XXX object * @var object Net_UserAgent_Mobile_Request_XXX * @access private */ var $_request; // }}} // {{{ constructor /** * Constructor * * @param object Net_UserAgent_Mobile_Request_XXX $request */ function Net_UserAgent_Mobile_Common($request) { $this->_request = $request; $this->parse(); } // }}} // {{{ getUserAgent() /** * returns User-Agent string * * @return string * @access public */ function getUserAgent() { return $this->getHeader('User-Agent'); } // }}} // {{{ getHeader() /** * returns a specified HTTP header * * @param string $header * @return string * @access public */ function getHeader($header) { return $this->_request->get($header); } // }}} // {{{ getName() /** * returns User-Agent name like 'DoCoMo' * * @return string * @access public */ function getName() { return $this->name; } // }}} // {{{ getDisplay() /** * returns Net_UserAgent_Mobile_Disply object * * @return object Net_UserAgent_Mobile_Display * @access public * @see Net_UserAgent_Mobile_Display */ function getDisplay() { if ($this->_display === '') { $this->_display = $this->makeDisplay(); } return $this->_display; } // }}} // {{{ getVersion() /** * returns User-Agent version number like '1.0' * * @return string * @access public */ function getVersion() { return $this->version; } // }}} // {{{ noMatch() /** * generates a warning message for new variants * * @return object PEAR_Error * @access public */ function noMatch() { return PEAR::raiseError($this->getUserAgent() . ': no match. Might be new variants. ' . 'please contact the author of Net_UserAgent_Mobile!', NET_USERAGENT_MOBILE_ERROR_NOMATCH ); } // }}} // {{{ parse() /** * parse HTTP_USER_AGENT string (should be implemented in subclasses) * * @access public */ function parse() { die(); } // }}} // {{{ makeDisplay() /** * create a new Net_UserAgent_Mobile_Display class instance (should be implemented in subclasses) * * @access public */ function makeDisplay() { die(); } // }}} // {{{ isDoCoMo() /** * returns TRUE if the agent is DoCoMo * * @return boolean * @access public */ function isDoCoMo() { return FALSE; } // }}} // {{{ isJPhone() /** * returns TRUE if the agent is J-PHONE * * @return boolean * @access public */ function isJPhone() { return FALSE; } // }}} // {{{ isEZweb() /** * returns TRUE if the agent is EZweb * * @return boolean * @access public */ function isEZweb() { return FALSE; } // }}} // {{{ isWAP1() /** * returns TRUE if the agent can speak WAP1 protocol * * @return boolean * @access public */ function isWAP1() { return $this->isEZweb() && !$this->isWAP2(); } // }}} // {{{ isWAP2() /** * returns TRUE if the agent can speak WAP2 protocol * * @return boolean * @access public */ function isWAP2() { return $this->isEZweb() && $this->isXHTMLCompliant(); } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/Display.php +++ pear/Net_UserAgent_Mobile/Mobile/Display.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: Display.php,v 1.1 2003/02/19 16:28:41 kuboa Exp $ // // SYNOPSIS: // require_once('Net/UserAgent/Mobile.php'); // // $agent = &Net_UserAgent_Mobile::factory(); // $display = $agent->getDisplay(); // // $width = $display->getWidth(); // $height = $display->getHeight(); // list($width, $height) = $display->getSize(); // // if ($display->isColor()) { // $depth = $display->getDepth(); // } // /** * Display information for Net_UserAgent_Mobile * * Net_UserAgent_Mobile_Display is a class for display information on * Net_UserAgent_Mobile. Handy for image resizing or dispatching. * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public */ class Net_UserAgent_Mobile_Display { // {{{ properties /** * width of the display * @var integer * @access private */ var $_width; /** * height of the display * @var integer * @access private */ var $_height; /** * depth of the display * @var integer * @access public */ var $_depth; /** * color capability of the display * @var boolean * @access private */ var $_color; // }}} // {{{ constructor /** * Constructor * * @param array $data display infomation */ function Net_UserAgent_Mobile_Display($data) { $this->_width = $data['width']; $this->_height = $data['height']; $this->_depth = $data['depth']; $this->_color = $data['color']; } // }}} // {{{ calcSize() /** * returns width * height of the display * * @return integer * @access public */ function calcSize() { return $this->_width * $this->_height; } // }}} // {{{ getSize() /** * returns width with height of the display * * @return array * @access public */ function getSize() { return array($this->_width, $this->_height); } // }}} // {{{ getWidth() /** * returns width of the display * * @return integer * @access public */ function getWidth() { return $this->_width; } // }}} // {{{ getHeight() /** * returns height of the display * * @return integer * @access public */ function getHeight() { return $this->_height; } // }}} // {{{ getDepth() /** * returns depth of the display * * @return integer * @access public */ function getDepth() { return $this->_depth; } // }}} // {{{ isColor() /** * returns TRUE if the display has color capability * * @return boolean * @access public */ function isColor() { return $this->_color; } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php +++ pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: DoCoMo.php,v 1.1 2003/02/19 16:28:41 kuboa Exp $ // // SYNOPSIS: // require_once('Net/UserAgent/Mobile.php'); // // $_SERVER['HTTP_USER_AGENT'] = 'DoCoMo/1.0/P502i/c10'; // $agent = &Net_UserAgent_Mobile::factory(); // // printf("Name: %s\n", $agent->getName()); // 'DoCoMo' // printf("Version: %s\n", $agent->getVersion()); // 1.0 // printf("HTML version: %s\n", $agent->getHTMLVersion()); // 2.0 // printf("Model: %s\n", $agent->getModel()); // 'P502i' // printf("Cache: %dk\n", $agent->getCacheSize()); // 10 // if ($agent->isFOMA()) { // print "FOMA\n"; // FALSE // } // printf("Vendor: %s\n", $agent->getVendor()); // 'P' // printf("Series: %s\n", $agent->getSeries()); // '502i' // // // only available with <form utn> // // e.g.) 'DoCoMo/1.0/P503i/c10/serNMABH200331'; // printf("Serial: %s\n", $agent->getSerialNumber()); // 'NMABH200331' // // // e.g.) 'DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789)'; // printf("Serial: %s\n", $agent->getSerialNumber()); // '0123456789abcde' // printf("Card ID: %s\n", $agent->getCardID()); // '01234567890123456789' // // // e.g.) 'DoCoMo/1.0/P502i (Google CHTML Proxy/1.0)' // printf("Comment: %s\n", $agent->getComment()); // 'Google CHTML Proxy/1.0' // // // only available in eggy/M-stage // // e.g.) 'DoCoMo/1.0/eggy/c300/s32/kPHS-K' // printf("Bandwidth: %dkbps\n", $agent->getBandwidth()); // 32 // require_once('Net/UserAgent/Mobile/Common.php'); require_once('Net/UserAgent/Mobile/Display.php'); require_once('Net/UserAgent/Mobile/DoCoMoDisplayMap.php'); /** * NTT DoCoMo implementation * * Net_UserAgent_Mobile_DoCoMo is a subclass of Net_UserAgent_Mobile_Common, * which implements NTT docomo i-mode user agents. * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public * @see Net_UserAgent_Mobile_Common() * @see http://www.nttdocomo.co.jp/p_s/imode/spec/useragent.html * @see http://www.nttdocomo.co.jp/p_s/imode/spec/ryouiki.html * @see http://www.nttdocomo.co.jp/p_s/imode/tag/utn.html * @see http://www.nttdocomo.co.jp/p_s/mstage/visual/contents/cnt_mpage.html */ class Net_UserAgent_Mobile_DoCoMo extends Net_UserAgent_Mobile_Common { // {{{ properties /** * name of the model like 'P502i' * @var string * @access private */ var $_model = ''; /** * status of the cache (TB, TD, TJ) * @var string * @access private */ var $_status = ''; /** * bandwidth like 32 as killobytes unit * @var integer * @access private */ var $_bandwidth = NULL; /** * hardware unique serial number * @var string * @access private */ var $_serial_number = NULL; /** * whether it's FOMA or not * @var boolean * @access private */ var $_is_foma = FALSE; /** * FOMA Card ID (20 digit alphanumeric) * @var string * @access private */ var $_card_id = NULL; /** * comment on user agent string like 'Google Proxy' * @var string * @access private */ var $_comment = NULL; /** * cache size as killobytes unit * @var integer * @access private */ var $_cache_size; // }}} // {{{ isDoCoMo() /** * returns TRUE * * @return boolean * @access public */ function isDoCoMo() { return TRUE; } // }}} // {{{ parse() /** * parse HTTP_USER_AGENT string * * @access public */ function parse() { @list($main, $foma_or_comment) = explode(' ', $this->getUserAgent(), 2); if ($foma_or_comment && preg_match('/^\((.*)\)$/', $foma_or_comment, $matches) ) { // DoCoMo/1.0/P209is (Google CHTML Proxy/1.0) $this->_comment = $matches[1]; $this->_parseMain($main); } elseif ($foma_or_comment) { // DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789) $this->_is_foma = TRUE; list($this->name, $this->version) = explode('/', $main); $this->_parseFOMA($foma_or_comment); } else { // DoCoMo/1.0/R692i/c10 $this->_parseMain($main); } } // }}} // {{{ makeDisplay() /** * create a new Net_UserAgent_Mobile_Display class instance * * @return object Net_UserAgent_Mobile_Display * @access public * @see Net_UserAgent_Mobile_Display() * @see Net_UserAgent_Mobile_DoCoMoDisplayMap::get() */ function makeDisplay() { $display = Net_UserAgent_Mobile_DoCoMoDisplayMap::get($this->_model); return new Net_UserAgent_Mobile_Display($display); } // }}} // {{{ getHTMLVersion() /** * returns supported HTML version like '3.0'. retuns NULL if unknown. * * @return mixed * @access public */ function getHTMLVersion() { if ($this->isFOMA()) { $foma_html_version = &PEAR::getStaticProperty('Net_UserAgent_Mobile_DoCoMo', 'foma_html_version' ); if ($foma_html_version === NULL) { $foma_html_version = '3.0'; } return $foma_html_version; } $html_version_map = &PEAR::getStaticProperty('Net_UserAgent_Mobile_DoCoMo', 'html_version_map' ); if ($html_version_map === NULL) { // http://www.nttdocomo.co.jp/p_s/imode/spec/useragent.html $html_version_map = array( // regex => version '[DFNP]501i' => '1.0', '502i|821i|209i|691i|(F|N|P|KO)210i|^F671i$' => '2.0', '(D210i|SO210i)|503i|211i|SH251i|692i' => '3.0', '504i|251i|^F671iS$|212i' => '4.0', 'eggy|P751v' => '3.2' ); } foreach ($html_version_map as $key => $value) { if (preg_match("/$key/", $this->_model)) { return $value; } } return NULL; } // }}} // {{{ getCacheSize() /** * returns cache size as killobytes unit. returns 5 if unknown. * * @return integer * @access public */ function getCacheSize() { if ($this->_cache_size) { return $this->_cache_size; } $default_cache_size = &PEAR::getStaticProperty('Net_UserAgent_Mobile_DoCoMo', 'default_cache_size' ); if ($default_cache_size === NULL) { $default_cache_size = 5; } return $default_cache_size; } // }}} // {{{ getSeries() /** * returns series name like '502i'. returns NULL if unknown. * * @return mixed * @access public */ function getSeries() { if ($this->isFOMA()) { return 'FOMA'; } if (preg_match('/(\d{3}i)/', $this->_model, $matches)) { return $matches[1]; } return NULL; } // }}} // {{{ getVendor() /** * returns vender code like 'SO' for Sony. returns NULL if unknown. * * @return mixed * @access public */ function getVendor() { if (preg_match('/([A-Z]+)\d/', $this->_model, $matches)) { return $matches[1]; } return NULL; } // }}} // {{{ getModel() /** * returns name of the model like 'P502i' * * @return string * @access public */ function getModel() { return $this->_model; } // }}} // {{{ getStatus() /** * returns status of the cache (TB, TD, TJ) * * @return string * @access public */ function getStatus() { return $this->_status; } // }}} // {{{ getBandwidth() /** * returns bandwidth like 32 as killobytes unit. Only vailable in eggy, returns NULL otherwise. * * @return mixed * @access public */ function getBandwidth() { return $this->_bandwidth; } // }}} // {{{ getSerialNumber() /** * returns hardware unique serial number (15 digit in FOMA, 11 digit otherwise alphanumeric). Only available with form utn attribute. returns NULL otherwise. * * @return mixed * @access public */ function getSerialNumber() { return $this->_serial_number; } // }}} // {{{ isFOMA() /** * retuns whether it's FOMA or not * * @return boolean * @access public */ function isFOMA() { return $this->_is_foma; } // }}} // {{{ getComment() /** * returns comment on user agent string like 'Google Proxy'. returns NULL otherwise. * * @return mixed * @access public */ function getComment() { return $this->_comment; } // }}} // {{{ getCardID() /** * returns FOMA Card ID (20 digit alphanumeric). Only available in FOMA with E<lt>form utnE<gt> attribute. returns NULL otherwise. * * @return mixed * @access public */ function getCardID() { return $this->_card_id; } // }}} // {{{ _parseMain() /** * parse main part of HTTP_USER_AGENT string (not FOMA) * * @param string $main main part of HTTP_USER_AGENT string * @access private */ function _parseMain($main) { @list($name, $version, $model, $cache, $rest) = explode('/', $main, 5 ); $this->name = $name; $this->version = $version; $this->_model = $model; if ($cache) { if (!preg_match('/^c(\d+)/', $cache, $matches)) { return $this->noMatch(); } $this->_cache_size = (integer)$matches[1]; } if ($rest) { $rest = explode('/', $rest); foreach ($rest as $value) { if (preg_match('/^ser(\w{11})$/', $value, $matches)) { $this->_serial_number = $matches[1]; continue; } if (preg_match('/^(T[DBJ])$/', $value, $matches)) { $this->_status = $matches[1]; continue; } if (preg_match('/^s(\d+)$/', $value, $matches)) { $this->_bandwidth = (integer)$matches[1]; continue; } } } } // }}} // {{{ _parseFOMA() /** * parse main part of HTTP_USER_AGENT string (FOMA) * * @param string $foma main part of HTTP_USER_AGENT string * @access private */ function _parseFOMA($foma) { if (!preg_match('/^([^\(]+)/', $foma, $matches)) { return $this->noMatch(); } $this->_model = $matches[1]; if ($matches[1] === 'MST_v_SH2101V') { $this->_model = 'SH2101V'; } if (preg_match('/^[^\(]+\((.*?)\)$/', $foma, $matches)) { @list($cache, $serial, $icc) = explode(';', $matches[1]); $this->_cache_size = (integer)substr($cache, 1); if ($serial) { if (!preg_match('/^ser(\w{15})$/', $serial, $matches)) { return $this->noMatch(); } $this->_serial_number = $matches[1]; } if ($icc) { if (!preg_match('/^icc(\w{20})$/', $icc, $matches)) { return $this->noMatch(); } $this->_card_id = $matches[1]; } } } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/DoCoMoDisplayMap.php +++ pear/Net_UserAgent_Mobile/Mobile/DoCoMoDisplayMap.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: DoCoMoDisplayMap.php,v 1.1 2003/02/19 16:28:42 kuboa Exp $ // /** * Display infomation mapping for DoCoMo * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public * @see Net_UserAgent_Mobile_Display() */ class Net_UserAgent_Mobile_DoCoMoDisplayMap { /** * returns display infomation of the model * * @param string $model name of the model * @return array * @access public * @static */ function get($model) { $display_map = &PEAR::getStaticProperty('Net_UserAgent_Mobile_DoCoMoDisplayMap', 'display_map' ); if ($display_map === null) { $display_map = array( 'N504iS' => array( 'width' => 160, 'height' => 180, 'depth' => 65536, 'color' => TRUE ), 'F212i' => array( 'width' => 132, 'height' => 136, 'depth' => 65536, 'color' => TRUE ), 'P503iS' => array( 'width' => 120, 'height' => 130, 'depth' => 256, 'color' => TRUE ), 'D503i' => array( 'width' => 132, 'height' => 126, 'depth' => 4096, 'color' => TRUE ), 'F503i' => array( 'width' => 120, 'height' => 130, 'depth' => 256, 'color' => TRUE ), 'P209iS' => array( 'width' => 96, 'height' => 87, 'depth' => 256, 'color' => TRUE ), 'N503i' => array( 'width' => 118, 'height' => 128, 'depth' => 4096, 'color' => TRUE ), 'P503i' => array( 'width' => 120, 'height' => 130, 'depth' => 256, 'color' => TRUE ), 'F502it' => array( 'width' => 96, 'height' => 91, 'depth' => 256, 'color' => TRUE ), 'ER209i' => array( 'width' => 120, 'height' => 72, 'depth' => 2, 'color' => FALSE ), 'R692i' => array( 'width' => 96, 'height' => 98, 'depth' => 4096, 'color' => TRUE ), 'SH251i' => array( 'width' => 120, 'height' => 130, 'depth' => 65536, 'color' => TRUE ), 'SO211i' => array( 'width' => 120, 'height' => 112, 'depth' => 4096, 'color' => TRUE ), 'SH821i' => array( 'width' => 96, 'height' => 78, 'depth' => 256, 'color' => TRUE ), 'SO502i' => array( 'width' => 120, 'height' => 120, 'depth' => 4, 'color' => FALSE ), 'N502it' => array( 'width' => 118, 'height' => 128, 'depth ' => 256, 'color' => TRUE ), 'D504i' => array( 'width' => 132, 'height' => 144, 'depth' => 262144, 'color' => TRUE ), 'SO502iWM' => array( 'width' => 120, 'height' => 113, 'depth' => 256, 'color' => TRUE ), 'F504i' => array( 'width' => 132, 'height' => 136, 'depth' => 65536, 'color' => TRUE ), 'D209i' => array( 'width' => 96, 'height' => 90, 'depth' => 256, 'color' => TRUE ), 'F209i' => array( 'width' => 96, 'height' => 91, 'depth' => 256, 'color' => TRUE ), 'N504i' => array( 'width' => 160, 'height' => 180, 'depth' => 65536, 'color' => TRUE ), 'P504i' => array( 'width' => 132, 'height' => 144, 'depth' => 65536, 'color' => TRUE ), 'N209i' => array( 'width' => 108, 'height' => 82, 'depth' => 4, 'color' => FALSE ), 'P209i' => array( 'width' => 96, 'height' => 87, 'depth' => 4, 'color' => FALSE ), 'R209i' => array( 'width' => 96, 'height' => 72, 'depth' => 4, 'color' => FALSE ), 'F503iS' => array( 'width' => 120, 'height' => 130, 'depth' => 4096, 'color' => TRUE ), 'SO212i' => array( 'width' => 120, 'height' => 112, 'depth' => 65536, 'color' => TRUE ), 'D210i' => array( 'width' => 96, 'height' => 91, 'depth' => 256, 'color' => TRUE ), 'F210i' => array( 'width' => 96, 'height' => 113, 'depth' => 256, 'color' => TRUE ), 'N503iS' => array( 'width' => 118, 'height' => 128, 'depth' => 4096, 'color' => TRUE ), 'D501i' => array( 'width' => 96, 'height' => 72, 'depth' => 2, 'color' => FALSE ), 'SO503i' => array( 'width' => 120, 'height' => 113, 'depth' => 65536, 'color' => TRUE ), 'F501i' => array( 'width' => 112, 'height' => 84, 'depth' => 2, 'color' => FALSE ), 'P504iS' => array( 'width' => 132, 'height' => 144, 'depth' => 65536, 'color' => TRUE ), 'N210i' => array( 'width' => 118, 'height' => 113, 'depth' => 256, 'color' => TRUE ), 'P210i' => array( 'width' => 96, 'height' => 91, 'depth' => 256, 'color' => TRUE ), 'N501i' => array( 'width' => 118, 'height' => 128, 'depth' => 2, 'color' => FALSE ), 'P501i' => array( 'width' => 96, 'height' => 120, 'depth' => 2, 'color' => FALSE ), 'N2001' => array( 'width' => 118, 'height' => 128, 'depth' => 4096, 'color' => TRUE ), 'N2002' => array( 'width' => 118, 'height' => 128, 'depth' => 65536, 'color' => TRUE ), 'P2002' => array( 'width' => 118, 'height' => 128, 'depth' => 65536, 'color' => TRUE ), 'D251iS' => array( 'width' => 132, 'height' => 144, 'depth' => 262144, 'color' => TRUE ), 'KO209i' => array( 'width' => 96, 'height' => 96, 'depth' => 256, 'color' => TRUE ), 'D2101V' => array( 'width' => 120, 'height' => 130, 'depth' => 262144, 'color' => TRUE ), 'F671iS' => array( 'width' => 160, 'height' => 120, 'depth' => 65536, 'color' => TRUE ), 'D211i' => array( 'width' => 100, 'height' => 91, 'depth' => 4096, 'color' => TRUE ), 'F211i' => array( 'width' => 96, 'height' => 113, 'depth' => 4096, 'color' => TRUE ), 'P251iS' => array( 'width' => 132, 'height' => 144, 'depth' => 65536, 'color' => TRUE ), 'D502i' => array( 'width' => 96, 'height' => 90, 'depth' => 256, 'color' => TRUE ), 'SO504i' => array( 'width' => 120, 'height' => 112, 'depth' => 65536, 'color' => TRUE ), 'D251i' => array( 'width' => 132, 'height' => 144, 'depth' => 262144, 'color' => TRUE ), 'F502i' => array( 'width' => 96, 'height' => 91, 'depth' => 256, 'color' => TRUE ), 'F251i' => array( 'width' => 132, 'height' => 140, 'depth' => 65536, 'color' => TRUE ), 'P2101V' => array( 'width' => 163, 'height' => 182, 'depth' => 262144, 'color' => TRUE ), 'N211i' => array( 'width' => 118, 'height' => 128, 'depth' => 4096, 'color' => TRUE ), 'F671i' => array( 'width' => 120, 'height' => 126, 'depth' => 256, 'color' => TRUE ), 'P211i' => array( 'width' => 120, 'height' => 130, 'depth' => 65536, 'color' => TRUE ), 'F2051' => array( 'width' => 176, 'height' => 182, 'depth' => 65536, 'color' => TRUE ), 'N502i' => array( 'width' => 118, 'height' => 128, 'depth' => 4, 'color' => FALSE ), 'T2101V' => array( 'width' => 176, 'height' => 144, 'depth' => 262144, 'color' => TRUE ), 'N251i' => array( 'width' => 132, 'height' => 140, 'depth' => 65536, 'color' => TRUE ), 'R211i' => array( 'width' => 96, 'height' => 98, 'depth' => 4096, 'color' => TRUE ), 'SH251iS' => array( 'width' => 176, 'height' => 187, 'depth' => 65536, 'color' => TRUE ), 'P502i' => array( 'width' => 96, 'height' => 117, 'depth' => 4, 'color' => FALSE ), 'N821i' => array( 'width' => 118, 'height' => 128, 'depth' => 4, 'color' => FALSE ), 'P821i' => array( 'width' => 118, 'height' => 128, 'depth' => 4, 'color' => FALSE ), 'SH2101V' => array( 'width' => 800, 'height' => 600, 'depth' => 65536, 'color' => TRUE ), 'N2051' => array( 'width' => 176, 'height' => 198, 'depth' => 65536, 'color' => TRUE ), 'KO210i' => array( 'width' => 96, 'height' => 96, 'depth' => 256, 'color' => TRUE ), 'SO503iS' => array( 'width' => 120, 'height' => 113, 'depth' => 65536, 'color' => TRUE ), 'D503iS' => array( 'width' => 132, 'height' => 126, 'depth' => 4096, 'color' => TRUE ), 'R691i' => array( 'width' => 96, 'height' => 72, 'depth' => 4, 'color' => FALSE ), 'NM502i' => array( 'width' => 111, 'height' => 106, 'depth' => 2, 'color' => FALSE ), 'F504iS' => array( 'width' => 132, 'height' => 136, 'depth' => 65536, 'color' => TRUE ), 'SO210i' => array( 'width' => 120, 'height' => 113, 'depth' => 256, 'color' => TRUE ) ); } return $display_map[$model]; } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/EZweb.php +++ pear/Net_UserAgent_Mobile/Mobile/EZweb.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: EZweb.php,v 1.1 2003/02/19 16:28:42 kuboa Exp $ // // SYNOPSIS: // require_once('Net/UserAgent/Mobile.php'); // // $_SERVER['HTTP_USER_AGENT'] = 'UP.Browser/3.01-HI02 UP.Link/3.2.1.2'; // $agent = &Net_UserAgent_Mobile::factory(); // // printf("Name: %s\n", $agent->getName()); // 'UP.Browser' // printf("Version: %s\n", $agent->getVersion()); // 3.01 // printf("DeviceID: %s\n", $agent->getDeviceID()); // 'HI02' // printf("Server: %s\n", $agent->getServer()); // 'UP.Link/3.2.1.2' // // e.g.) 'UP.Browser/3.01-HI02 UP.Link/3.2.1.2 (Google WAP Proxy/1.0)' // printf("Comment: %s\n", $agent->getComment()); // 'Google WAP Proxy/1.0' // // e.g.) 'KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1' // if ($agent->isXHTMLCompliant()) { // print "XHTML compliant!\n"; // TRUE // } // require_once('Net/UserAgent/Mobile/Common.php'); require_once('Net/UserAgent/Mobile/Display.php'); /** * EZweb implementation * * Net_UserAgent_Mobile_EZweb is a subclass of Net_UserAgent_Mobile, which * implements EZweb (WAP1.0/2.0) user agents. * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public * @see Net_UserAgent_Mobile_Common() * @see http://www.au.kddi.com/ezfactory/tec/spec/4_4.html * @see http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html */ class Net_UserAgent_Mobile_EZweb extends Net_UserAgent_Mobile_Common { // {{{ properties /** * device ID like 'TS21' * @var string * @access private */ var $_device_id = ''; /** * server string like 'UP.Link/3.2.1.2' * @var string * @access private */ var $_server_name = ''; /** * comment like 'Google WAP Proxy/1.0' * @var string * @access private */ var $_comment = NULL; /** * whether it's XHTML compliant or not * @var boolean * @access private */ var $_xhtml_compliant = FALSE; // }}} // {{{ isEZweb() /** * returns TRUE * * @return boolean * @access public */ function isEZweb() { return TRUE; } // }}} // {{{ parse() /** * parse HTTP_USER_AGENT string * * @access public */ function parse() { $agent = $this->getUserAgent(); if (preg_match('/^KDDI-(.*)/', $agent, $matches)) { // KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 $this->_xhtml_compliant = TRUE; list($this->_device_id, $browser, $opt, $this->_server_name) = explode(' ', $matches[1], 4); list($this->name, $this->version) = explode('/', $browser); } else { // UP.Browser/3.01-HI01 UP.Link/3.4.5.2 @list($browser, $this->_server_name, $comment) = explode(' ', $agent, 3); list($this->name, $software) = explode('/', $browser); list($this->version, $this->_device_id) = explode('-', $software); if ($comment) { $this->_comment = preg_replace('/^\((.*)\)$/', '$1', $comment); } } } // }}} // {{{ makeDisplay() /** * create a new Net_UserAgent_Mobile_Display class instance * * @return object Net_UserAgent_Mobile_Display * @access public * @see Net_UserAgent_Mobile_Display() */ function makeDisplay() { list($width, $height) = explode(',', $this->getHeader('x-up-devcap-screenpixels')); $screen_depth = explode(',', $this->getHeader('x-up-devcap-screendepth')); $depth = $screen_depth[0]; $color = $this->getHeader('x-up-devcap-iscolor') === '1' ? TRUE : FALSE; return new Net_UserAgent_Mobile_Display(array( 'width' => $width, 'height' => $height, 'color' => $color, 'depth' => pow(2, $depth) ) ); } // }}} // {{{ getDeviceID() /** * returns device ID like 'TS21' * * @return string * @access public */ function getDeviceID() { return $this->_device_id; } // }}} // {{{ getServer() /** * returns device ID like 'TS21' * * @return string * @access public */ function getServer() { return $this->_server_name; } // }}} // {{{ getComment() /** * returns comment like 'Google WAP Proxy/1.0'. returns NULL if nothinng. * * @return boolean * @access public */ function getComment() { return $this->_comment; } // }}} // {{{ isXHTMLCompliant() /** * returns whether it's XHTML compliant or not * * @return boolean * @access public */ function isXHTMLCompliant() { return $this->_xhtml_compliant; } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/JPhone.php +++ pear/Net_UserAgent_Mobile/Mobile/JPhone.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: JPhone.php,v 1.1 2003/02/19 16:28:42 kuboa Exp $ // // SYNOPSIS: // require_once('Net/UserAgent/Mobile.php'); // // $_SERVER['HTTP_USER_AGENT'] = 'J-PHONE/2.0/J-DN02'; // $agent = &Net_UserAgent_Mobile::factory(); // // printf("Name: %s\n", $agent->getName()); // 'J-PHONE' // printf("Version: %s\n", $agent->getVersion()); // 2.0 // printf("Model: %s\n", $agent->getModel()); // 'J-DN02' // if ($agent->isPacketCompliant()) { // print "Packet is compliant.\n"; // FALSE // } // // // only availabe in Java compliant // // e.g.) 'J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0' // printf("Serial: %s\n", $agent->getSerialNumber()); // XXXXXXXXX // printf("Vendor: %s\n", $agent->getVendor()); // 'SH' // printf("Vendor Version: %s\n", $agent->getVendorVersion()); // '0001a' // // $info = $agent->getJavaInfo(); // array // foreach ($info as $key => $value) { // print "$key: $value\n"; // } // require_once('Net/UserAgent/Mobile/Common.php'); require_once('Net/UserAgent/Mobile/Display.php'); /** * J-PHONE implementation * * Net_UserAgent_Mobile_JPhone is a subclass of Net_UserAgent_Mobile, which * implements J-PHONE user agents. * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public * @see Net_UserAgent_Mobile_Common() * @see http://www.dp.j-phone.com/jsky/user.html * @see http://www.dp.j-phone.com/jsky/position.html */ class Net_UserAgent_Mobile_JPhone extends Net_UserAgent_Mobile_Common { // {{{ properties /** * name of the model like 'J-DN02' * @var string * @access private */ var $_model = ''; /** * whether the agent is packet connection complicant or not * @var boolean * @access private */ var $_packet_compliant = FALSE; /** * terminal unique serial number * @var string * @access private */ var $_serial_number = NULL; /** * vendor code like 'SH' * @var string * @access private */ var $_vendor = ''; /** * vendor version like '0001a' * @var string * @access private */ var $_vendor_version = NULL; /** * * @var array * @access private */ var $_java_info = array(); // }}} // {{{ isJPhone() /** * returns TRUE * * @return boolean * @access public */ function isJPhone() { return TRUE; } // }}} // {{{ parse() /** * parse HTTP_USER_AGENT string * * @access public */ function parse() { $agent = explode(' ', $this->getUserAgent()); $count = count($agent); if ($count > 1) { // J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0 $this->_packet_compliant = TRUE; list($this->name, $this->version, $this->_model, $serial_number) = explode('/', $agent[0]); if ($serial_number) { if (!preg_match('/^SN(.+)/', $serial_number, $matches) ) { return $this->noMatch(); } $this->_serial_number = $matches[1]; } list($this->_vendor, $this->_vendor_version) = explode('/', $agent[1]); for ($i = 2; $i < $count; ++$i) { list($key, $value) = explode('/', $agent[$i]); $this->_java_info[$key] = $value; } } else { // J-PHONE/2.0/J-DN02 list($this->name, $this->version, $this->_model) = explode('/', $agent[0]); if ($this->_model) { preg_match('/J-([A-Z]+)/', $this->_model, $matches); $this->_vendor = $matches[1]; } } } // }}} // {{{ makeDisplay() /** * create a new Net_UserAgent_Mobile_Display class instance * * @return object Net_UserAgent_Mobile_Display * @access public * @see Net_UserAgent_Mobile_Display() */ function makeDisplay() { list($width, $height) = explode('*', $this->getHeader('x-jphone-display')); $color = FALSE; $depth = NULL; if ($color_string = $this->getHeader('x-jphone-color')) { preg_match('/^([CG])(\d+)$/', $color_string, $matches); $color = $matches[1] === 'C' ? TRUE : FALSE; $depth = $matches[2]; } return new Net_UserAgent_Mobile_Display(array( 'width' => $width, 'height' => $height, 'depth' => $depth, 'color' => $color) ); } // }}} // {{{ getModel() /** * returns name of the model like 'J-DN02' * * @return string * @access public */ function getModel() { return $this->_model; } // }}} // {{{ isPacketCompliant() /** * returns whether the agent is packet connection complicant or not * * @return boolean * @access public */ function isPacketCompliant() { return $this->_packet_compliant; } // }}} // {{{ getSerialNumber() /** * return terminal unique serial number. returns NULL if user forbids to send his/her serial number. * * @return string * @access public */ function getSerialNumber() { return $this->_serial_number; } // }}} // {{{ getVendor() /** * returns vendor code like 'SH' * * @return string * @access public */ function getVendor() { return $this->_vendor; } // }}} // {{{ getVendorVersion() /** * returns vendor version like '0001a'. returns NULL if unknown. * * @return string * @access public */ function getVendorVersion() { return $this->_vendor_version; } // }}} // {{{ getJavaInfo() /** * returns array of Java profiles * * Array structure is something like: * * 'Profile' => 'MIDP-1.0', * 'Configuration' => 'CLDC-1.0', * 'Ext-Profile' => 'JSCL-1.1.0' * * @return array * @access public */ function getJavaInfo() { return $this->_java_info; } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/NonMobile.php +++ pear/Net_UserAgent_Mobile/Mobile/NonMobile.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: NonMobile.php,v 1.1 2003/02/19 16:28:42 kuboa Exp $ // // SYNOPSIS: // require_once('Net/UserAgent/Mobile.php'); // // $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/4.0'; // $agent = &Net_UserAgent_Mobile::factory(); // require_once('Net/UserAgent/Mobile/Common.php'); /** * Non-Mobile Agent implementation * * Net_UserAgent_Mobile_NonMobile is a subclass of Net_UserAgent_Mobile, * whichimplements non-mobile or unimplemented user agents. * * @package Net_UserAgent_Mobile * @version $Revision: 1.1 $ * @author KUBO Atsuhiro <kubo@isite.co.jp> * @access public * @see Net_UserAgent_Mobile_Common() */ class Net_UserAgent_Mobile_NonMobile extends Net_UserAgent_Mobile_Common { // }}} // {{{ parse() /** * parse HTTP_USER_AGENT string * * @access public */ function parse() { list($this->name, $this->version) = explode('/', $this->getUserAgent()); } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/Mobile/Request.php +++ pear/Net_UserAgent_Mobile/Mobile/Request.php <?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: KUBO Atsuhiro <kubo@isite.co.jp> | // +----------------------------------------------------------------------+ // // $Id: Request.php,v 1.1 2003/02/19 16:28:42 kuboa Exp $ // class Net_UserAgent_Mobile_Request { function &factory($stuff = null) { if ($stuff === null) { $request = &new Net_UserAgent_Mobile_Request_Env($_SERVER); } else { $request = &new Net_UserAgent_Mobile_Request_Env(array( 'HTTP_USER_AGENT' => $stuff) ); } return $request; } } class Net_UserAgent_Mobile_Request_Env { var $_env; function Net_UserAgent_Mobile_Request_Env($env) { $this->_env = $env; } function get($header) { $header = strtr($header, '-', '_'); return $this->_env[ 'HTTP_' . strtoupper($header) ]; } } /* * Local Variables: * mode: php * coding: iso-8859-1 * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * indent-tabs-mode: nil * End: */ ?> Index: pear/Net_UserAgent_Mobile/tests/.cvsignore +++ pear/Net_UserAgent_Mobile/tests/.cvsignore *.diff *.exp *.log *.out *.php Index: pear/Net_UserAgent_Mobile/tests/00-compile.phpt +++ pear/Net_UserAgent_Mobile/tests/00-compile.phpt --TEST-- Net_UserAgent_Mobile: compile --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - compile // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); print "Testing compile ...\n"; ?> --POST-- --GET-- --EXPECT-- Testing compile ... Index: pear/Net_UserAgent_Mobile/tests/01-request.phpt +++ pear/Net_UserAgent_Mobile/tests/01-request.phpt --TEST-- Net_UserAgent_Mobile: various way to make request --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - various way to make request // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); $line = 0; ++$line; print "$line: " ."Testing various way to make request ...\n"; $ua = 'Mozilla/1.0'; $agent = &Net_UserAgent_Mobile::factory($ua); ++$line; print "$line: " .is_object($agent) . "\n"; ++$line; print "$line: ". get_parent_class($agent) . "\n"; ++$line; print "$line: ". $agent->getUserAgent() . "\n"; $_SERVER['HTTP_USER_AGENT'] = $ua; $agent = &Net_UserAgent_Mobile::factory(); ++$line; print "$line: " .is_object($agent) . "\n"; ++$line; print "$line: " .get_parent_class($agent) . "\n"; ++$line; print "$line: " .$agent->getUserAgent() . "\n"; ?> --POST-- --GET-- --EXPECT-- 1: Testing various way to make request ... 2: 1 3: net_useragent_mobile_common 4: Mozilla/1.0 5: 1 6: net_useragent_mobile_common 7: Mozilla/1.0 Index: pear/Net_UserAgent_Mobile/tests/02-docomo.phpt +++ pear/Net_UserAgent_Mobile/tests/02-docomo.phpt --TEST-- Net_UserAgent_Mobile: DoCoMo --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - DoCoMo // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); $tests = array( // ua, version, html_version, model, cache_size, is_foma, vendor, series, options array('DoCoMo/1.0/D501i', '1.0', '1.0', 'D501i', 5, FALSE, 'D', '501i'), array('DoCoMo/1.0/D502i', '1.0', '2.0', 'D502i', 5, FALSE, 'D', '502i'), array('DoCoMo/1.0/D502i/c10', '1.0', '2.0', 'D502i', 10, FALSE, 'D', '502i'), array('DoCoMo/1.0/D210i/c10', '1.0', '3.0', 'D210i', 10, FALSE, 'D', '210i'), array('DoCoMo/1.0/SO503i/c10', '1.0', '3.0', 'SO503i', 10, FALSE, 'SO', '503i'), array('DoCoMo/1.0/D211i/c10', '1.0', '3.0', 'D211i', 10, FALSE, 'D', '211i'), array('DoCoMo/1.0/SH251i/c10', '1.0', '3.0', 'SH251i', 10, FALSE, 'SH', '251i'), array('DoCoMo/1.0/R692i/c10', '1.0', '3.0', 'R692i', 10, FALSE, 'R', '692i'), array('DoCoMo/2.0 P2101V(c100)', '2.0', '3.0', 'P2101V', 100, TRUE, 'P', 'FOMA'), array('DoCoMo/2.0 N2001(c10)', '2.0', '3.0', 'N2001', 10, TRUE, 'N', 'FOMA'), array('DoCoMo/2.0 N2002(c100)', '2.0', '3.0', 'N2002', 100, TRUE, 'N', 'FOMA'), array('DoCoMo/2.0 D2101V(c100)', '2.0', '3.0', 'D2101V', 100, TRUE, 'D', 'FOMA'), array('DoCoMo/2.0 P2002(c100)', '2.0', '3.0', 'P2002', 100, TRUE, 'P', 'FOMA'), array('DoCoMo/2.0 MST_v_SH2101V(c100)', '2.0', '3.0', 'SH2101V', 100, TRUE, 'SH', 'FOMA'), array('DoCoMo/2.0 T2101V(c100)', '2.0', '3.0', 'T2101V', 100, TRUE, 'T', 'FOMA'), array('DoCoMo/1.0/D504i/c10', '1.0', '4.0', 'D504i', 10, FALSE, 'D', '504i'), array('DoCoMo/1.0/D504i/c30/TD', '1.0', '4.0', 'D504i', 30, FALSE, 'D', '504i', array('status' => 'TD')), array('DoCoMo/1.0/D504i/c10/TJ', '1.0', '4.0', 'D504i', 10, FALSE, 'D', '504i', array('status' => 'TJ')), array('DoCoMo/1.0/F504i/c10/TB', '1.0', '4.0', 'F504i', 10, FALSE, 'F', '504i', array('status' => 'TB')), array('DoCoMo/1.0/D251i/c10', '1.0', '4.0', 'D251i', 10, FALSE, 'D', '251i'), array('DoCoMo/1.0/F251i/c10/TB', '1.0', '4.0', 'F251i', 10, FALSE, 'F', '251i', array('status' => 'TB')), array('DoCoMo/1.0/F671iS/c10/TB', '1.0', '4.0', 'F671iS', 10, FALSE, 'F', '671i', array('status' => 'TB')), array('DoCoMo/1.0/P503i/c10/serNMABH200331', '1.0', '3.0', 'P503i', 10, FALSE, 'P', '503i', array('serial_number' => 'NMABH200331')), array('DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789)', '2.0', '3.0', 'N2001', 10, 1, 'N', 'FOMA', array('serial_number' => '0123456789abcde', 'card_id' => '01234567890123456789')), array('DoCoMo/1.0/eggy/c300/s32/kPHS-K', '1.0', '3.2', 'eggy', 300, FALSE, NULL, NULL, array('bandwidth' => 32)), array('DoCoMo/1.0/P751v/c100/s64/kPHS-K', '1.0', '3.2', 'P751v', 100, FALSE, 'P', NULL, array('bandwidth' => 64)), array('DoCoMo/1.0/P209is (Google CHTML Proxy/1.0)', '1.0', '2.0', 'P209is', 5, FALSE, 'P', '209i', array('comment' => 'Google CHTML Proxy/1.0')), array('DoCoMo/1.0/F212i/c10/TB', '1.0', '4.0', 'F212i', 10, FALSE, 'F', '212i') ); $test_agents = array( 'DoCoMo/1.0/633S/c20', 'DoCoMo/1.0/641P/c10', 'DoCoMo/1.0/641S/c10', 'DoCoMo/1.0/642S/c20', 'DoCoMo/1.0/Agent', 'DoCoMo/1.0/D209i', 'DoCoMo/1.0/D209i/c10', 'DoCoMo/1.0/D210i/c10', 'DoCoMo/1.0/D211i/c10', 'DoCoMo/1.0/D251i/c10', 'DoCoMo/1.0/D501i', 'DoCoMo/1.0/D501i/c5', 'DoCoMo/1.0/D502i', 'DoCoMo/1.0/D502i/c10', 'DoCoMo/1.0/D503i', 'DoCoMo/1.0/D503i/c10', 'DoCoMo/1.0/D503i/c5', 'DoCoMo/1.0/D503iS/c10', 'DoCoMo/1.0/D503iS/c5', 'DoCoMo/1.0/D504i/c10', 'DoCoMo/1.0/ER209i', 'DoCoMo/1.0/ER209i/c15', 'DoCoMo/1.0/F209i', 'DoCoMo/1.0/F209i/c10', 'DoCoMo/1.0/F210i/c10', 'DoCoMo/1.0/F211i/c10', 'DoCoMo/1.0/F251i/c10/TB', 'DoCoMo/1.0/F501i', 'DoCoMo/1.0/F502i', 'DoCoMo/1.0/F502i/c10', 'DoCoMo/1.0/F502it', 'DoCoMo/1.0/F502it/c10', 'DoCoMo/1.0/F503i', 'DoCoMo/1.0/F503i/c10', 'DoCoMo/1.0/F503i/c32', 'DoCoMo/1.0/F503iS', 'DoCoMo/1.0/F503iS/c10', 'DoCoMo/1.0/F504i/c10/TB', 'DoCoMo/1.0/F504i/c10/TJ', 'DoCoMo/1.0/F671i/c10', 'DoCoMo/1.0/GigaCode (http://gigacode.net/)', 'DoCoMo/1.0/KO209i', 'DoCoMo/1.0/KO210i', 'DoCoMo/1.0/KO210i/c10', 'DoCoMo/1.0/N209i', 'DoCoMo/1.0/N209i/c08', 'DoCoMo/1.0/N210i', 'DoCoMo/1.0/N210i/c10', 'DoCoMo/1.0/N211i/c10', 'DoCoMo/1.0/N501i', 'DoCoMo/1.0/N502i', 'DoCoMo/1.0/N502i/c08', 'DoCoMo/1.0/N502it', 'DoCoMo/1.0/N502it/c10', 'DoCoMo/1.0/N503i', 'DoCoMo/1.0/N503i/c10', 'DoCoMo/1.0/N503i/c30', 'DoCoMo/1.0/N503i/c5', 'DoCoMo/1.0/N503i/c5/serNNEBJ608187', 'DoCoMo/1.0/N503iS', 'DoCoMo/1.0/N503iS/c10', 'DoCoMo/1.0/N503iS/c5', 'DoCoMo/1.0/N504i/c10', 'DoCoMo/1.0/N504i/c10/TB', 'DoCoMo/1.0/N504i/c10/TJ', 'DoCoMo/1.0/N504i/c10/TJ/c0', 'DoCoMo/1.0/N821i', 'DoCoMo/1.0/N821i/c08', 'DoCoMo/1.0/NM502i', 'DoCoMo/1.0/NM502i/c10', 'DoCoMo/1.0/P209i', 'DoCoMo/1.0/P209i/c10', 'DoCoMo/1.0/P209is', 'DoCoMo/1.0/P209is (Google CHTML Proxy/1.0)', 'DoCoMo/1.0/P209is/c10', 'DoCoMo/1.0/P210i', 'DoCoMo/1.0/P210i/c10', 'DoCoMo/1.0/P211i/c10', 'DoCoMo/1.0/P501i', 'DoCoMo/1.0/P502i', 'DoCoMo/1.0/P502i/c10', 'DoCoMo/1.0/P502i/c10 (Google CHTML Proxy/1.0)', 'DoCoMo/1.0/P502i_mEB-PD555', 'DoCoMo/1.0/P503i', 'DoCoMo/1.0/P503i/c10', 'DoCoMo/1.0/P503i/c10/', 'DoCoMo/1.0/P503iS', 'DoCoMo/1.0/P503iS/c10', 'DoCoMo/1.0/P503iS/c10/serNMAUA482012', 'DoCoMo/1.0/P504i/c10', 'DoCoMo/1.0/P504i/c10/TB', 'DoCoMo/1.0/P751v/c100/s64/kPHS-K', 'DoCoMo/1.0/P821i', 'DoCoMo/1.0/P821i/c08', 'DoCoMo/1.0/PacketMeter/c10', 'DoCoMo/1.0/R209i', 'DoCoMo/1.0/R211i/c10', 'DoCoMo/1.0/R691i', 'DoCoMo/1.0/SH251i/c10', 'DoCoMo/1.0/SH712m/c10', 'DoCoMo/1.0/SH821i', 'DoCoMo/1.0/SH821i/c10', 'DoCoMo/1.0/SO210i/c10', 'DoCoMo/1.0/SO211i/c10', 'DoCoMo/1.0/SO502i', 'DoCoMo/1.0/SO502iWM/c10', 'DoCoMo/1.0/SO503i', 'DoCoMo/1.0/SO503i/c10', 'DoCoMo/1.0/SO503i/c10/serNSOBD506895', 'DoCoMo/1.0/SO503i/c10/serNSOBD597705', 'DoCoMo/1.0/SO503iS/c10', 'DoCoMo/1.0/SO504i/c10', 'DoCoMo/1.0/SO504i/c10/TB', 'DoCoMo/1.0/TEST/c10', 'DoCoMo/1.0/TF502i', 'DoCoMo/1.0/X503i/c10', 'DoCoMo/1.0/eggy/c300/s32/kPHS-K', 'DoCoMo/1.0/eggy/c300/s64/kPHS-K', 'DoCoMo/1.0/ex_idisplay/c10', 'DoCoMo/1.0/ex_ps_test00/c10', 'DoCoMo/1.0/iYappo', 'DoCoMo/1.0/p503is/c10', 'DoCoMo/1.0/test', 'DoCoMo/1.0/test/c10', 'DoCoMo/1.0/test/c10/TB', 'DoCoMo/1.1/P711m/c10', 'DoCoMo/2.0 D2101V(c100)', 'DoCoMo/2.0 MST_v_P2101V(c100)', 'DoCoMo/2.0 N2001(c10)', 'DoCoMo/2.0 N2001(c10;ser350200000307969;icc8981100000200188565F)', 'DoCoMo/2.0 N2002(c100)', 'DoCoMo/2.0 P2002(c100)', 'DoCoMo/2.0 P2101V', 'DoCoMo/2.0 P2101V(c100)', 'DoCoMo/2.0/N502i', 'DoCoMo/2.0/N502it', 'DoCoMo/2.0/N503i', 'DoCoMo/3.0/N503' ); $line = 0; ++$line; print "$line: " . "Testing DoCoMo ...\n"; foreach ($tests as $value1) { $ua = array_shift($value1); $data = $value1; $agent = &Net_UserAgent_Mobile::factory($ua); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; ++$line; print "$line: " . $agent->getName() . "\n"; ++$line; print "$line: " . $agent->getUserAgent() . "\n"; ++$line; print "$line: " . $agent->getVersion() . "\n"; ++$line; print "$line: " . $agent->getHTMLVersion() . "\n"; ++$line; print "$line: " . $agent->getModel() . "\n"; ++$line; print "$line: " . $agent->getCacheSize() . "\n"; ++$line; print "$line: " . $agent->isFOMA() . "\n"; ++$line; print "$line: " . $agent->getVendor() . "\n"; ++$line; print "$line: " . $agent->getSeries() . "\n"; if (count($data) == 8) { foreach ($data[7] as $key2 => $value2) { ++$line; print "$line: " . "Testing $key2 ...\n"; switch ($key2) { case 'status': ++$line; print "$line: " . $agent->getStatus() . "\n"; break; case 'serial_number': ++$line; print "$line: " . $agent->getSerialNumber() . "\n"; break; case 'card_id': ++$line; print "$line: " . $agent->getCardID() . "\n"; break; case 'bandwidth': ++$line; print "$line: " . $agent->getBandwidth() . "\n"; break; case 'comment': ++$line; print "$line: " . $agent->getComment() . "\n"; break; } } } } foreach ($test_agents as $value) { $_SERVER['HTTP_USER_AGENT'] = $value; $agent = &Net_UserAgent_Mobile::factory(); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->getName() . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; } ?> --POST-- --GET-- --EXPECT-- 1: Testing DoCoMo ... 2: 1 3: net_useragent_mobile_common 4: net_useragent_mobile_docomo 5: 1 6: 7: 8: DoCoMo 9: DoCoMo/1.0/D501i 10: 1.0 11: 1.0 12: D501i 13: 5 14: 15: D 16: 501i 17: 1 18: net_useragent_mobile_common 19: net_useragent_mobile_docomo 20: 1 21: 22: 23: DoCoMo 24: DoCoMo/1.0/D502i 25: 1.0 26: 2.0 27: D502i 28: 5 29: 30: D 31: 502i 32: 1 33: net_useragent_mobile_common 34: net_useragent_mobile_docomo 35: 1 36: 37: 38: DoCoMo 39: DoCoMo/1.0/D502i/c10 40: 1.0 41: 2.0 42: D502i 43: 10 44: 45: D 46: 502i 47: 1 48: net_useragent_mobile_common 49: net_useragent_mobile_docomo 50: 1 51: 52: 53: DoCoMo 54: DoCoMo/1.0/D210i/c10 55: 1.0 56: 3.0 57: D210i 58: 10 59: 60: D 61: 210i 62: 1 63: net_useragent_mobile_common 64: net_useragent_mobile_docomo 65: 1 66: 67: 68: DoCoMo 69: DoCoMo/1.0/SO503i/c10 70: 1.0 71: 3.0 72: SO503i 73: 10 74: 75: SO 76: 503i 77: 1 78: net_useragent_mobile_common 79: net_useragent_mobile_docomo 80: 1 81: 82: 83: DoCoMo 84: DoCoMo/1.0/D211i/c10 85: 1.0 86: 3.0 87: D211i 88: 10 89: 90: D 91: 211i 92: 1 93: net_useragent_mobile_common 94: net_useragent_mobile_docomo 95: 1 96: 97: 98: DoCoMo 99: DoCoMo/1.0/SH251i/c10 100: 1.0 101: 3.0 102: SH251i 103: 10 104: 105: SH 106: 251i 107: 1 108: net_useragent_mobile_common 109: net_useragent_mobile_docomo 110: 1 111: 112: 113: DoCoMo 114: DoCoMo/1.0/R692i/c10 115: 1.0 116: 3.0 117: R692i 118: 10 119: 120: R 121: 692i 122: 1 123: net_useragent_mobile_common 124: net_useragent_mobile_docomo 125: 1 126: 127: 128: DoCoMo 129: DoCoMo/2.0 P2101V(c100) 130: 2.0 131: 3.0 132: P2101V 133: 100 134: 1 135: P 136: FOMA 137: 1 138: net_useragent_mobile_common 139: net_useragent_mobile_docomo 140: 1 141: 142: 143: DoCoMo 144: DoCoMo/2.0 N2001(c10) 145: 2.0 146: 3.0 147: N2001 148: 10 149: 1 150: N 151: FOMA 152: 1 153: net_useragent_mobile_common 154: net_useragent_mobile_docomo 155: 1 156: 157: 158: DoCoMo 159: DoCoMo/2.0 N2002(c100) 160: 2.0 161: 3.0 162: N2002 163: 100 164: 1 165: N 166: FOMA 167: 1 168: net_useragent_mobile_common 169: net_useragent_mobile_docomo 170: 1 171: 172: 173: DoCoMo 174: DoCoMo/2.0 D2101V(c100) 175: 2.0 176: 3.0 177: D2101V 178: 100 179: 1 180: D 181: FOMA 182: 1 183: net_useragent_mobile_common 184: net_useragent_mobile_docomo 185: 1 186: 187: 188: DoCoMo 189: DoCoMo/2.0 P2002(c100) 190: 2.0 191: 3.0 192: P2002 193: 100 194: 1 195: P 196: FOMA 197: 1 198: net_useragent_mobile_common 199: net_useragent_mobile_docomo 200: 1 201: 202: 203: DoCoMo 204: DoCoMo/2.0 MST_v_SH2101V(c100) 205: 2.0 206: 3.0 207: SH2101V 208: 100 209: 1 210: SH 211: FOMA 212: 1 213: net_useragent_mobile_common 214: net_useragent_mobile_docomo 215: 1 216: 217: 218: DoCoMo 219: DoCoMo/2.0 T2101V(c100) 220: 2.0 221: 3.0 222: T2101V 223: 100 224: 1 225: T 226: FOMA 227: 1 228: net_useragent_mobile_common 229: net_useragent_mobile_docomo 230: 1 231: 232: 233: DoCoMo 234: DoCoMo/1.0/D504i/c10 235: 1.0 236: 4.0 237: D504i 238: 10 239: 240: D 241: 504i 242: 1 243: net_useragent_mobile_common 244: net_useragent_mobile_docomo 245: 1 246: 247: 248: DoCoMo 249: DoCoMo/1.0/D504i/c30/TD 250: 1.0 251: 4.0 252: D504i 253: 30 254: 255: D 256: 504i 257: Testing status ... 258: TD 259: 1 260: net_useragent_mobile_common 261: net_useragent_mobile_docomo 262: 1 263: 264: 265: DoCoMo 266: DoCoMo/1.0/D504i/c10/TJ 267: 1.0 268: 4.0 269: D504i 270: 10 271: 272: D 273: 504i 274: Testing status ... 275: TJ 276: 1 277: net_useragent_mobile_common 278: net_useragent_mobile_docomo 279: 1 280: 281: 282: DoCoMo 283: DoCoMo/1.0/F504i/c10/TB 284: 1.0 285: 4.0 286: F504i 287: 10 288: 289: F 290: 504i 291: Testing status ... 292: TB 293: 1 294: net_useragent_mobile_common 295: net_useragent_mobile_docomo 296: 1 297: 298: 299: DoCoMo 300: DoCoMo/1.0/D251i/c10 301: 1.0 302: 4.0 303: D251i 304: 10 305: 306: D 307: 251i 308: 1 309: net_useragent_mobile_common 310: net_useragent_mobile_docomo 311: 1 312: 313: 314: DoCoMo 315: DoCoMo/1.0/F251i/c10/TB 316: 1.0 317: 4.0 318: F251i 319: 10 320: 321: F 322: 251i 323: Testing status ... 324: TB 325: 1 326: net_useragent_mobile_common 327: net_useragent_mobile_docomo 328: 1 329: 330: 331: DoCoMo 332: DoCoMo/1.0/F671iS/c10/TB 333: 1.0 334: 4.0 335: F671iS 336: 10 337: 338: F 339: 671i 340: Testing status ... 341: TB 342: 1 343: net_useragent_mobile_common 344: net_useragent_mobile_docomo 345: 1 346: 347: 348: DoCoMo 349: DoCoMo/1.0/P503i/c10/serNMABH200331 350: 1.0 351: 3.0 352: P503i 353: 10 354: 355: P 356: 503i 357: Testing serial_number ... 358: NMABH200331 359: 1 360: net_useragent_mobile_common 361: net_useragent_mobile_docomo 362: 1 363: 364: 365: DoCoMo 366: DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789) 367: 2.0 368: 3.0 369: N2001 370: 10 371: 1 372: N 373: FOMA 374: Testing serial_number ... 375: 0123456789abcde 376: Testing card_id ... 377: 01234567890123456789 378: 1 379: net_useragent_mobile_common 380: net_useragent_mobile_docomo 381: 1 382: 383: 384: DoCoMo 385: DoCoMo/1.0/eggy/c300/s32/kPHS-K 386: 1.0 387: 3.2 388: eggy 389: 300 390: 391: 392: 393: Testing bandwidth ... 394: 32 395: 1 396: net_useragent_mobile_common 397: net_useragent_mobile_docomo 398: 1 399: 400: 401: DoCoMo 402: DoCoMo/1.0/P751v/c100/s64/kPHS-K 403: 1.0 404: 3.2 405: P751v 406: 100 407: 408: P 409: 410: Testing bandwidth ... 411: 64 412: 1 413: net_useragent_mobile_common 414: net_useragent_mobile_docomo 415: 1 416: 417: 418: DoCoMo 419: DoCoMo/1.0/P209is (Google CHTML Proxy/1.0) 420: 1.0 421: 2.0 422: P209is 423: 5 424: 425: P 426: 209i 427: Testing comment ... 428: Google CHTML Proxy/1.0 429: 1 430: net_useragent_mobile_common 431: net_useragent_mobile_docomo 432: 1 433: 434: 435: DoCoMo 436: DoCoMo/1.0/F212i/c10/TB 437: 1.0 438: 4.0 439: F212i 440: 10 441: 442: F 443: 212i 444: 1 445: net_useragent_mobile_common 446: net_useragent_mobile_docomo 447: DoCoMo 448: 1 449: 450: 451: 1 452: net_useragent_mobile_common 453: net_useragent_mobile_docomo 454: DoCoMo 455: 1 456: 457: 458: 1 459: net_useragent_mobile_common 460: net_useragent_mobile_docomo 461: DoCoMo 462: 1 463: 464: 465: 1 466: net_useragent_mobile_common 467: net_useragent_mobile_docomo 468: DoCoMo 469: 1 470: 471: 472: 1 473: net_useragent_mobile_common 474: net_useragent_mobile_docomo 475: DoCoMo 476: 1 477: 478: 479: 1 480: net_useragent_mobile_common 481: net_useragent_mobile_docomo 482: DoCoMo 483: 1 484: 485: 486: 1 487: net_useragent_mobile_common 488: net_useragent_mobile_docomo 489: DoCoMo 490: 1 491: 492: 493: 1 494: net_useragent_mobile_common 495: net_useragent_mobile_docomo 496: DoCoMo 497: 1 498: 499: 500: 1 501: net_useragent_mobile_common 502: net_useragent_mobile_docomo 503: DoCoMo 504: 1 505: 506: 507: 1 508: net_useragent_mobile_common 509: net_useragent_mobile_docomo 510: DoCoMo 511: 1 512: 513: 514: 1 515: net_useragent_mobile_common 516: net_useragent_mobile_docomo 517: DoCoMo 518: 1 519: 520: 521: 1 522: net_useragent_mobile_common 523: net_useragent_mobile_docomo 524: DoCoMo 525: 1 526: 527: 528: 1 529: net_useragent_mobile_common 530: net_useragent_mobile_docomo 531: DoCoMo 532: 1 533: 534: 535: 1 536: net_useragent_mobile_common 537: net_useragent_mobile_docomo 538: DoCoMo 539: 1 540: 541: 542: 1 543: net_useragent_mobile_common 544: net_useragent_mobile_docomo 545: DoCoMo 546: 1 547: 548: 549: 1 550: net_useragent_mobile_common 551: net_useragent_mobile_docomo 552: DoCoMo 553: 1 554: 555: 556: 1 557: net_useragent_mobile_common 558: net_useragent_mobile_docomo 559: DoCoMo 560: 1 561: 562: 563: 1 564: net_useragent_mobile_common 565: net_useragent_mobile_docomo 566: DoCoMo 567: 1 568: 569: 570: 1 571: net_useragent_mobile_common 572: net_useragent_mobile_docomo 573: DoCoMo 574: 1 575: 576: 577: 1 578: net_useragent_mobile_common 579: net_useragent_mobile_docomo 580: DoCoMo 581: 1 582: 583: 584: 1 585: net_useragent_mobile_common 586: net_useragent_mobile_docomo 587: DoCoMo 588: 1 589: 590: 591: 1 592: net_useragent_mobile_common 593: net_useragent_mobile_docomo 594: DoCoMo 595: 1 596: 597: 598: 1 599: net_useragent_mobile_common 600: net_useragent_mobile_docomo 601: DoCoMo 602: 1 603: 604: 605: 1 606: net_useragent_mobile_common 607: net_useragent_mobile_docomo 608: DoCoMo 609: 1 610: 611: 612: 1 613: net_useragent_mobile_common 614: net_useragent_mobile_docomo 615: DoCoMo 616: 1 617: 618: 619: 1 620: net_useragent_mobile_common 621: net_useragent_mobile_docomo 622: DoCoMo 623: 1 624: 625: 626: 1 627: net_useragent_mobile_common 628: net_useragent_mobile_docomo 629: DoCoMo 630: 1 631: 632: 633: 1 634: net_useragent_mobile_common 635: net_useragent_mobile_docomo 636: DoCoMo 637: 1 638: 639: 640: 1 641: net_useragent_mobile_common 642: net_useragent_mobile_docomo 643: DoCoMo 644: 1 645: 646: 647: 1 648: net_useragent_mobile_common 649: net_useragent_mobile_docomo 650: DoCoMo 651: 1 652: 653: 654: 1 655: net_useragent_mobile_common 656: net_useragent_mobile_docomo 657: DoCoMo 658: 1 659: 660: 661: 1 662: net_useragent_mobile_common 663: net_useragent_mobile_docomo 664: DoCoMo 665: 1 666: 667: 668: 1 669: net_useragent_mobile_common 670: net_useragent_mobile_docomo 671: DoCoMo 672: 1 673: 674: 675: 1 676: net_useragent_mobile_common 677: net_useragent_mobile_docomo 678: DoCoMo 679: 1 680: 681: 682: 1 683: net_useragent_mobile_common 684: net_useragent_mobile_docomo 685: DoCoMo 686: 1 687: 688: 689: 1 690: net_useragent_mobile_common 691: net_useragent_mobile_docomo 692: DoCoMo 693: 1 694: 695: 696: 1 697: net_useragent_mobile_common 698: net_useragent_mobile_docomo 699: DoCoMo 700: 1 701: 702: 703: 1 704: net_useragent_mobile_common 705: net_useragent_mobile_docomo 706: DoCoMo 707: 1 708: 709: 710: 1 711: net_useragent_mobile_common 712: net_useragent_mobile_docomo 713: DoCoMo 714: 1 715: 716: 717: 1 718: net_useragent_mobile_common 719: net_useragent_mobile_docomo 720: DoCoMo 721: 1 722: 723: 724: 1 725: net_useragent_mobile_common 726: net_useragent_mobile_docomo 727: DoCoMo 728: 1 729: 730: 731: 1 732: net_useragent_mobile_common 733: net_useragent_mobile_docomo 734: DoCoMo 735: 1 736: 737: 738: 1 739: net_useragent_mobile_common 740: net_useragent_mobile_docomo 741: DoCoMo 742: 1 743: 744: 745: 1 746: net_useragent_mobile_common 747: net_useragent_mobile_docomo 748: DoCoMo 749: 1 750: 751: 752: 1 753: net_useragent_mobile_common 754: net_useragent_mobile_docomo 755: DoCoMo 756: 1 757: 758: 759: 1 760: net_useragent_mobile_common 761: net_useragent_mobile_docomo 762: DoCoMo 763: 1 764: 765: 766: 1 767: net_useragent_mobile_common 768: net_useragent_mobile_docomo 769: DoCoMo 770: 1 771: 772: 773: 1 774: net_useragent_mobile_common 775: net_useragent_mobile_docomo 776: DoCoMo 777: 1 778: 779: 780: 1 781: net_useragent_mobile_common 782: net_useragent_mobile_docomo 783: DoCoMo 784: 1 785: 786: 787: 1 788: net_useragent_mobile_common 789: net_useragent_mobile_docomo 790: DoCoMo 791: 1 792: 793: 794: 1 795: net_useragent_mobile_common 796: net_useragent_mobile_docomo 797: DoCoMo 798: 1 799: 800: 801: 1 802: net_useragent_mobile_common 803: net_useragent_mobile_docomo 804: DoCoMo 805: 1 806: 807: 808: 1 809: net_useragent_mobile_common 810: net_useragent_mobile_docomo 811: DoCoMo 812: 1 813: 814: 815: 1 816: net_useragent_mobile_common 817: net_useragent_mobile_docomo 818: DoCoMo 819: 1 820: 821: 822: 1 823: net_useragent_mobile_common 824: net_useragent_mobile_docomo 825: DoCoMo 826: 1 827: 828: 829: 1 830: net_useragent_mobile_common 831: net_useragent_mobile_docomo 832: DoCoMo 833: 1 834: 835: 836: 1 837: net_useragent_mobile_common 838: net_useragent_mobile_docomo 839: DoCoMo 840: 1 841: 842: 843: 1 844: net_useragent_mobile_common 845: net_useragent_mobile_docomo 846: DoCoMo 847: 1 848: 849: 850: 1 851: net_useragent_mobile_common 852: net_useragent_mobile_docomo 853: DoCoMo 854: 1 855: 856: 857: 1 858: net_useragent_mobile_common 859: net_useragent_mobile_docomo 860: DoCoMo 861: 1 862: 863: 864: 1 865: net_useragent_mobile_common 866: net_useragent_mobile_docomo 867: DoCoMo 868: 1 869: 870: 871: 1 872: net_useragent_mobile_common 873: net_useragent_mobile_docomo 874: DoCoMo 875: 1 876: 877: 878: 1 879: net_useragent_mobile_common 880: net_useragent_mobile_docomo 881: DoCoMo 882: 1 883: 884: 885: 1 886: net_useragent_mobile_common 887: net_useragent_mobile_docomo 888: DoCoMo 889: 1 890: 891: 892: 1 893: net_useragent_mobile_common 894: net_useragent_mobile_docomo 895: DoCoMo 896: 1 897: 898: 899: 1 900: net_useragent_mobile_common 901: net_useragent_mobile_docomo 902: DoCoMo 903: 1 904: 905: 906: 1 907: net_useragent_mobile_common 908: net_useragent_mobile_docomo 909: DoCoMo 910: 1 911: 912: 913: 1 914: net_useragent_mobile_common 915: net_useragent_mobile_docomo 916: DoCoMo 917: 1 918: 919: 920: 1 921: net_useragent_mobile_common 922: net_useragent_mobile_docomo 923: DoCoMo 924: 1 925: 926: 927: 1 928: net_useragent_mobile_common 929: net_useragent_mobile_docomo 930: DoCoMo 931: 1 932: 933: 934: 1 935: net_useragent_mobile_common 936: net_useragent_mobile_docomo 937: DoCoMo 938: 1 939: 940: 941: 1 942: net_useragent_mobile_common 943: net_useragent_mobile_docomo 944: DoCoMo 945: 1 946: 947: 948: 1 949: net_useragent_mobile_common 950: net_useragent_mobile_docomo 951: DoCoMo 952: 1 953: 954: 955: 1 956: net_useragent_mobile_common 957: net_useragent_mobile_docomo 958: DoCoMo 959: 1 960: 961: 962: 1 963: net_useragent_mobile_common 964: net_useragent_mobile_docomo 965: DoCoMo 966: 1 967: 968: 969: 1 970: net_useragent_mobile_common 971: net_useragent_mobile_docomo 972: DoCoMo 973: 1 974: 975: 976: 1 977: net_useragent_mobile_common 978: net_useragent_mobile_docomo 979: DoCoMo 980: 1 981: 982: 983: 1 984: net_useragent_mobile_common 985: net_useragent_mobile_docomo 986: DoCoMo 987: 1 988: 989: 990: 1 991: net_useragent_mobile_common 992: net_useragent_mobile_docomo 993: DoCoMo 994: 1 995: 996: 997: 1 998: net_useragent_mobile_common 999: net_useragent_mobile_docomo 1000: DoCoMo 1001: 1 1002: 1003: 1004: 1 1005: net_useragent_mobile_common 1006: net_useragent_mobile_docomo 1007: DoCoMo 1008: 1 1009: 1010: 1011: 1 1012: net_useragent_mobile_common 1013: net_useragent_mobile_docomo 1014: DoCoMo 1015: 1 1016: 1017: 1018: 1 1019: net_useragent_mobile_common 1020: net_useragent_mobile_docomo 1021: DoCoMo 1022: 1 1023: 1024: 1025: 1 1026: net_useragent_mobile_common 1027: net_useragent_mobile_docomo 1028: DoCoMo 1029: 1 1030: 1031: 1032: 1 1033: net_useragent_mobile_common 1034: net_useragent_mobile_docomo 1035: DoCoMo 1036: 1 1037: 1038: 1039: 1 1040: net_useragent_mobile_common 1041: net_useragent_mobile_docomo 1042: DoCoMo 1043: 1 1044: 1045: 1046: 1 1047: net_useragent_mobile_common 1048: net_useragent_mobile_docomo 1049: DoCoMo 1050: 1 1051: 1052: 1053: 1 1054: net_useragent_mobile_common 1055: net_useragent_mobile_docomo 1056: DoCoMo 1057: 1 1058: 1059: 1060: 1 1061: net_useragent_mobile_common 1062: net_useragent_mobile_docomo 1063: DoCoMo 1064: 1 1065: 1066: 1067: 1 1068: net_useragent_mobile_common 1069: net_useragent_mobile_docomo 1070: DoCoMo 1071: 1 1072: 1073: 1074: 1 1075: net_useragent_mobile_common 1076: net_useragent_mobile_docomo 1077: DoCoMo 1078: 1 1079: 1080: 1081: 1 1082: net_useragent_mobile_common 1083: net_useragent_mobile_docomo 1084: DoCoMo 1085: 1 1086: 1087: 1088: 1 1089: net_useragent_mobile_common 1090: net_useragent_mobile_docomo 1091: DoCoMo 1092: 1 1093: 1094: 1095: 1 1096: net_useragent_mobile_common 1097: net_useragent_mobile_docomo 1098: DoCoMo 1099: 1 1100: 1101: 1102: 1 1103: net_useragent_mobile_common 1104: net_useragent_mobile_docomo 1105: DoCoMo 1106: 1 1107: 1108: 1109: 1 1110: net_useragent_mobile_common 1111: net_useragent_mobile_docomo 1112: DoCoMo 1113: 1 1114: 1115: 1116: 1 1117: net_useragent_mobile_common 1118: net_useragent_mobile_docomo 1119: DoCoMo 1120: 1 1121: 1122: 1123: 1 1124: net_useragent_mobile_common 1125: net_useragent_mobile_docomo 1126: DoCoMo 1127: 1 1128: 1129: 1130: 1 1131: net_useragent_mobile_common 1132: net_useragent_mobile_docomo 1133: DoCoMo 1134: 1 1135: 1136: 1137: 1 1138: net_useragent_mobile_common 1139: net_useragent_mobile_docomo 1140: DoCoMo 1141: 1 1142: 1143: 1144: 1 1145: net_useragent_mobile_common 1146: net_useragent_mobile_docomo 1147: DoCoMo 1148: 1 1149: 1150: 1151: 1 1152: net_useragent_mobile_common 1153: net_useragent_mobile_docomo 1154: DoCoMo 1155: 1 1156: 1157: 1158: 1 1159: net_useragent_mobile_common 1160: net_useragent_mobile_docomo 1161: DoCoMo 1162: 1 1163: 1164: 1165: 1 1166: net_useragent_mobile_common 1167: net_useragent_mobile_docomo 1168: DoCoMo 1169: 1 1170: 1171: 1172: 1 1173: net_useragent_mobile_common 1174: net_useragent_mobile_docomo 1175: DoCoMo 1176: 1 1177: 1178: 1179: 1 1180: net_useragent_mobile_common 1181: net_useragent_mobile_docomo 1182: DoCoMo 1183: 1 1184: 1185: 1186: 1 1187: net_useragent_mobile_common 1188: net_useragent_mobile_docomo 1189: DoCoMo 1190: 1 1191: 1192: 1193: 1 1194: net_useragent_mobile_common 1195: net_useragent_mobile_docomo 1196: DoCoMo 1197: 1 1198: 1199: 1200: 1 1201: net_useragent_mobile_common 1202: net_useragent_mobile_docomo 1203: DoCoMo 1204: 1 1205: 1206: 1207: 1 1208: net_useragent_mobile_common 1209: net_useragent_mobile_docomo 1210: DoCoMo 1211: 1 1212: 1213: 1214: 1 1215: net_useragent_mobile_common 1216: net_useragent_mobile_docomo 1217: DoCoMo 1218: 1 1219: 1220: 1221: 1 1222: net_useragent_mobile_common 1223: net_useragent_mobile_docomo 1224: DoCoMo 1225: 1 1226: 1227: 1228: 1 1229: net_useragent_mobile_common 1230: net_useragent_mobile_docomo 1231: DoCoMo 1232: 1 1233: 1234: 1235: 1 1236: net_useragent_mobile_common 1237: net_useragent_mobile_docomo 1238: DoCoMo 1239: 1 1240: 1241: 1242: 1 1243: net_useragent_mobile_common 1244: net_useragent_mobile_docomo 1245: DoCoMo 1246: 1 1247: 1248: 1249: 1 1250: net_useragent_mobile_common 1251: net_useragent_mobile_docomo 1252: DoCoMo 1253: 1 1254: 1255: 1256: 1 1257: net_useragent_mobile_common 1258: net_useragent_mobile_docomo 1259: DoCoMo 1260: 1 1261: 1262: 1263: 1 1264: net_useragent_mobile_common 1265: net_useragent_mobile_docomo 1266: DoCoMo 1267: 1 1268: 1269: 1270: 1 1271: net_useragent_mobile_common 1272: net_useragent_mobile_docomo 1273: DoCoMo 1274: 1 1275: 1276: 1277: 1 1278: net_useragent_mobile_common 1279: net_useragent_mobile_docomo 1280: DoCoMo 1281: 1 1282: 1283: 1284: 1 1285: net_useragent_mobile_common 1286: net_useragent_mobile_docomo 1287: DoCoMo 1288: 1 1289: 1290: 1291: 1 1292: net_useragent_mobile_common 1293: net_useragent_mobile_docomo 1294: DoCoMo 1295: 1 1296: 1297: 1298: 1 1299: net_useragent_mobile_common 1300: net_useragent_mobile_docomo 1301: DoCoMo 1302: 1 1303: 1304: 1305: 1 1306: net_useragent_mobile_common 1307: net_useragent_mobile_docomo 1308: DoCoMo 1309: 1 1310: 1311: 1312: 1 1313: net_useragent_mobile_common 1314: net_useragent_mobile_docomo 1315: DoCoMo 1316: 1 1317: 1318: 1319: 1 1320: net_useragent_mobile_common 1321: net_useragent_mobile_docomo 1322: DoCoMo 1323: 1 1324: 1325: 1326: 1 1327: net_useragent_mobile_common 1328: net_useragent_mobile_docomo 1329: DoCoMo 1330: 1 1331: 1332: 1333: 1 1334: net_useragent_mobile_common 1335: net_useragent_mobile_docomo 1336: DoCoMo 1337: 1 1338: 1339: 1340: 1 1341: net_useragent_mobile_common 1342: net_useragent_mobile_docomo 1343: DoCoMo 1344: 1 1345: 1346: 1347: 1 1348: net_useragent_mobile_common 1349: net_useragent_mobile_docomo 1350: DoCoMo 1351: 1 1352: 1353: 1354: 1 1355: net_useragent_mobile_common 1356: net_useragent_mobile_docomo 1357: DoCoMo 1358: 1 1359: 1360: 1361: 1 1362: net_useragent_mobile_common 1363: net_useragent_mobile_docomo 1364: DoCoMo 1365: 1 1366: 1367: 1368: 1 1369: net_useragent_mobile_common 1370: net_useragent_mobile_docomo 1371: DoCoMo 1372: 1 1373: 1374: 1375: 1 1376: net_useragent_mobile_common 1377: net_useragent_mobile_docomo 1378: DoCoMo 1379: 1 1380: 1381: 1382: 1 1383: net_useragent_mobile_common 1384: net_useragent_mobile_docomo 1385: DoCoMo 1386: 1 1387: 1388: 1389: 1 1390: net_useragent_mobile_common 1391: net_useragent_mobile_docomo 1392: DoCoMo 1393: 1 1394: 1395: 1396: 1 1397: net_useragent_mobile_common 1398: net_useragent_mobile_docomo 1399: DoCoMo 1400: 1 1401: 1402: 1403: 1 1404: net_useragent_mobile_common 1405: net_useragent_mobile_docomo 1406: DoCoMo 1407: 1 1408: 1409: Index: pear/Net_UserAgent_Mobile/tests/03-jphone.phpt +++ pear/Net_UserAgent_Mobile/tests/03-jphone.phpt --TEST-- Net_UserAgent_Mobile: J-PHONE --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - J-PHONE // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); $tests = array( // ua, version, model, packet_compliant, serial_number, vendor, vendor_version, java_infos array('J-PHONE/2.0/J-DN02', '2.0', 'J-DN02', FALSE), array('J-PHONE/3.0/J-PE03_a', '3.0', 'J-PE03_a', FALSE), array('J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', '4.0', 'J-SH51', TRUE, 'JSHA3029293', 'SH', '0001aa', array('Profile' => 'MIDP-1.0', 'Configuration' => 'CLDC-1.0', 'Ext-Profile' => 'JSCL-1.1.0')), array('J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', '4.0', 'J-SH51', TRUE, 'XXXXXXXXX', 'SH', '0001a', array('Profile' => 'MIDP-1.0', 'Configuration' => 'CLDC-1.0', 'Ext-Profile' => 'JSCL-1.1.0')), ); $test_agents = array( 'J-PHONE/1.0', 'J-PHONE/2.0/J-DN02', 'J-PHONE/2.0/J-P02', 'J-PHONE/2.0/J-P03', 'J-PHONE/2.0/J-SA02', 'J-PHONE/2.0/J-SH02', 'J-PHONE/2.0/J-SH03', 'J-PHONE/2.0/J-SH03_a', 'J-PHONE/2.0/J-SH04', 'J-PHONE/2.0/J-T04', 'J-PHONE/2.0/J-T05', 'J-PHONE/3.0/J-D03', 'J-PHONE/3.0/J-D04', 'J-PHONE/3.0/J-D05', 'J-PHONE/3.0/J-DN03', 'J-PHONE/3.0/J-K03', 'J-PHONE/3.0/J-K04', 'J-PHONE/3.0/J-K05', 'J-PHONE/3.0/J-N03', 'J-PHONE/3.0/J-N03B', 'J-PHONE/3.0/J-N04', 'J-PHONE/3.0/J-N05', 'J-PHONE/3.0/J-NM01_a', 'J-PHONE/3.0/J-NM02', 'J-PHONE/3.0/J-PE03', 'J-PHONE/3.0/J-PE03_a', 'J-PHONE/3.0/J-SA03_a', 'J-PHONE/3.0/J-SA04', 'J-PHONE/3.0/J-SA04_a', 'J-PHONE/3.0/J-SH04', 'J-PHONE/3.0/J-SH04_a', 'J-PHONE/3.0/J-SH04_b', 'J-PHONE/3.0/J-SH04_c', 'J-PHONE/3.0/J-SH05', 'J-PHONE/3.0/J-SH05_a', 'J-PHONE/3.0/J-SH06', 'J-PHONE/3.0/J-SH07', 'J-PHONE/3.0/J-SH08', 'J-PHONE/3.0/J-T05', 'J-PHONE/3.0/J-T06', 'J-PHONE/3.0/J-T06_a', 'J-PHONE/3.0/J-T07', 'J-PHONE/4.0/J-K51/SNJKWA3001061 KW/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-K51/SNJKWA3040744 KW/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-P51/SNJMAA1036146 MA/JDP51A36 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNJSHA1032366 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNJSHA1041639 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNJSHA2901949 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNJSHA3008160 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNJSHA3016183 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51_a/SNJSHA1045575 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51_a/SNJSHA1082487 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51_a/SNJSHA1086956 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51_a/SNJSHA3093881 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-SH51_a/SNJSHA5081372 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-T51/SNJTSA1077171 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-T51/SNJTSA1082745 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0', 'J-PHONE/4.0/J-T51/SNJTSA3001961 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0' ); $line = 0; ++$line; print "$line: " . "Testing J-PHONE ...\n"; foreach ($tests as $value1) { $ua = array_shift($value1); $data = $value1; $agent = &Net_UserAgent_Mobile::factory($ua); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; ++$line; print "$line: " . $agent->getName() . "\n"; ++$line; print "$line: " . $agent->getUserAgent() . "\n"; ++$line; print "$line: " . $agent->getVersion() . "\n"; ++$line; print "$line: " . $agent->getModel() . "\n"; ++$line; print "$line: " . $agent->isPacketCompliant() . "\n"; if (count($data) == 7) { ++$line; print "$line: " . $agent->getSerialNumber() . "\n"; ++$line; print "$line: " . $agent->getVendor() . "\n"; ++$line; print "$line: " . $agent->getVendorVersion() . "\n"; $java_info = $agent->getJavaInfo(); foreach ($data[6] as $key2 => $value2) { ++$line; print "$line: " . "Testing $key2 ...\n"; switch ($key2) { case 'Profile': ++$line; print "$line: " . $java_info['Profile'] . "\n"; break; case 'Configuration': ++$line; print "$line: " . $java_info['Configuration'] . "\n"; break; case 'Ext-Profile': ++$line; print "$line: " . $java_info['Ext-Profile'] . "\n"; break; } } } } foreach ($test_agents as $value) { $_SERVER['HTTP_USER_AGENT'] = $value; $agent = &Net_UserAgent_Mobile::factory(); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->getName() . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; } ?> --POST-- --GET-- --EXPECT-- 1: Testing J-PHONE ... 2: 1 3: net_useragent_mobile_common 4: net_useragent_mobile_jphone 5: 6: 1 7: 8: J-PHONE 9: J-PHONE/2.0/J-DN02 10: 2.0 11: J-DN02 12: 13: 1 14: net_useragent_mobile_common 15: net_useragent_mobile_jphone 16: 17: 1 18: 19: J-PHONE 20: J-PHONE/3.0/J-PE03_a 21: 3.0 22: J-PE03_a 23: 24: 1 25: net_useragent_mobile_common 26: net_useragent_mobile_jphone 27: 28: 1 29: 30: J-PHONE 31: J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0 32: 4.0 33: J-SH51 34: 1 35: JSHA3029293 36: SH 37: 0001aa 38: Testing Profile ... 39: MIDP-1.0 40: Testing Configuration ... 41: CLDC-1.0 42: Testing Ext-Profile ... 43: JSCL-1.1.0 44: 1 45: net_useragent_mobile_common 46: net_useragent_mobile_jphone 47: 48: 1 49: 50: J-PHONE 51: J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0 52: 4.0 53: J-SH51 54: 1 55: XXXXXXXXX 56: SH 57: 0001a 58: Testing Profile ... 59: MIDP-1.0 60: Testing Configuration ... 61: CLDC-1.0 62: Testing Ext-Profile ... 63: JSCL-1.1.0 64: 1 65: net_useragent_mobile_common 66: net_useragent_mobile_jphone 67: J-PHONE 68: 69: 1 70: 71: 1 72: net_useragent_mobile_common 73: net_useragent_mobile_jphone 74: J-PHONE 75: 76: 1 77: 78: 1 79: net_useragent_mobile_common 80: net_useragent_mobile_jphone 81: J-PHONE 82: 83: 1 84: 85: 1 86: net_useragent_mobile_common 87: net_useragent_mobile_jphone 88: J-PHONE 89: 90: 1 91: 92: 1 93: net_useragent_mobile_common 94: net_useragent_mobile_jphone 95: J-PHONE 96: 97: 1 98: 99: 1 100: net_useragent_mobile_common 101: net_useragent_mobile_jphone 102: J-PHONE 103: 104: 1 105: 106: 1 107: net_useragent_mobile_common 108: net_useragent_mobile_jphone 109: J-PHONE 110: 111: 1 112: 113: 1 114: net_useragent_mobile_common 115: net_useragent_mobile_jphone 116: J-PHONE 117: 118: 1 119: 120: 1 121: net_useragent_mobile_common 122: net_useragent_mobile_jphone 123: J-PHONE 124: 125: 1 126: 127: 1 128: net_useragent_mobile_common 129: net_useragent_mobile_jphone 130: J-PHONE 131: 132: 1 133: 134: 1 135: net_useragent_mobile_common 136: net_useragent_mobile_jphone 137: J-PHONE 138: 139: 1 140: 141: 1 142: net_useragent_mobile_common 143: net_useragent_mobile_jphone 144: J-PHONE 145: 146: 1 147: 148: 1 149: net_useragent_mobile_common 150: net_useragent_mobile_jphone 151: J-PHONE 152: 153: 1 154: 155: 1 156: net_useragent_mobile_common 157: net_useragent_mobile_jphone 158: J-PHONE 159: 160: 1 161: 162: 1 163: net_useragent_mobile_common 164: net_useragent_mobile_jphone 165: J-PHONE 166: 167: 1 168: 169: 1 170: net_useragent_mobile_common 171: net_useragent_mobile_jphone 172: J-PHONE 173: 174: 1 175: 176: 1 177: net_useragent_mobile_common 178: net_useragent_mobile_jphone 179: J-PHONE 180: 181: 1 182: 183: 1 184: net_useragent_mobile_common 185: net_useragent_mobile_jphone 186: J-PHONE 187: 188: 1 189: 190: 1 191: net_useragent_mobile_common 192: net_useragent_mobile_jphone 193: J-PHONE 194: 195: 1 196: 197: 1 198: net_useragent_mobile_common 199: net_useragent_mobile_jphone 200: J-PHONE 201: 202: 1 203: 204: 1 205: net_useragent_mobile_common 206: net_useragent_mobile_jphone 207: J-PHONE 208: 209: 1 210: 211: 1 212: net_useragent_mobile_common 213: net_useragent_mobile_jphone 214: J-PHONE 215: 216: 1 217: 218: 1 219: net_useragent_mobile_common 220: net_useragent_mobile_jphone 221: J-PHONE 222: 223: 1 224: 225: 1 226: net_useragent_mobile_common 227: net_useragent_mobile_jphone 228: J-PHONE 229: 230: 1 231: 232: 1 233: net_useragent_mobile_common 234: net_useragent_mobile_jphone 235: J-PHONE 236: 237: 1 238: 239: 1 240: net_useragent_mobile_common 241: net_useragent_mobile_jphone 242: J-PHONE 243: 244: 1 245: 246: 1 247: net_useragent_mobile_common 248: net_useragent_mobile_jphone 249: J-PHONE 250: 251: 1 252: 253: 1 254: net_useragent_mobile_common 255: net_useragent_mobile_jphone 256: J-PHONE 257: 258: 1 259: 260: 1 261: net_useragent_mobile_common 262: net_useragent_mobile_jphone 263: J-PHONE 264: 265: 1 266: 267: 1 268: net_useragent_mobile_common 269: net_useragent_mobile_jphone 270: J-PHONE 271: 272: 1 273: 274: 1 275: net_useragent_mobile_common 276: net_useragent_mobile_jphone 277: J-PHONE 278: 279: 1 280: 281: 1 282: net_useragent_mobile_common 283: net_useragent_mobile_jphone 284: J-PHONE 285: 286: 1 287: 288: 1 289: net_useragent_mobile_common 290: net_useragent_mobile_jphone 291: J-PHONE 292: 293: 1 294: 295: 1 296: net_useragent_mobile_common 297: net_useragent_mobile_jphone 298: J-PHONE 299: 300: 1 301: 302: 1 303: net_useragent_mobile_common 304: net_useragent_mobile_jphone 305: J-PHONE 306: 307: 1 308: 309: 1 310: net_useragent_mobile_common 311: net_useragent_mobile_jphone 312: J-PHONE 313: 314: 1 315: 316: 1 317: net_useragent_mobile_common 318: net_useragent_mobile_jphone 319: J-PHONE 320: 321: 1 322: 323: 1 324: net_useragent_mobile_common 325: net_useragent_mobile_jphone 326: J-PHONE 327: 328: 1 329: 330: 1 331: net_useragent_mobile_common 332: net_useragent_mobile_jphone 333: J-PHONE 334: 335: 1 336: 337: 1 338: net_useragent_mobile_common 339: net_useragent_mobile_jphone 340: J-PHONE 341: 342: 1 343: 344: 1 345: net_useragent_mobile_common 346: net_useragent_mobile_jphone 347: J-PHONE 348: 349: 1 350: 351: 1 352: net_useragent_mobile_common 353: net_useragent_mobile_jphone 354: J-PHONE 355: 356: 1 357: 358: 1 359: net_useragent_mobile_common 360: net_useragent_mobile_jphone 361: J-PHONE 362: 363: 1 364: 365: 1 366: net_useragent_mobile_common 367: net_useragent_mobile_jphone 368: J-PHONE 369: 370: 1 371: 372: 1 373: net_useragent_mobile_common 374: net_useragent_mobile_jphone 375: J-PHONE 376: 377: 1 378: 379: 1 380: net_useragent_mobile_common 381: net_useragent_mobile_jphone 382: J-PHONE 383: 384: 1 385: 386: 1 387: net_useragent_mobile_common 388: net_useragent_mobile_jphone 389: J-PHONE 390: 391: 1 392: 393: 1 394: net_useragent_mobile_common 395: net_useragent_mobile_jphone 396: J-PHONE 397: 398: 1 399: 400: 1 401: net_useragent_mobile_common 402: net_useragent_mobile_jphone 403: J-PHONE 404: 405: 1 406: 407: 1 408: net_useragent_mobile_common 409: net_useragent_mobile_jphone 410: J-PHONE 411: 412: 1 413: 414: 1 415: net_useragent_mobile_common 416: net_useragent_mobile_jphone 417: J-PHONE 418: 419: 1 420: 421: 1 422: net_useragent_mobile_common 423: net_useragent_mobile_jphone 424: J-PHONE 425: 426: 1 427: 428: 1 429: net_useragent_mobile_common 430: net_useragent_mobile_jphone 431: J-PHONE 432: 433: 1 434: 435: 1 436: net_useragent_mobile_common 437: net_useragent_mobile_jphone 438: J-PHONE 439: 440: 1 441: 442: 1 443: net_useragent_mobile_common 444: net_useragent_mobile_jphone 445: J-PHONE 446: 447: 1 448: 449: 1 450: net_useragent_mobile_common 451: net_useragent_mobile_jphone 452: J-PHONE 453: 454: 1 455: 456: 1 457: net_useragent_mobile_common 458: net_useragent_mobile_jphone 459: J-PHONE 460: 461: 1 462: 463: 1 464: net_useragent_mobile_common 465: net_useragent_mobile_jphone 466: J-PHONE 467: 468: 1 469: 470: 1 471: net_useragent_mobile_common 472: net_useragent_mobile_jphone 473: J-PHONE 474: 475: 1 476: 477: 1 478: net_useragent_mobile_common 479: net_useragent_mobile_jphone 480: J-PHONE 481: 482: 1 483: 484: 1 485: net_useragent_mobile_common 486: net_useragent_mobile_jphone 487: J-PHONE 488: 489: 1 490: Index: pear/Net_UserAgent_Mobile/tests/04-ezweb.phpt +++ pear/Net_UserAgent_Mobile/tests/04-ezweb.phpt --TEST-- Net_UserAgent_Mobile: EZweb --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - EZweb // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); $tests = array( // ua, version, device_id, server, xhtml_compliant, comment, is_wap1, is_wap2 array('UP.Browser/3.01-HI01 UP.Link/3.4.5.2', '3.01', 'HI01', 'UP.Link/3.4.5.2', FALSE, NULL, TRUE, FALSE), array('KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1', '6.0.2.276 (GUI)', 'TS21', 'MMP/1.1', TRUE, NULL, FALSE, TRUE), array('UP.Browser/3.04-TS14 UP.Link/3.4.4 (Google WAP Proxy/1.0)', '3.04', 'TS14', 'UP.Link/3.4.4', FALSE, 'Google WAP Proxy/1.0', TRUE, FALSE) ); $test_agents = array( 'KDDI-CA21 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-CA21 UP.Browser/6.0.7.1 (GUI) MMP/1.1', 'KDDI-HI21 UP.Browser/6.0.2.213 (GUI) MMP/1.1', 'KDDI-HI21 UP.Browser/6.0.2.273 (GUI) MMP/1.1', 'KDDI-HI21 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-KC21 UP.Browser/6.0.2.273 (GUI) MMP/1.1', 'KDDI-KC21 UP.Browser/6.0.5 (GUI) MMP/1.1', 'KDDI-KC21 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-MA21 UP.Browser/6.0.2.276 (GUI) MMP/1.1', 'KDDI-MA21 UP.Browser/6.0.5 (GUI) MMP/1.1', 'KDDI-MA21 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-MA21 UP.Browser/6.0.7 (GUI) MMP/1.1', 'KDDI-SA21 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-SA21 UP.Browser/6.0.7 (GUI) MMP/1.1', 'KDDI-SA21 UP.Browser/6.0.7.1 (GUI) MMP/1.1', 'KDDI-SA22 UP.Browser/6.0.7.2 (GUI) MMP/1.1', 'KDDI-SN21 UP.Browser/6.0.7 (GUI) MMP/1.1', 'KDDI-SN22 UP.Browser/6.0.7 (GUI) MMP/1.1', 'KDDI-TS21 UP.Browser/6.0.2.273 (GUI) MMP/1.1', 'KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1', 'KDDI-TS21 UP.Browser/6.0.5.287 (GUI) MMP/1.1', 'KDDI-TS21 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-TS22 UP.Browser/6.0.6 (GUI) MMP/1.1', 'KDDI-TS22 UP.Browser/6.0.7.1 (GUI) MMP/1.1', 'UP.Browser/3.01-HI01 UP.Link/3.4.5.2', 'UP.Browser/3.01-HI02 UP.Link/3.2.1.2', 'UP.Browser/3.03-HI11 UP.Link/3.2.2.7c', 'UP.Browser/3.03-HI11 UP.Link/3.4.4', 'UP.Browser/3.03-KCT3 UP.Link/3.4.4', 'UP.Browser/3.03-SYC1 UP.Link/3.4.4', 'UP.Browser/3.03-TS11 UP.Link/3.2.2.7c', 'UP.Browser/3.03-TST1 UP.Link/3.2.2.7c', 'UP.Browser/3.04-CA11 UP.Link/3.2.2.7c', 'UP.Browser/3.04-CA11 UP.Link/3.3.0.3', 'UP.Browser/3.04-CA11 UP.Link/3.3.0.5', 'UP.Browser/3.04-CA11 UP.Link/3.4.4', 'UP.Browser/3.04-CA12 UP.Link/3.4.4', 'UP.Browser/3.04-CA13 UP.Link/3.3.0.5', 'UP.Browser/3.04-CA13 UP.Link/3.4.4', 'UP.Browser/3.04-CA14 UP.Link/3.4.4', 'UP.Browser/3.04-DN11 UP.Link/3.3.0.1', 'UP.Browser/3.04-DN11 UP.Link/3.4.4', 'UP.Browser/3.04-HI11 UP.Link/3.2.2.7c', 'UP.Browser/3.04-HI11 UP.Link/3.4.4', 'UP.Browser/3.04-HI12 UP.Link/3.2.2.7c', 'UP.Browser/3.04-HI12 UP.Link/3.3.0.3', 'UP.Browser/3.04-HI12 UP.Link/3.4.4', 'UP.Browser/3.04-HI12 UP.Link/3.4.4 (Google WAP Proxy/1.0)', 'UP.Browser/3.04-HI13 UP.Link/3.4.4', 'UP.Browser/3.04-HI14 UP.Link/3.4.4', 'UP.Browser/3.04-HI14 UP.Link/3.4.5.2', 'UP.Browser/3.04-KC11 UP.Link/3.4.4', 'UP.Browser/3.04-KC12 UP.Link/3.4.4', 'UP.Browser/3.04-KC13 UP.Link/3.4.4', 'UP.Browser/3.04-KC14 UP.Link/3.4.4', 'UP.Browser/3.04-KC15 UP.Link/3.4.4', 'UP.Browser/3.04-KCT4 UP.Link/3.4.4', 'UP.Browser/3.04-KCT5 UP.Link/3.4.4', 'UP.Browser/3.04-KCT6 UP.Link/3.4.4', 'UP.Browser/3.04-KCT7 UP.Link/3.4.4', 'UP.Browser/3.04-KCT8 UP.Link/3.4.4', 'UP.Browser/3.04-KCT9 UP.Link/3.4.4', 'UP.Browser/3.04-MA11 UP.Link/3.2.2.7c', 'UP.Browser/3.04-MA11 UP.Link/3.3.0.3', 'UP.Browser/3.04-MA11 UP.Link/3.3.0.5', 'UP.Browser/3.04-MA11 UP.Link/3.4.4', 'UP.Browser/3.04-MA12 UP.Link/3.2.2.7c', 'UP.Browser/3.04-MA12 UP.Link/3.3.0.5', 'UP.Browser/3.04-MA12 UP.Link/3.4.4', 'UP.Browser/3.04-MA12 UP.Link/3.4.4 (Google WAP Proxy/1.0)', 'UP.Browser/3.04-MA13 UP.Link/3.3.0.5', 'UP.Browser/3.04-MA13 UP.Link/3.4.4', 'UP.Browser/3.04-MA13 UP.Link/3.4.4 (Google WAP Proxy/1.0)', 'UP.Browser/3.04-MA13 UP.Link/3.4.5.2', 'UP.Browser/3.04-MAC2 UP.Link/3.4.4', 'UP.Browser/3.04-MAI1 UP.Link/3.2.2.7c', 'UP.Browser/3.04-MAI2 UP.Link/3.2.2.7c', 'UP.Browser/3.04-MAI2 UP.Link/3.4.4', 'UP.Browser/3.04-MAT1 UP.Link/3.3.0.3', 'UP.Browser/3.04-MAT3 UP.Link/3.4.4', 'UP.Browser/3.04-MIT1 UP.Link/3.3.0.3', 'UP.Browser/3.04-MIT1 UP.Link/3.4.4', 'UP.Browser/3.04-MIT1 UP.Link/3.4.5.2', 'UP.Browser/3.04-SN11 UP.Link/3.2.2.7c', 'UP.Browser/3.04-SN11 UP.Link/3.3.0.3', 'UP.Browser/3.04-SN11 UP.Link/3.4.4', 'UP.Browser/3.04-SN11 UP.Link/3.4.4 (Google WAP Proxy/1.0)', 'UP.Browser/3.04-SN12 UP.Link/3.3.0.1', 'UP.Browser/3.04-SN12 UP.Link/3.3.0.5', 'UP.Browser/3.04-SN12 UP.Link/3.4.4', 'UP.Browser/3.04-SN12 UP.Link/3.4.5.2', 'UP.Browser/3.04-SN13 UP.Link/3.3.0.3', 'UP.Browser/3.04-SN13 UP.Link/3.3.0.5', 'UP.Browser/3.04-SN13 UP.Link/3.4.4', 'UP.Browser/3.04-SN14 UP.Link/3.4.4', 'UP.Browser/3.04-SN14 UP.Link/3.4.5.2', 'UP.Browser/3.04-SN15 UP.Link/3.4.4', 'UP.Browser/3.04-SN15 UP.Link/3.4.5.2', 'UP.Browser/3.04-SN16 UP.Link/3.4.4', 'UP.Browser/3.04-SN17 UP.Link/3.4.4', 'UP.Browser/3.04-SNI1 UP.Link/3.4.4', 'UP.Browser/3.04-ST11 UP.Link/3.3.0.1', 'UP.Browser/3.04-ST11 UP.Link/3.3.0.5', 'UP.Browser/3.04-ST11 UP.Link/3.4.4', 'UP.Browser/3.04-ST12 UP.Link/3.4.4', 'UP.Browser/3.04-ST13 UP.Link/3.4.4', 'UP.Browser/3.04-SY11 UP.Link/3.2.2.7c', 'UP.Browser/3.04-SY11 UP.Link/3.4.4', 'UP.Browser/3.04-SY12 UP.Link/3.3.0.1', 'UP.Browser/3.04-SY12 UP.Link/3.3.0.3', 'UP.Browser/3.04-SY12 UP.Link/3.3.0.5', 'UP.Browser/3.04-SY12 UP.Link/3.4.4', 'UP.Browser/3.04-SY12 UP.Link/3.4.5.2', 'UP.Browser/3.04-SY12 UP.Link/3.4.5.6', 'UP.Browser/3.04-SY13 UP.Link/3.4.4', 'UP.Browser/3.04-SY14 UP.Link/3.4.4', 'UP.Browser/3.04-SY15 UP.Link/3.4.4', 'UP.Browser/3.04-SYT3 UP.Link/3.4.4', 'UP.Browser/3.04-SYT3 UP.Link/3.4.5.2', 'UP.Browser/3.04-TS11 UP.Link/3.2.2.7c', 'UP.Browser/3.04-TS11 UP.Link/3.3.0.5', 'UP.Browser/3.04-TS11 UP.Link/3.4.4', 'UP.Browser/3.04-TS12 UP.Link/3.2.2.7c', 'UP.Browser/3.04-TS12 UP.Link/3.3.0.1', 'UP.Browser/3.04-TS12 UP.Link/3.3.0.3', 'UP.Browser/3.04-TS12 UP.Link/3.3.0.5', 'UP.Browser/3.04-TS12 UP.Link/3.4.4', 'UP.Browser/3.04-TS13 UP.Link/3.4.4', 'UP.Browser/3.04-TS14 UP.Link/3.4.4', 'UP.Browser/3.04-TS14 UP.Link/3.4.4 (Google WAP Proxy/1.0)', 'UP.Browser/3.04-TS14 UP.Link/3.4.5.2', 'UP.Browser/3.04-TSI1 UP.Link/3.2.2.7c', 'UP.Browser/3.04-TST3 UP.Link/3.4.4', 'UP.Browser/3.04-TST4 UP.Link/3.4.4', 'UP.Browser/3.04-TST4 UP.Link/3.4.5.2', 'UP.Browser/3.04-TST4 UP.Link/3.4.5.6', 'UP.Browser/3.04-TST5 UP.Link/3.4.4', 'UP.Browser/3.1-NT95 UP.Link/3.2', 'UP.Browser/3.1-SY11 UP.Link/3.2', 'UP.Browser/3.1-UPG1 UP.Link/3.2', 'UP.Browser/3.2.9.1-SA12 UP.Link/3.2', 'UP.Browser/3.2.9.1-UPG1 UP.Link/3.2' ); $line = 0; ++$line; print "$line: " . "Testing EZweb ...\n"; foreach ($tests as $value1) { $ua = array_shift($value1); $data = $value1; $agent = &Net_UserAgent_Mobile::factory($ua); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; ++$line; print "$line: " . $agent->getName() . "\n"; ++$line; print "$line: " . $agent->getUserAgent() . "\n"; ++$line; print "$line: " . $agent->getVersion() . "\n"; ++$line; print "$line: " . $agent->getDeviceID() . "\n"; ++$line; print "$line: " . $agent->getServer() . "\n"; ++$line; print "$line: " . $agent->isXHTMLCompliant() . "\n"; ++$line; print "$line: " . $agent->getComment() . "\n"; ++$line; print "$line: " . $agent->isWAP1() . "\n"; ++$line; print "$line: " . $agent->isWAP2() . "\n"; } foreach ($test_agents as $value) { $_SERVER['HTTP_USER_AGENT'] = $value; $agent = &Net_UserAgent_Mobile::factory(); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->getName() . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; } ?> --POST-- --GET-- --EXPECT-- 1: Testing EZweb ... 2: 1 3: net_useragent_mobile_common 4: net_useragent_mobile_ezweb 5: 6: 7: 1 8: UP.Browser 9: UP.Browser/3.01-HI01 UP.Link/3.4.5.2 10: 3.01 11: HI01 12: UP.Link/3.4.5.2 13: 14: 15: 1 16: 17: 1 18: net_useragent_mobile_common 19: net_useragent_mobile_ezweb 20: 21: 22: 1 23: UP.Browser 24: KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 25: 6.0.2.276 26: TS21 27: MMP/1.1 28: 1 29: 30: 31: 1 32: 1 33: net_useragent_mobile_common 34: net_useragent_mobile_ezweb 35: 36: 37: 1 38: UP.Browser 39: UP.Browser/3.04-TS14 UP.Link/3.4.4 (Google WAP Proxy/1.0) 40: 3.04 41: TS14 42: UP.Link/3.4.4 43: 44: Google WAP Proxy/1.0 45: 1 46: 47: 1 48: net_useragent_mobile_common 49: net_useragent_mobile_ezweb 50: UP.Browser 51: 52: 53: 1 54: 1 55: net_useragent_mobile_common 56: net_useragent_mobile_ezweb 57: UP.Browser 58: 59: 60: 1 61: 1 62: net_useragent_mobile_common 63: net_useragent_mobile_ezweb 64: UP.Browser 65: 66: 67: 1 68: 1 69: net_useragent_mobile_common 70: net_useragent_mobile_ezweb 71: UP.Browser 72: 73: 74: 1 75: 1 76: net_useragent_mobile_common 77: net_useragent_mobile_ezweb 78: UP.Browser 79: 80: 81: 1 82: 1 83: net_useragent_mobile_common 84: net_useragent_mobile_ezweb 85: UP.Browser 86: 87: 88: 1 89: 1 90: net_useragent_mobile_common 91: net_useragent_mobile_ezweb 92: UP.Browser 93: 94: 95: 1 96: 1 97: net_useragent_mobile_common 98: net_useragent_mobile_ezweb 99: UP.Browser 100: 101: 102: 1 103: 1 104: net_useragent_mobile_common 105: net_useragent_mobile_ezweb 106: UP.Browser 107: 108: 109: 1 110: 1 111: net_useragent_mobile_common 112: net_useragent_mobile_ezweb 113: UP.Browser 114: 115: 116: 1 117: 1 118: net_useragent_mobile_common 119: net_useragent_mobile_ezweb 120: UP.Browser 121: 122: 123: 1 124: 1 125: net_useragent_mobile_common 126: net_useragent_mobile_ezweb 127: UP.Browser 128: 129: 130: 1 131: 1 132: net_useragent_mobile_common 133: net_useragent_mobile_ezweb 134: UP.Browser 135: 136: 137: 1 138: 1 139: net_useragent_mobile_common 140: net_useragent_mobile_ezweb 141: UP.Browser 142: 143: 144: 1 145: 1 146: net_useragent_mobile_common 147: net_useragent_mobile_ezweb 148: UP.Browser 149: 150: 151: 1 152: 1 153: net_useragent_mobile_common 154: net_useragent_mobile_ezweb 155: UP.Browser 156: 157: 158: 1 159: 1 160: net_useragent_mobile_common 161: net_useragent_mobile_ezweb 162: UP.Browser 163: 164: 165: 1 166: 1 167: net_useragent_mobile_common 168: net_useragent_mobile_ezweb 169: UP.Browser 170: 171: 172: 1 173: 1 174: net_useragent_mobile_common 175: net_useragent_mobile_ezweb 176: UP.Browser 177: 178: 179: 1 180: 1 181: net_useragent_mobile_common 182: net_useragent_mobile_ezweb 183: UP.Browser 184: 185: 186: 1 187: 1 188: net_useragent_mobile_common 189: net_useragent_mobile_ezweb 190: UP.Browser 191: 192: 193: 1 194: 1 195: net_useragent_mobile_common 196: net_useragent_mobile_ezweb 197: UP.Browser 198: 199: 200: 1 201: 1 202: net_useragent_mobile_common 203: net_useragent_mobile_ezweb 204: UP.Browser 205: 206: 207: 1 208: 1 209: net_useragent_mobile_common 210: net_useragent_mobile_ezweb 211: UP.Browser 212: 213: 214: 1 215: 1 216: net_useragent_mobile_common 217: net_useragent_mobile_ezweb 218: UP.Browser 219: 220: 221: 1 222: 1 223: net_useragent_mobile_common 224: net_useragent_mobile_ezweb 225: UP.Browser 226: 227: 228: 1 229: 1 230: net_useragent_mobile_common 231: net_useragent_mobile_ezweb 232: UP.Browser 233: 234: 235: 1 236: 1 237: net_useragent_mobile_common 238: net_useragent_mobile_ezweb 239: UP.Browser 240: 241: 242: 1 243: 1 244: net_useragent_mobile_common 245: net_useragent_mobile_ezweb 246: UP.Browser 247: 248: 249: 1 250: 1 251: net_useragent_mobile_common 252: net_useragent_mobile_ezweb 253: UP.Browser 254: 255: 256: 1 257: 1 258: net_useragent_mobile_common 259: net_useragent_mobile_ezweb 260: UP.Browser 261: 262: 263: 1 264: 1 265: net_useragent_mobile_common 266: net_useragent_mobile_ezweb 267: UP.Browser 268: 269: 270: 1 271: 1 272: net_useragent_mobile_common 273: net_useragent_mobile_ezweb 274: UP.Browser 275: 276: 277: 1 278: 1 279: net_useragent_mobile_common 280: net_useragent_mobile_ezweb 281: UP.Browser 282: 283: 284: 1 285: 1 286: net_useragent_mobile_common 287: net_useragent_mobile_ezweb 288: UP.Browser 289: 290: 291: 1 292: 1 293: net_useragent_mobile_common 294: net_useragent_mobile_ezweb 295: UP.Browser 296: 297: 298: 1 299: 1 300: net_useragent_mobile_common 301: net_useragent_mobile_ezweb 302: UP.Browser 303: 304: 305: 1 306: 1 307: net_useragent_mobile_common 308: net_useragent_mobile_ezweb 309: UP.Browser 310: 311: 312: 1 313: 1 314: net_useragent_mobile_common 315: net_useragent_mobile_ezweb 316: UP.Browser 317: 318: 319: 1 320: 1 321: net_useragent_mobile_common 322: net_useragent_mobile_ezweb 323: UP.Browser 324: 325: 326: 1 327: 1 328: net_useragent_mobile_common 329: net_useragent_mobile_ezweb 330: UP.Browser 331: 332: 333: 1 334: 1 335: net_useragent_mobile_common 336: net_useragent_mobile_ezweb 337: UP.Browser 338: 339: 340: 1 341: 1 342: net_useragent_mobile_common 343: net_useragent_mobile_ezweb 344: UP.Browser 345: 346: 347: 1 348: 1 349: net_useragent_mobile_common 350: net_useragent_mobile_ezweb 351: UP.Browser 352: 353: 354: 1 355: 1 356: net_useragent_mobile_common 357: net_useragent_mobile_ezweb 358: UP.Browser 359: 360: 361: 1 362: 1 363: net_useragent_mobile_common 364: net_useragent_mobile_ezweb 365: UP.Browser 366: 367: 368: 1 369: 1 370: net_useragent_mobile_common 371: net_useragent_mobile_ezweb 372: UP.Browser 373: 374: 375: 1 376: 1 377: net_useragent_mobile_common 378: net_useragent_mobile_ezweb 379: UP.Browser 380: 381: 382: 1 383: 1 384: net_useragent_mobile_common 385: net_useragent_mobile_ezweb 386: UP.Browser 387: 388: 389: 1 390: 1 391: net_useragent_mobile_common 392: net_useragent_mobile_ezweb 393: UP.Browser 394: 395: 396: 1 397: 1 398: net_useragent_mobile_common 399: net_useragent_mobile_ezweb 400: UP.Browser 401: 402: 403: 1 404: 1 405: net_useragent_mobile_common 406: net_useragent_mobile_ezweb 407: UP.Browser 408: 409: 410: 1 411: 1 412: net_useragent_mobile_common 413: net_useragent_mobile_ezweb 414: UP.Browser 415: 416: 417: 1 418: 1 419: net_useragent_mobile_common 420: net_useragent_mobile_ezweb 421: UP.Browser 422: 423: 424: 1 425: 1 426: net_useragent_mobile_common 427: net_useragent_mobile_ezweb 428: UP.Browser 429: 430: 431: 1 432: 1 433: net_useragent_mobile_common 434: net_useragent_mobile_ezweb 435: UP.Browser 436: 437: 438: 1 439: 1 440: net_useragent_mobile_common 441: net_useragent_mobile_ezweb 442: UP.Browser 443: 444: 445: 1 446: 1 447: net_useragent_mobile_common 448: net_useragent_mobile_ezweb 449: UP.Browser 450: 451: 452: 1 453: 1 454: net_useragent_mobile_common 455: net_useragent_mobile_ezweb 456: UP.Browser 457: 458: 459: 1 460: 1 461: net_useragent_mobile_common 462: net_useragent_mobile_ezweb 463: UP.Browser 464: 465: 466: 1 467: 1 468: net_useragent_mobile_common 469: net_useragent_mobile_ezweb 470: UP.Browser 471: 472: 473: 1 474: 1 475: net_useragent_mobile_common 476: net_useragent_mobile_ezweb 477: UP.Browser 478: 479: 480: 1 481: 1 482: net_useragent_mobile_common 483: net_useragent_mobile_ezweb 484: UP.Browser 485: 486: 487: 1 488: 1 489: net_useragent_mobile_common 490: net_useragent_mobile_ezweb 491: UP.Browser 492: 493: 494: 1 495: 1 496: net_useragent_mobile_common 497: net_useragent_mobile_ezweb 498: UP.Browser 499: 500: 501: 1 502: 1 503: net_useragent_mobile_common 504: net_useragent_mobile_ezweb 505: UP.Browser 506: 507: 508: 1 509: 1 510: net_useragent_mobile_common 511: net_useragent_mobile_ezweb 512: UP.Browser 513: 514: 515: 1 516: 1 517: net_useragent_mobile_common 518: net_useragent_mobile_ezweb 519: UP.Browser 520: 521: 522: 1 523: 1 524: net_useragent_mobile_common 525: net_useragent_mobile_ezweb 526: UP.Browser 527: 528: 529: 1 530: 1 531: net_useragent_mobile_common 532: net_useragent_mobile_ezweb 533: UP.Browser 534: 535: 536: 1 537: 1 538: net_useragent_mobile_common 539: net_useragent_mobile_ezweb 540: UP.Browser 541: 542: 543: 1 544: 1 545: net_useragent_mobile_common 546: net_useragent_mobile_ezweb 547: UP.Browser 548: 549: 550: 1 551: 1 552: net_useragent_mobile_common 553: net_useragent_mobile_ezweb 554: UP.Browser 555: 556: 557: 1 558: 1 559: net_useragent_mobile_common 560: net_useragent_mobile_ezweb 561: UP.Browser 562: 563: 564: 1 565: 1 566: net_useragent_mobile_common 567: net_useragent_mobile_ezweb 568: UP.Browser 569: 570: 571: 1 572: 1 573: net_useragent_mobile_common 574: net_useragent_mobile_ezweb 575: UP.Browser 576: 577: 578: 1 579: 1 580: net_useragent_mobile_common 581: net_useragent_mobile_ezweb 582: UP.Browser 583: 584: 585: 1 586: 1 587: net_useragent_mobile_common 588: net_useragent_mobile_ezweb 589: UP.Browser 590: 591: 592: 1 593: 1 594: net_useragent_mobile_common 595: net_useragent_mobile_ezweb 596: UP.Browser 597: 598: 599: 1 600: 1 601: net_useragent_mobile_common 602: net_useragent_mobile_ezweb 603: UP.Browser 604: 605: 606: 1 607: 1 608: net_useragent_mobile_common 609: net_useragent_mobile_ezweb 610: UP.Browser 611: 612: 613: 1 614: 1 615: net_useragent_mobile_common 616: net_useragent_mobile_ezweb 617: UP.Browser 618: 619: 620: 1 621: 1 622: net_useragent_mobile_common 623: net_useragent_mobile_ezweb 624: UP.Browser 625: 626: 627: 1 628: 1 629: net_useragent_mobile_common 630: net_useragent_mobile_ezweb 631: UP.Browser 632: 633: 634: 1 635: 1 636: net_useragent_mobile_common 637: net_useragent_mobile_ezweb 638: UP.Browser 639: 640: 641: 1 642: 1 643: net_useragent_mobile_common 644: net_useragent_mobile_ezweb 645: UP.Browser 646: 647: 648: 1 649: 1 650: net_useragent_mobile_common 651: net_useragent_mobile_ezweb 652: UP.Browser 653: 654: 655: 1 656: 1 657: net_useragent_mobile_common 658: net_useragent_mobile_ezweb 659: UP.Browser 660: 661: 662: 1 663: 1 664: net_useragent_mobile_common 665: net_useragent_mobile_ezweb 666: UP.Browser 667: 668: 669: 1 670: 1 671: net_useragent_mobile_common 672: net_useragent_mobile_ezweb 673: UP.Browser 674: 675: 676: 1 677: 1 678: net_useragent_mobile_common 679: net_useragent_mobile_ezweb 680: UP.Browser 681: 682: 683: 1 684: 1 685: net_useragent_mobile_common 686: net_useragent_mobile_ezweb 687: UP.Browser 688: 689: 690: 1 691: 1 692: net_useragent_mobile_common 693: net_useragent_mobile_ezweb 694: UP.Browser 695: 696: 697: 1 698: 1 699: net_useragent_mobile_common 700: net_useragent_mobile_ezweb 701: UP.Browser 702: 703: 704: 1 705: 1 706: net_useragent_mobile_common 707: net_useragent_mobile_ezweb 708: UP.Browser 709: 710: 711: 1 712: 1 713: net_useragent_mobile_common 714: net_useragent_mobile_ezweb 715: UP.Browser 716: 717: 718: 1 719: 1 720: net_useragent_mobile_common 721: net_useragent_mobile_ezweb 722: UP.Browser 723: 724: 725: 1 726: 1 727: net_useragent_mobile_common 728: net_useragent_mobile_ezweb 729: UP.Browser 730: 731: 732: 1 733: 1 734: net_useragent_mobile_common 735: net_useragent_mobile_ezweb 736: UP.Browser 737: 738: 739: 1 740: 1 741: net_useragent_mobile_common 742: net_useragent_mobile_ezweb 743: UP.Browser 744: 745: 746: 1 747: 1 748: net_useragent_mobile_common 749: net_useragent_mobile_ezweb 750: UP.Browser 751: 752: 753: 1 754: 1 755: net_useragent_mobile_common 756: net_useragent_mobile_ezweb 757: UP.Browser 758: 759: 760: 1 761: 1 762: net_useragent_mobile_common 763: net_useragent_mobile_ezweb 764: UP.Browser 765: 766: 767: 1 768: 1 769: net_useragent_mobile_common 770: net_useragent_mobile_ezweb 771: UP.Browser 772: 773: 774: 1 775: 1 776: net_useragent_mobile_common 777: net_useragent_mobile_ezweb 778: UP.Browser 779: 780: 781: 1 782: 1 783: net_useragent_mobile_common 784: net_useragent_mobile_ezweb 785: UP.Browser 786: 787: 788: 1 789: 1 790: net_useragent_mobile_common 791: net_useragent_mobile_ezweb 792: UP.Browser 793: 794: 795: 1 796: 1 797: net_useragent_mobile_common 798: net_useragent_mobile_ezweb 799: UP.Browser 800: 801: 802: 1 803: 1 804: net_useragent_mobile_common 805: net_useragent_mobile_ezweb 806: UP.Browser 807: 808: 809: 1 810: 1 811: net_useragent_mobile_common 812: net_useragent_mobile_ezweb 813: UP.Browser 814: 815: 816: 1 817: 1 818: net_useragent_mobile_common 819: net_useragent_mobile_ezweb 820: UP.Browser 821: 822: 823: 1 824: 1 825: net_useragent_mobile_common 826: net_useragent_mobile_ezweb 827: UP.Browser 828: 829: 830: 1 831: 1 832: net_useragent_mobile_common 833: net_useragent_mobile_ezweb 834: UP.Browser 835: 836: 837: 1 838: 1 839: net_useragent_mobile_common 840: net_useragent_mobile_ezweb 841: UP.Browser 842: 843: 844: 1 845: 1 846: net_useragent_mobile_common 847: net_useragent_mobile_ezweb 848: UP.Browser 849: 850: 851: 1 852: 1 853: net_useragent_mobile_common 854: net_useragent_mobile_ezweb 855: UP.Browser 856: 857: 858: 1 859: 1 860: net_useragent_mobile_common 861: net_useragent_mobile_ezweb 862: UP.Browser 863: 864: 865: 1 866: 1 867: net_useragent_mobile_common 868: net_useragent_mobile_ezweb 869: UP.Browser 870: 871: 872: 1 873: 1 874: net_useragent_mobile_common 875: net_useragent_mobile_ezweb 876: UP.Browser 877: 878: 879: 1 880: 1 881: net_useragent_mobile_common 882: net_useragent_mobile_ezweb 883: UP.Browser 884: 885: 886: 1 887: 1 888: net_useragent_mobile_common 889: net_useragent_mobile_ezweb 890: UP.Browser 891: 892: 893: 1 894: 1 895: net_useragent_mobile_common 896: net_useragent_mobile_ezweb 897: UP.Browser 898: 899: 900: 1 901: 1 902: net_useragent_mobile_common 903: net_useragent_mobile_ezweb 904: UP.Browser 905: 906: 907: 1 908: 1 909: net_useragent_mobile_common 910: net_useragent_mobile_ezweb 911: UP.Browser 912: 913: 914: 1 915: 1 916: net_useragent_mobile_common 917: net_useragent_mobile_ezweb 918: UP.Browser 919: 920: 921: 1 922: 1 923: net_useragent_mobile_common 924: net_useragent_mobile_ezweb 925: UP.Browser 926: 927: 928: 1 929: 1 930: net_useragent_mobile_common 931: net_useragent_mobile_ezweb 932: UP.Browser 933: 934: 935: 1 936: 1 937: net_useragent_mobile_common 938: net_useragent_mobile_ezweb 939: UP.Browser 940: 941: 942: 1 943: 1 944: net_useragent_mobile_common 945: net_useragent_mobile_ezweb 946: UP.Browser 947: 948: 949: 1 950: 1 951: net_useragent_mobile_common 952: net_useragent_mobile_ezweb 953: UP.Browser 954: 955: 956: 1 957: 1 958: net_useragent_mobile_common 959: net_useragent_mobile_ezweb 960: UP.Browser 961: 962: 963: 1 964: 1 965: net_useragent_mobile_common 966: net_useragent_mobile_ezweb 967: UP.Browser 968: 969: 970: 1 971: 1 972: net_useragent_mobile_common 973: net_useragent_mobile_ezweb 974: UP.Browser 975: 976: 977: 1 978: 1 979: net_useragent_mobile_common 980: net_useragent_mobile_ezweb 981: UP.Browser 982: 983: 984: 1 985: 1 986: net_useragent_mobile_common 987: net_useragent_mobile_ezweb 988: UP.Browser 989: 990: 991: 1 992: 1 993: net_useragent_mobile_common 994: net_useragent_mobile_ezweb 995: UP.Browser 996: 997: 998: 1 999: 1 1000: net_useragent_mobile_common 1001: net_useragent_mobile_ezweb 1002: UP.Browser 1003: 1004: 1005: 1 1006: 1 1007: net_useragent_mobile_common 1008: net_useragent_mobile_ezweb 1009: UP.Browser 1010: 1011: 1012: 1 1013: 1 1014: net_useragent_mobile_common 1015: net_useragent_mobile_ezweb 1016: UP.Browser 1017: 1018: 1019: 1 1020: 1 1021: net_useragent_mobile_common 1022: net_useragent_mobile_ezweb 1023: UP.Browser 1024: 1025: 1026: 1 1027: 1 1028: net_useragent_mobile_common 1029: net_useragent_mobile_ezweb 1030: UP.Browser 1031: 1032: 1033: 1 1034: 1 1035: net_useragent_mobile_common 1036: net_useragent_mobile_ezweb 1037: UP.Browser 1038: 1039: 1040: 1 Index: pear/Net_UserAgent_Mobile/tests/05-display.phpt +++ pear/Net_UserAgent_Mobile/tests/05-display.phpt --TEST-- Net_UserAgent_Mobile: Display --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - Display // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); $tests = array( array( array( 'HTTP_X_JPHONE_DISPLAY' => '120*117', 'HTTP_USER_AGENT' => 'J-PHONE/2.0/J-DN02', 'HTTP_X_JPHONE_COLOR' => 'C256' ), array('width' => 120, 'height' => 117, 'color' => TRUE, 'depth' => 256. ) ), array( array( 'HTTP_X_UP_DEVCAP_SCREENPIXELS' => '90,70', 'HTTP_USER_AGENT' => 'KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1', 'HTTP_X_UP_DEVCAP_SCREENDEPTH' => '16,RGB565', 'HTTP_X_UP_DEVCAP_ISCOLOR' => '1' ), array( 'width' => 90, 'height' => 70, 'color' => TRUE, 'depth' => pow(2, 16) ) ), array( array( 'HTTP_X_UP_DEVCAP_SCREENPIXELS' => '90,70', 'HTTP_USER_AGENT' => 'KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1', 'HTTP_X_UP_DEVCAP_SCREENDEPTH' => '1', 'HTTP_X_UP_DEVCAP_ISCOLOR' => '0' ), array( 'width' => 90, 'height' => 70, 'color' => FALSE, 'depth' => 2 ) ), array( array('HTTP_USER_AGENT' => 'DoCoMo/1.0/D501i'), array( 'width' => 96, 'height' => 72, 'color' => FALSE, 'depth' => 2 ) ), array( array('HTTP_USER_AGENT' => 'DoCoMo/1.0/D502i'), array( 'width' => 96, 'height' => 90, 'color' => TRUE, 'depth' => 256 ) ), array( array('HTTP_USER_AGENT' => 'DoCoMo/1.0/N502i'), array( 'width' => 118, 'height' => 128, 'color' => FALSE, 'depth' => 4 ) ) ); $line = 0; ++$line; print "$line: " . "Testing Display ...\n"; foreach ($tests as $value1) { $_SERVER = $value1[0]; $values = $value1[1]; $agent = &Net_UserAgent_Mobile::factory(); $display = $agent->getDisplay(); ++$line; print "$line: " . is_object($display) . "\n"; ++$line; print "$line: " . get_class($display) . "\n"; foreach ($values as $key => $value) { switch ($key) { case 'width': ++$line; print "$line: " . $display->getWidth() . "\n"; break; case 'height': ++$line; print "$line: " . $display->getHeight() . "\n"; break; case 'color': ++$line; print "$line: " . $display->isColor() . "\n"; break; case 'depth': ++$line; print "$line: " . $display->getDepth() . "\n"; break; } } } ?> --POST-- --GET-- --EXPECT-- 1: Testing Display ... 2: 1 3: net_useragent_mobile_display 4: 120 5: 117 6: 1 7: 256 8: 1 9: net_useragent_mobile_display 10: 90 11: 70 12: 1 13: 65536 14: 1 15: net_useragent_mobile_display 16: 90 17: 70 18: 19: 2 20: 1 21: net_useragent_mobile_display 22: 96 23: 72 24: 25: 2 26: 1 27: net_useragent_mobile_display 28: 96 29: 90 30: 1 31: 256 32: 1 33: net_useragent_mobile_display 34: 118 35: 128 36: 37: 4 Index: pear/Net_UserAgent_Mobile/tests/06-nonmobile.phpt +++ pear/Net_UserAgent_Mobile/tests/06-nonmobile.phpt --TEST-- Net_UserAgent_Mobile: NonMobile --SKIPIF-- <?php if (!@include('Net/UserAgent/Mobile.php')) print 'skip'; ?> --FILE-- <?php // // Test for: Net/UserAgent/Mobile.php // Parts tested: - NonMobile // error_reporting(E_ALL); require_once('Net/UserAgent/Mobile.php'); $test_agents = array( 'Mozilla/2.0 (compatible; Ask Jeeves)', 'Mozilla/2.0 (compatible; MSIE 3.01; Windows 95)', 'Mozilla/2.0 (compatible; MSIE 3.02; Windows CE)', 'Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320)', 'Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; 240x320; PPC)', 'Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)', 'Mozilla/2.0 (compatible; T-H-U-N-D-E-R-S-T-O-N-E)', 'Mozilla/3.0 (DreamPassport/3.0)', 'Mozilla/3.0 (DreamPassport/3.15; SONICTEAM/PSOV2)', 'Mozilla/3.0 (DreamPassport/3.2)', 'Mozilla/3.0 (Slurp.so/Goo; slurp@inktomi.com; http://www.inktomi.com/slurp.html)', 'Mozilla/3.0 (Slurp/si; slurp@inktomi.com; http://www.inktomi.com/slurp.html)', 'Mozilla/3.0 (Win95; I)', 'Mozilla/3.0 (Windows 2000; U) Opera 6.05 [ja]', 'Mozilla/3.0 (aruyo/0.01;http://www.aaacafe.ne.jp/ ;support@aaacafe.ne.jp)', 'Mozilla/3.0 (compatible)', 'Mozilla/3.0 (compatible; Indy Library)', 'Mozilla/3.0 (compatible; NetMind-Minder/4.3.1J)', 'Mozilla/3.0 (compatible; NetPositive/2.2.1; BeOS)', 'Mozilla/3.0 (compatible; PerMan Surfer 3.0; Win95)', 'Mozilla/3.0 (compatible;)', 'Mozilla/3.01 (compatible;)', 'Mozilla/3.01 [ja] (Macintosh; I; 68K)', 'Mozilla/3.01Gold (Macintosh; I; 68K)', 'Mozilla/3.01Gold (Macintosh; I; 68K; SiteCoach 1.0)', 'Mozilla/4.0', 'Mozilla/4.0 (LINKS ARoMATIZED)', 'Mozilla/4.0 (PDA; SL-A300/1.0,Embedix/Qtopia/1.1.0) NetFront/3.0', 'Mozilla/4.0 (PDA; Windows CE/0.9.3) NetFront/3.0', 'Mozilla/4.0 (Windows NT 4.0)', 'Mozilla/4.0 (compatible', 'Mozilla/4.0 (compatible; MSIE 4.01; MSN 2.5; Windows 95)', 'Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)', 'Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 4.01; Windows NT Windows CE)', 'Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)', 'Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)', 'Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.01; MSN 2.5; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; HKBN)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; MSIECrawler)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; MSOCD; AtHomeJP0109)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; Q312461)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; YComp 5.0.2.4)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; istb 641)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) LinkChecker 0.1', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) WebWasher 3.2', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; NetCaptor 7.0.1)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; istb 641)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; Lunascape 0.99c)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; Norfolk Southern Corp.)', 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; nk-07102k)', 'Mozilla/4.0 (compatible; MSIE 5.0; AOL 7.0; Windows 98; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.0; Linux 2.2.18-0vl4.2 i686) Opera 6.0 [en]', 'Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC; AtHomeJP191)', 'Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC;)', 'Mozilla/4.0 (compatible; MSIE 5.0; Win32)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.03 [en]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.03 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.05 [en]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.05 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 95)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 5.12 [es]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 6.03 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 6.05 [en]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 6.05 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)::ELNSB50::0000211003200258031a018f000000000505000b00000000', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; YComp 5.0.0.0)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; Hotbar 3.0)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows ME) Opera 6.03 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows ME) Opera 6.05 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 6.0 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 6.01 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 6.03 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 6.05 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt; DTS Agent', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.01 [de]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.03 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.04 [en]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.04 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.05 [ja]', 'Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.14; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.16; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.21; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.2; Mac_PowerPC)', 'Mozilla/4.0 (compatible; MSIE 5.2; Mac_PowerPC) OmniWeb/4.1.1-v424.6', 'Mozilla/4.0 (compatible; MSIE 5.5; AOL 6.0; Windows 98; Win 9x 4.90)', 'Mozilla/4.0 (compatible; MSIE 5.5; MSN 2.5; AOL 7.0; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.5; MSN 2.5; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; YComp 5.0.0.0)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; ie5.5cd_t-zone_0005)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; H010818)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; MSIECrawler)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; MSN 6.1; MSNbMSFT; MSNmja-jp; MSNc00)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; MSOCD; AtHomeJP191)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Q312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Q312461; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461; istb 641)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461; istb 641; COM+ 1.0.2204)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; Lunascape 0.98d)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; MSOCD; AtHomeJP0109)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; Q312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; Q312461; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; T312461; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; T312461; Lunascape 0', '.99c)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; Unithink)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; telus.net_v5.0.1; Hotbar 4.0)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; telus.net_v5.0.1)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; H010818)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; H010818; CPT-IE401SP1; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; SenseWave 1.0)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; Suncorp Metway Ltd)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; T312461; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; T312461; Lunascape 0.95a)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; Yahoo! JAPAN Version Windows 95/NT CD-ROM Edition 1.0.)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; (R1 1.1))', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; (R1 1.1); (R1 1.3))', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; (R1 1.3))', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; AIRF)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; DigExt)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; FORJEIS55SP1)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; H010818)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Hotbar 3.0; istb 641)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Hotbar 4.1.7.0)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Lunascape 0.98c)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; N_o_k_i_a)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Q312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Q312461; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461; .NET CLR 1.0.3705)', 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461; Hewle' ); $line = 0; ++$line; print "$line: " ."Testing NonMobile ...\n"; $ua = 'Mozilla/1.0'; $agent = &Net_UserAgent_Mobile::factory($ua); foreach ($test_agents as $value) { $_SERVER['HTTP_USER_AGENT'] = $value; $agent = &Net_UserAgent_Mobile::factory(); ++$line; print "$line: " . is_object($agent) . "\n"; ++$line; print "$line: " . get_parent_class($agent) . "\n"; ++$line; print "$line: " . get_class($agent) . "\n"; ++$line; print "$line: " . $agent->isDoCoMo() . "\n"; ++$line; print "$line: " . $agent->isJPhone() . "\n"; ++$line; print "$line: " . $agent->isEZweb() . "\n"; } ?> --POST-- --GET-- --EXPECT-- 1: Testing NonMobile ... 2: 1 3: net_useragent_mobile_common 4: net_useragent_mobile_nonmobile 5: 6: 7: 8: 1 9: net_useragent_mobile_common 10: net_useragent_mobile_nonmobile 11: 12: 13: 14: 1 15: net_useragent_mobile_common 16: net_useragent_mobile_nonmobile 17: 18: 19: 20: 1 21: net_useragent_mobile_common 22: net_useragent_mobile_nonmobile 23: 24: 25: 26: 1 27: net_useragent_mobile_common 28: net_useragent_mobile_nonmobile 29: 30: 31: 32: 1 33: net_useragent_mobile_common 34: net_useragent_mobile_nonmobile 35: 36: 37: 38: 1 39: net_useragent_mobile_common 40: net_useragent_mobile_nonmobile 41: 42: 43: 44: 1 45: net_useragent_mobile_common 46: net_useragent_mobile_nonmobile 47: 48: 49: 50: 1 51: net_useragent_mobile_common 52: net_useragent_mobile_nonmobile 53: 54: 55: 56: 1 57: net_useragent_mobile_common 58: net_useragent_mobile_nonmobile 59: 60: 61: 62: 1 63: net_useragent_mobile_common 64: net_useragent_mobile_nonmobile 65: 66: 67: 68: 1 69: net_useragent_mobile_common 70: net_useragent_mobile_nonmobile 71: 72: 73: 74: 1 75: net_useragent_mobile_common 76: net_useragent_mobile_nonmobile 77: 78: 79: 80: 1 81: net_useragent_mobile_common 82: net_useragent_mobile_nonmobile 83: 84: 85: 86: 1 87: net_useragent_mobile_common 88: net_useragent_mobile_nonmobile 89: 90: 91: 92: 1 93: net_useragent_mobile_common 94: net_useragent_mobile_nonmobile 95: 96: 97: 98: 1 99: net_useragent_mobile_common 100: net_useragent_mobile_nonmobile 101: 102: 103: 104: 1 105: net_useragent_mobile_common 106: net_useragent_mobile_nonmobile 107: 108: 109: 110: 1 111: net_useragent_mobile_common 112: net_useragent_mobile_nonmobile 113: 114: 115: 116: 1 117: net_useragent_mobile_common 118: net_useragent_mobile_nonmobile 119: 120: 121: 122: 1 123: net_useragent_mobile_common 124: net_useragent_mobile_nonmobile 125: 126: 127: 128: 1 129: net_useragent_mobile_common 130: net_useragent_mobile_nonmobile 131: 132: 133: 134: 1 135: net_useragent_mobile_common 136: net_useragent_mobile_nonmobile 137: 138: 139: 140: 1 141: net_useragent_mobile_common 142: net_useragent_mobile_nonmobile 143: 144: 145: 146: 1 147: net_useragent_mobile_common 148: net_useragent_mobile_nonmobile 149: 150: 151: 152: 1 153: net_useragent_mobile_common 154: net_useragent_mobile_nonmobile 155: 156: 157: 158: 1 159: net_useragent_mobile_common 160: net_useragent_mobile_nonmobile 161: 162: 163: 164: 1 165: net_useragent_mobile_common 166: net_useragent_mobile_nonmobile 167: 168: 169: 170: 1 171: net_useragent_mobile_common 172: net_useragent_mobile_nonmobile 173: 174: 175: 176: 1 177: net_useragent_mobile_common 178: net_useragent_mobile_nonmobile 179: 180: 181: 182: 1 183: net_useragent_mobile_common 184: net_useragent_mobile_nonmobile 185: 186: 187: 188: 1 189: net_useragent_mobile_common 190: net_useragent_mobile_nonmobile 191: 192: 193: 194: 1 195: net_useragent_mobile_common 196: net_useragent_mobile_nonmobile 197: 198: 199: 200: 1 201: net_useragent_mobile_common 202: net_useragent_mobile_nonmobile 203: 204: 205: 206: 1 207: net_useragent_mobile_common 208: net_useragent_mobile_nonmobile 209: 210: 211: 212: 1 213: net_useragent_mobile_common 214: net_useragent_mobile_nonmobile 215: 216: 217: 218: 1 219: net_useragent_mobile_common 220: net_useragent_mobile_nonmobile 221: 222: 223: 224: 1 225: net_useragent_mobile_common 226: net_useragent_mobile_nonmobile 227: 228: 229: 230: 1 231: net_useragent_mobile_common 232: net_useragent_mobile_nonmobile 233: 234: 235: 236: 1 237: net_useragent_mobile_common 238: net_useragent_mobile_nonmobile 239: 240: 241: 242: 1 243: net_useragent_mobile_common 244: net_useragent_mobile_nonmobile 245: 246: 247: 248: 1 249: net_useragent_mobile_common 250: net_useragent_mobile_nonmobile 251: 252: 253: 254: 1 255: net_useragent_mobile_common 256: net_useragent_mobile_nonmobile 257: 258: 259: 260: 1 261: net_useragent_mobile_common 262: net_useragent_mobile_nonmobile 263: 264: 265: 266: 1 267: net_useragent_mobile_common 268: net_useragent_mobile_nonmobile 269: 270: 271: 272: 1 273: net_useragent_mobile_common 274: net_useragent_mobile_nonmobile 275: 276: 277: 278: 1 279: net_useragent_mobile_common 280: net_useragent_mobile_nonmobile 281: 282: 283: 284: 1 285: net_useragent_mobile_common 286: net_useragent_mobile_nonmobile 287: 288: 289: 290: 1 291: net_useragent_mobile_common 292: net_useragent_mobile_nonmobile 293: 294: 295: 296: 1 297: net_useragent_mobile_common 298: net_useragent_mobile_nonmobile 299: 300: 301: 302: 1 303: net_useragent_mobile_common 304: net_useragent_mobile_nonmobile 305: 306: 307: 308: 1 309: net_useragent_mobile_common 310: net_useragent_mobile_nonmobile 311: 312: 313: 314: 1 315: net_useragent_mobile_common 316: net_useragent_mobile_nonmobile 317: 318: 319: 320: 1 321: net_useragent_mobile_common 322: net_useragent_mobile_nonmobile 323: 324: 325: 326: 1 327: net_useragent_mobile_common 328: net_useragent_mobile_nonmobile 329: 330: 331: 332: 1 333: net_useragent_mobile_common 334: net_useragent_mobile_nonmobile 335: 336: 337: 338: 1 339: net_useragent_mobile_common 340: net_useragent_mobile_nonmobile 341: 342: 343: 344: 1 345: net_useragent_mobile_common 346: net_useragent_mobile_nonmobile 347: 348: 349: 350: 1 351: net_useragent_mobile_common 352: net_useragent_mobile_nonmobile 353: 354: 355: 356: 1 357: net_useragent_mobile_common 358: net_useragent_mobile_nonmobile 359: 360: 361: 362: 1 363: net_useragent_mobile_common 364: net_useragent_mobile_nonmobile 365: 366: 367: 368: 1 369: net_useragent_mobile_common 370: net_useragent_mobile_nonmobile 371: 372: 373: 374: 1 375: net_useragent_mobile_common 376: net_useragent_mobile_nonmobile 377: 378: 379: 380: 1 381: net_useragent_mobile_common 382: net_useragent_mobile_nonmobile 383: 384: 385: 386: 1 387: net_useragent_mobile_common 388: net_useragent_mobile_nonmobile 389: 390: 391: 392: 1 393: net_useragent_mobile_common 394: net_useragent_mobile_nonmobile 395: 396: 397: 398: 1 399: net_useragent_mobile_common 400: net_useragent_mobile_nonmobile 401: 402: 403: 404: 1 405: net_useragent_mobile_common 406: net_useragent_mobile_nonmobile 407: 408: 409: 410: 1 411: net_useragent_mobile_common 412: net_useragent_mobile_nonmobile 413: 414: 415: 416: 1 417: net_useragent_mobile_common 418: net_useragent_mobile_nonmobile 419: 420: 421: 422: 1 423: net_useragent_mobile_common 424: net_useragent_mobile_nonmobile 425: 426: 427: 428: 1 429: net_useragent_mobile_common 430: net_useragent_mobile_nonmobile 431: 432: 433: 434: 1 435: net_useragent_mobile_common 436: net_useragent_mobile_nonmobile 437: 438: 439: 440: 1 441: net_useragent_mobile_common 442: net_useragent_mobile_nonmobile 443: 444: 445: 446: 1 447: net_useragent_mobile_common 448: net_useragent_mobile_nonmobile 449: 450: 451: 452: 1 453: net_useragent_mobile_common 454: net_useragent_mobile_nonmobile 455: 456: 457: 458: 1 459: net_useragent_mobile_common 460: net_useragent_mobile_nonmobile 461: 462: 463: 464: 1 465: net_useragent_mobile_common 466: net_useragent_mobile_nonmobile 467: 468: 469: 470: 1 471: net_useragent_mobile_common 472: net_useragent_mobile_nonmobile 473: 474: 475: 476: 1 477: net_useragent_mobile_common 478: net_useragent_mobile_nonmobile 479: 480: 481: 482: 1 483: net_useragent_mobile_common 484: net_useragent_mobile_nonmobile 485: 486: 487: 488: 1 489: net_useragent_mobile_common 490: net_useragent_mobile_nonmobile 491: 492: 493: 494: 1 495: net_useragent_mobile_common 496: net_useragent_mobile_nonmobile 497: 498: 499: 500: 1 501: net_useragent_mobile_common 502: net_useragent_mobile_nonmobile 503: 504: 505: 506: 1 507: net_useragent_mobile_common 508: net_useragent_mobile_nonmobile 509: 510: 511: 512: 1 513: net_useragent_mobile_common 514: net_useragent_mobile_nonmobile 515: 516: 517: 518: 1 519: net_useragent_mobile_common 520: net_useragent_mobile_nonmobile 521: 522: 523: 524: 1 525: net_useragent_mobile_common 526: net_useragent_mobile_nonmobile 527: 528: 529: 530: 1 531: net_useragent_mobile_common 532: net_useragent_mobile_nonmobile 533: 534: 535: 536: 1 537: net_useragent_mobile_common 538: net_useragent_mobile_nonmobile 539: 540: 541: 542: 1 543: net_useragent_mobile_common 544: net_useragent_mobile_nonmobile 545: 546: 547: 548: 1 549: net_useragent_mobile_common 550: net_useragent_mobile_nonmobile 551: 552: 553: 554: 1 555: net_useragent_mobile_common 556: net_useragent_mobile_nonmobile 557: 558: 559: 560: 1 561: net_useragent_mobile_common 562: net_useragent_mobile_nonmobile 563: 564: 565: 566: 1 567: net_useragent_mobile_common 568: net_useragent_mobile_nonmobile 569: 570: 571: 572: 1 573: net_useragent_mobile_common 574: net_useragent_mobile_nonmobile 575: 576: 577: 578: 1 579: net_useragent_mobile_common 580: net_useragent_mobile_nonmobile 581: 582: 583: 584: 1 585: net_useragent_mobile_common 586: net_useragent_mobile_nonmobile 587: 588: 589: 590: 1 591: net_useragent_mobile_common 592: net_useragent_mobile_nonmobile 593: 594: 595: 596: 1 597: net_useragent_mobile_common 598: net_useragent_mobile_nonmobile 599: 600: 601: 602: 1 603: net_useragent_mobile_common 604: net_useragent_mobile_nonmobile 605: 606: 607: 608: 1 609: net_useragent_mobile_common 610: net_useragent_mobile_nonmobile 611: 612: 613: 614: 1 615: net_useragent_mobile_common 616: net_useragent_mobile_nonmobile 617: 618: 619: 620: 1 621: net_useragent_mobile_common 622: net_useragent_mobile_nonmobile 623: 624: 625: 626: 1 627: net_useragent_mobile_common 628: net_useragent_mobile_nonmobile 629: 630: 631: 632: 1 633: net_useragent_mobile_common 634: net_useragent_mobile_nonmobile 635: 636: 637: 638: 1 639: net_useragent_mobile_common 640: net_useragent_mobile_nonmobile 641: 642: 643: 644: 1 645: net_useragent_mobile_common 646: net_useragent_mobile_nonmobile 647: 648: 649: 650: 1 651: net_useragent_mobile_common 652: net_useragent_mobile_nonmobile 653: 654: 655: 656: 1 657: net_useragent_mobile_common 658: net_useragent_mobile_nonmobile 659: 660: 661: 662: 1 663: net_useragent_mobile_common 664: net_useragent_mobile_nonmobile 665: 666: 667: 668: 1 669: net_useragent_mobile_common 670: net_useragent_mobile_nonmobile 671: 672: 673: 674: 1 675: net_useragent_mobile_common 676: net_useragent_mobile_nonmobile 677: 678: 679: 680: 1 681: net_useragent_mobile_common 682: net_useragent_mobile_nonmobile 683: 684: 685: 686: 1 687: net_useragent_mobile_common 688: net_useragent_mobile_nonmobile 689: 690: 691: 692: 1 693: net_useragent_mobile_common 694: net_useragent_mobile_nonmobile 695: 696: 697: 698: 1 699: net_useragent_mobile_common 700: net_useragent_mobile_nonmobile 701: 702: 703: 704: 1 705: net_useragent_mobile_common 706: net_useragent_mobile_nonmobile 707: 708: 709: 710: 1 711: net_useragent_mobile_common 712: net_useragent_mobile_nonmobile 713: 714: 715: 716: 1 717: net_useragent_mobile_common 718: net_useragent_mobile_nonmobile 719: 720: 721: 722: 1 723: net_useragent_mobile_common 724: net_useragent_mobile_nonmobile 725: 726: 727: 728: 1 729: net_useragent_mobile_common 730: net_useragent_mobile_nonmobile 731: 732: 733: 734: 1 735: net_useragent_mobile_common 736: net_useragent_mobile_nonmobile 737: 738: 739: 740: 1 741: net_useragent_mobile_common 742: net_useragent_mobile_nonmobile 743: 744: 745: 746: 1 747: net_useragent_mobile_common 748: net_useragent_mobile_nonmobile 749: 750: 751: 752: 1 753: net_useragent_mobile_common 754: net_useragent_mobile_nonmobile 755: 756: 757: 758: 1 759: net_useragent_mobile_common 760: net_useragent_mobile_nonmobile 761: 762: 763: 764: 1 765: net_useragent_mobile_common 766: net_useragent_mobile_nonmobile 767: 768: 769: 770: 1 771: net_useragent_mobile_common 772: net_useragent_mobile_nonmobile 773: 774: 775: 776: 1 777: net_useragent_mobile_common 778: net_useragent_mobile_nonmobile 779: 780: 781: 782: 1 783: net_useragent_mobile_common 784: net_useragent_mobile_nonmobile 785: 786: 787: 788: 1 789: net_useragent_mobile_common 790: net_useragent_mobile_nonmobile 791: 792: 793: 794: 1 795: net_useragent_mobile_common 796: net_useragent_mobile_nonmobile 797: 798: 799: 800: 1 801: net_useragent_mobile_common 802: net_useragent_mobile_nonmobile 803: 804: 805: 806: 1 807: net_useragent_mobile_common 808: net_useragent_mobile_nonmobile 809: 810: 811: 812: 1 813: net_useragent_mobile_common 814: net_useragent_mobile_nonmobile 815: 816: 817: 818: 1 819: net_useragent_mobile_common 820: net_useragent_mobile_nonmobile 821: 822: 823: 824: 1 825: net_useragent_mobile_common 826: net_useragent_mobile_nonmobile 827: 828: 829: 830: 1 831: net_useragent_mobile_common 832: net_useragent_mobile_nonmobile 833: 834: 835: 836: 1 837: net_useragent_mobile_common 838: net_useragent_mobile_nonmobile 839: 840: 841: 842: 1 843: net_useragent_mobile_common 844: net_useragent_mobile_nonmobile 845: 846: 847: 848: 1 849: net_useragent_mobile_common 850: net_useragent_mobile_nonmobile 851: 852: 853: 854: 1 855: net_useragent_mobile_common 856: net_useragent_mobile_nonmobile 857: 858: 859: 860: 1 861: net_useragent_mobile_common 862: net_useragent_mobile_nonmobile 863: 864: 865: 866: 1 867: net_useragent_mobile_common 868: net_useragent_mobile_nonmobile 869: 870: 871: 872: 1 873: net_useragent_mobile_common 874: net_useragent_mobile_nonmobile 875: 876: 877: 878: 1 879: net_useragent_mobile_common 880: net_useragent_mobile_nonmobile 881: 882: 883: 884: 1 885: net_useragent_mobile_common 886: net_useragent_mobile_nonmobile 887: 888: 889: 890: 1 891: net_useragent_mobile_common 892: net_useragent_mobile_nonmobile 893: 894: 895: 896: 1 897: net_useragent_mobile_common 898: net_useragent_mobile_nonmobile 899: 900: 901: 902: 1 903: net_useragent_mobile_common 904: net_useragent_mobile_nonmobile 905: 906: 907: 908: 1 909: net_useragent_mobile_common 910: net_useragent_mobile_nonmobile 911: 912: 913: 914: 1 915: net_useragent_mobile_common 916: net_useragent_mobile_nonmobile 917: 918: 919: 920: 1 921: net_useragent_mobile_common 922: net_useragent_mobile_nonmobile 923: 924: 925: 926: 1 927: net_useragent_mobile_common 928: net_useragent_mobile_nonmobile 929: 930: 931: 932: 1 933: net_useragent_mobile_common 934: net_useragent_mobile_nonmobile 935: 936: 937: 938: 1 939: net_useragent_mobile_common 940: net_useragent_mobile_nonmobile 941: 942: 943: 944: 1 945: net_useragent_mobile_common 946: net_useragent_mobile_nonmobile 947: 948: 949: 950: 1 951: net_useragent_mobile_common 952: net_useragent_mobile_nonmobile 953: 954: 955: 956: 1 957: net_useragent_mobile_common 958: net_useragent_mobile_nonmobile 959: 960: 961: 962: 1 963: net_useragent_mobile_common 964: net_useragent_mobile_nonmobile 965: 966: 967: 968: 1 969: net_useragent_mobile_common 970: net_useragent_mobile_nonmobile 971: 972: 973: 974: 1 975: net_useragent_mobile_common 976: net_useragent_mobile_nonmobile 977: 978: 979: 980: 1 981: net_useragent_mobile_common 982: net_useragent_mobile_nonmobile 983: 984: 985: 986: 1 987: net_useragent_mobile_common 988: net_useragent_mobile_nonmobile 989: 990: 991:
« previous php.pear.cvs (#8958) next »