cvs: pear /Net_UserAgent_Mobile/Mobile Common.php DoCoMo.php EZweb.php SoftBank.php /Net_UserAgent_Mobile/tests/Mobile DoCoMoTestCase.php EZwebTestCase.php SoftBankTestCase.php
[email protected] ("KUBO Atsuhiro")
| Newsgroups | php.pear.cvs |
|---|---|
| Message-ID | <cvskuboa1209144103@cvsserver> |
kuboa Fri Apr 25 17:21:43 2008 UTC
Modified files:
/pear/Net_UserAgent_Mobile/Mobile Common.php DoCoMo.php EZweb.php
SoftBank.php
/pear/Net_UserAgent_Mobile/tests/Mobile DoCoMoTestCase.php
EZwebTestCase.php
SoftBankTestCase.php
Log:
- Added support for getting subscriber IDs (UIDs) by getUID().
kuboa-20080425172143.txt
(text/plain, 9.9 KB)
http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/Mobile/Common.php?r1=1.24&r2=1.25&diff_format=u Index: pear/Net_UserAgent_Mobile/Mobile/Common.php diff -u pear/Net_UserAgent_Mobile/Mobile/Common.php:1.24 pear/Net_UserAgent_Mobile/Mobile/Common.php:1.25 --- pear/Net_UserAgent_Mobile/Mobile/Common.php:1.24 Mon Feb 18 03:12:07 2008 +++ pear/Net_UserAgent_Mobile/Mobile/Common.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2003-2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Common.php,v 1.24 2008/02/18 03:12:07 kuboa Exp $ + * @version CVS: $Id: Common.php,v 1.25 2008/04/25 17:21:43 kuboa Exp $ * @since File available since Release 0.1 */ @@ -500,6 +500,17 @@ return $this->_rawModel; } + // }}} + // {{{ getUID() + + /** + * Gets the UID of a subscriber. + * + * @return string + * @since Method available since Release 1.0.0 + */ + function getUID() {} + /**#@-*/ /**#@+ http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php?r1=1.47&r2=1.48&diff_format=u Index: pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php diff -u pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php:1.47 pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php:1.48 --- pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php:1.47 Mon Feb 18 03:40:46 2008 +++ pear/Net_UserAgent_Mobile/Mobile/DoCoMo.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2003-2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: DoCoMo.php,v 1.47 2008/02/18 03:40:46 kuboa Exp $ + * @version CVS: $Id: DoCoMo.php,v 1.48 2008/04/25 17:21:43 kuboa Exp $ * @link http://www.nttdocomo.co.jp/service/imode/make/content/spec/useragent/index.html * @see Net_UserAgent_Mobile_Common * @since File available since Release 0.1 @@ -448,6 +448,22 @@ return 'DoCoMo'; } + // }}} + // {{{ getUID() + + /** + * Gets the UID of a subscriber. + * + * @return string + * @since Method available since Release 1.0.0 + */ + function getUID() + { + if (array_key_exists('HTTP_X_DCMGUID', $_SERVER)) { + return $_SERVER['HTTP_X_DCMGUID']; + } + } + /**#@-*/ /**#@+ http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/Mobile/EZweb.php?r1=1.23&r2=1.24&diff_format=u Index: pear/Net_UserAgent_Mobile/Mobile/EZweb.php diff -u pear/Net_UserAgent_Mobile/Mobile/EZweb.php:1.23 pear/Net_UserAgent_Mobile/Mobile/EZweb.php:1.24 --- pear/Net_UserAgent_Mobile/Mobile/EZweb.php:1.23 Tue Feb 12 14:36:25 2008 +++ pear/Net_UserAgent_Mobile/Mobile/EZweb.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2003-2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: EZweb.php,v 1.23 2008/02/12 14:36:25 kuboa Exp $ + * @version CVS: $Id: EZweb.php,v 1.24 2008/04/25 17:21:43 kuboa Exp $ * @link http://www.au.kddi.com/ezfactory/tec/spec/4_4.html * @link http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html * @see Net_UserAgent_Mobile_Common @@ -294,6 +294,22 @@ return substr($this->_rawModel, 2, 1) == 3 ? true : false; } + // }}} + // {{{ getUID() + + /** + * Gets the UID of a subscriber. + * + * @return string + * @since Method available since Release 1.0.0 + */ + function getUID() + { + if (array_key_exists('HTTP_X_UP_SUBNO', $_SERVER)) { + return $_SERVER['HTTP_X_UP_SUBNO']; + } + } + /**#@-*/ /**#@+ http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/Mobile/SoftBank.php?r1=1.8&r2=1.9&diff_format=u Index: pear/Net_UserAgent_Mobile/Mobile/SoftBank.php diff -u pear/Net_UserAgent_Mobile/Mobile/SoftBank.php:1.8 pear/Net_UserAgent_Mobile/Mobile/SoftBank.php:1.9 --- pear/Net_UserAgent_Mobile/Mobile/SoftBank.php:1.8 Tue Feb 12 14:36:25 2008 +++ pear/Net_UserAgent_Mobile/Mobile/SoftBank.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2003-2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: SoftBank.php,v 1.8 2008/02/12 14:36:25 kuboa Exp $ + * @version CVS: $Id: SoftBank.php,v 1.9 2008/04/25 17:21:43 kuboa Exp $ * @since File available since Release 0.20.0 */ @@ -418,6 +418,22 @@ return true; } + // }}} + // {{{ getUID() + + /** + * Gets the UID of a subscriber. + * + * @return string + * @since Method available since Release 1.0.0 + */ + function getUID() + { + if (array_key_exists('HTTP_X_JPHONE_UID', $_SERVER)) { + return $_SERVER['HTTP_X_JPHONE_UID']; + } + } + /**#@-*/ /**#@+ http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php?r1=1.9&r2=1.10&diff_format=u Index: pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php diff -u pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php:1.9 pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php:1.10 --- pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php:1.9 Mon Feb 18 03:40:46 2008 +++ pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: DoCoMoTestCase.php,v 1.9 2008/02/18 03:40:46 kuboa Exp $ + * @version CVS: $Id: DoCoMoTestCase.php,v 1.10 2008/04/25 17:21:43 kuboa Exp $ * @since File available since Release 0.31.0 */ @@ -1100,6 +1100,23 @@ $this->assertEquals('2.0', $agent->getVersion()); } + /** + * @since Method available since Release 1.0.0 + */ + public function testShouldProvideTheUidOfASubscriber() + { + $uid = '1234567'; + $_SERVER['HTTP_X_DCMGUID'] = $uid; + $agent = new Net_UserAgent_Mobile_DoCoMo('DoCoMo/2.0 SH905i(c100;TB;W24H16)'); + + $this->assertEquals($uid, $agent->getUID()); + + unset($_SERVER['HTTP_X_DCMGUID']); + $agent = new Net_UserAgent_Mobile_DoCoMo('DoCoMo/2.0 SH905i(c100;TB;W24H16)'); + + $this->assertNull($agent->getUID()); + } + /**#@-*/ /**#@+ http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php?r1=1.1&r2=1.2&diff_format=u Index: pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php diff -u pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php:1.1 pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php:1.2 --- pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php:1.1 Wed Feb 6 03:24:33 2008 +++ pear/Net_UserAgent_Mobile/tests/Mobile/EZwebTestCase.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: EZwebTestCase.php,v 1.1 2008/02/06 03:24:33 kuboa Exp $ + * @version CVS: $Id: EZwebTestCase.php,v 1.2 2008/04/25 17:21:43 kuboa Exp $ * @since File available since Release 0.31.0 */ @@ -198,6 +198,23 @@ } } + /** + * @since Method available since Release 1.0.0 + */ + public function testShouldProvideTheUidOfASubscriber() + { + $uid = '12345678901234_56.ezweb.ne.jp'; + $_SERVER['HTTP_X_UP_SUBNO'] = $uid; + $agent = new Net_UserAgent_Mobile_EZweb('KDDI-TS3C UP.Browser/6.2.0.12.1.3 (GUI) MMP/2.0'); + + $this->assertEquals($uid, $agent->getUID()); + + unset($_SERVER['HTTP_X_UP_SUBNO']); + $agent = new Net_UserAgent_Mobile_EZweb('KDDI-TS3C UP.Browser/6.2.0.12.1.3 (GUI) MMP/2.0'); + + $this->assertNull($agent->getUID()); + } + /**#@-*/ /**#@+ http://cvs.php.net/viewvc.cgi/pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php diff -u pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php:1.2 pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php:1.3 --- pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php:1.2 Sat Feb 9 17:55:08 2008 +++ pear/Net_UserAgent_Mobile/tests/Mobile/SoftBankTestCase.php Fri Apr 25 17:21:43 2008 @@ -15,7 +15,7 @@ * @author KUBO Atsuhiro <[email protected]> * @copyright 2008 KUBO Atsuhiro <[email protected]> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: SoftBankTestCase.php,v 1.2 2008/02/09 17:55:08 kuboa Exp $ + * @version CVS: $Id: SoftBankTestCase.php,v 1.3 2008/04/25 17:21:43 kuboa Exp $ * @since File available since Release 0.31.0 */ @@ -204,6 +204,23 @@ $this->assertEquals('4.3', $agent->getVersion()); } + /** + * @since Method available since Release 1.0.0 + */ + public function testShouldProvideTheUidOfASubscriber() + { + $uid = '1234567890123456'; + $_SERVER['HTTP_X_JPHONE_UID'] = $uid; + $agent = new Net_UserAgent_Mobile_SoftBank('SoftBank/1.0/706SC/SCJ001 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1'); + + $this->assertEquals($uid, $agent->getUID()); + + unset($_SERVER['HTTP_X_JPHONE_UID']); + $agent = new Net_UserAgent_Mobile_SoftBank('SoftBank/1.0/706SC/SCJ001 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1'); + + $this->assertNull($agent->getUID()); + } + /**#@-*/ /**#@+