- Timestamp:
- 2008/03/12 16:43:11 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/module/Net/UserAgent/Mobile/EZweb.php
r15532 r17127 14 14 * @package Net_UserAgent_Mobile 15 15 * @author KUBO Atsuhiro <[email protected]> 16 * @copyright 2003-200 7KUBO Atsuhiro <[email protected]>16 * @copyright 2003-2008 KUBO Atsuhiro <[email protected]> 17 17 * @license http://www.php.net/license/3_0.txt PHP License 3.0 18 18 * @version CVS: $Id$ … … 23 23 */ 24 24 25 require_once (dirname(__FILE__) . '/Common.php');26 require_once (dirname(__FILE__) . '/Display.php');25 require_once 'Net/UserAgent/Mobile/Common.php'; 26 require_once 'Net/UserAgent/Mobile/Display.php'; 27 27 28 28 // {{{ Net_UserAgent_Mobile_EZweb … … 59 59 * @package Net_UserAgent_Mobile 60 60 * @author KUBO Atsuhiro <[email protected]> 61 * @copyright 2003-200 7KUBO Atsuhiro <[email protected]>61 * @copyright 2003-2008 KUBO Atsuhiro <[email protected]> 62 62 * @license http://www.php.net/license/3_0.txt PHP License 3.0 63 * @version Release: 0.3 0.063 * @version Release: 0.31.0 64 64 * @link http://www.au.kddi.com/ezfactory/tec/spec/4_4.html 65 65 * @link http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html … … 83 83 84 84 /** 85 * name of the model like 'P502i'86 * @var string87 */88 var $_model = '';89 90 /**91 * device ID like 'TS21'92 * @var string93 */94 var $_deviceID = '';95 96 /**97 85 * server string like 'UP.Link/3.2.1.2' 98 86 * @var string … … 141 129 function isTUKa() 142 130 { 143 $tuka = substr($this->_ deviceID, 2, 1);131 $tuka = substr($this->_rawModel, 2, 1); 144 132 if ($this->isWAP2()) { 145 133 if ($tuka == 'U') { … … 159 147 160 148 /** 161 * parse HTTP_USER_AGENT string162 * /163 function parse()164 {165 $agent = $this->getUserAgent();166 167 if (preg_match('/^KDDI-(.*)/', $ agent, $matches)) {149 * Parses HTTP_USER_AGENT string. 150 * 151 * @param string $userAgent User-Agent string 152 */ 153 function parse($userAgent) 154 { 155 if (preg_match('/^KDDI-(.*)/', $userAgent, $matches)) { 168 156 169 157 // KDDI-TS21 UP.Browser/6.0.2.276 (GUI) MMP/1.1 170 158 $this->_xhtmlCompliant = true; 171 list($this->_ deviceID, $browser, $opt, $this->_serverName) =159 list($this->_rawModel, $browser, $opt, $this->_serverName) = 172 160 explode(' ', $matches[1], 4); 173 161 list($this->name, $version) = explode('/', $browser); … … 177 165 // UP.Browser/3.01-HI01 UP.Link/3.4.5.2 178 166 @list($browser, $this->_serverName, $comment) = 179 explode(' ', $ agent, 3);167 explode(' ', $userAgent, 3); 180 168 list($this->name, $software) = explode('/', $browser); 181 list($this->version, $this->_ deviceID) =169 list($this->version, $this->_rawModel) = 182 170 explode('-', $software); 183 171 if ($comment) { … … 186 174 } 187 175 } 188 189 $this->_model = $this->_deviceID;190 176 } 191 177 … … 203 189 { 204 190 @list($width, $height) = 205 explode(',', $this->getHeader(' x-up-devcap-screenpixels'));191 explode(',', $this->getHeader('X-UP-DEVCAP-SCREENPIXELS')); 206 192 $screenDepth = 207 explode(',', $this->getHeader(' x-up-devcap-screendepth'));193 explode(',', $this->getHeader('X-UP-DEVCAP-SCREENDEPTH')); 208 194 $depth = $screenDepth[0] ? pow(2, (integer)$screenDepth[0]) : 0; 209 195 $color = 210 $this->getHeader(' x-up-devcap-iscolor') === '1' ? true : false;196 $this->getHeader('X-UP-DEVCAP-ISCOLOR') === '1' ? true : false; 211 197 return new Net_UserAgent_Mobile_Display(array( 212 198 'width' => $width, … … 219 205 220 206 // }}} 221 // {{{ get Model()222 223 /** 224 * returns name of the model (device ID) like 'TS21'207 // {{{ getDeviceID() 208 209 /** 210 * Returns the device ID of the user agent. 225 211 * 226 212 * @return string 227 213 */ 228 function get Model()229 { 230 return $this->_ model;231 } 232 233 // }}} 234 // {{{ get DeviceID()235 236 /** 237 * returns device ID like 'TS21'214 function getDeviceID() 215 { 216 return $this->_rawModel; 217 } 218 219 // }}} 220 // {{{ getServer() 221 222 /** 223 * returns server string like 'UP.Link/3.2.1.2' 238 224 * 239 225 * @return string 240 226 */ 241 function getDeviceID() 242 { 243 return $this->_deviceID; 244 } 245 246 // }}} 247 // {{{ getServer() 248 249 /** 250 * returns server string like 'UP.Link/3.2.1.2' 227 function getServer() 228 { 229 return $this->_serverName; 230 } 231 232 // }}} 233 // {{{ getComment() 234 235 /** 236 * returns comment like 'Google WAP Proxy/1.0'. returns null if nothinng. 237 * 238 * @return boolean 239 */ 240 function getComment() 241 { 242 return $this->_comment; 243 } 244 245 // }}} 246 // {{{ isXHTMLCompliant() 247 248 /** 249 * returns whether it's XHTML compliant or not 250 * 251 * @return boolean 252 */ 253 function isXHTMLCompliant() 254 { 255 return $this->_xhtmlCompliant; 256 } 257 258 // }}} 259 // {{{ getCarrierShortName() 260 261 /** 262 * returns the short name of the carrier 251 263 * 252 264 * @return string 253 265 */ 254 function getServer() 255 { 256 return $this->_serverName; 257 } 258 259 // }}} 260 // {{{ getComment() 261 262 /** 263 * returns comment like 'Google WAP Proxy/1.0'. returns null if nothinng. 264 * 265 * @return boolean 266 */ 267 function getComment() 268 { 269 return $this->_comment; 270 } 271 272 // }}} 273 // {{{ isXHTMLCompliant() 274 275 /** 276 * returns whether it's XHTML compliant or not 277 * 278 * @return boolean 279 */ 280 function isXHTMLCompliant() 281 { 282 return $this->_xhtmlCompliant; 283 } 284 285 // }}} 286 // {{{ getCarrierShortName() 287 288 /** 289 * returns the short name of the carrier 266 function getCarrierShortName() 267 { 268 return 'E'; 269 } 270 271 // }}} 272 // {{{ getCarrierLongName() 273 274 /** 275 * returns the long name of the carrier 290 276 * 291 277 * @return string 292 278 */ 293 function getCarrierShortName()294 {295 return 'E';296 }297 298 // }}}299 // {{{ getCarrierLongName()300 301 /**302 * returns the long name of the carrier303 *304 * @return string305 */306 279 function getCarrierLongName() 307 280 { … … 319 292 function isWIN() 320 293 { 321 return substr($this->_ deviceID, 2, 1) == 3 ? true : false;294 return substr($this->_rawModel, 2, 1) == 3 ? true : false; 322 295 } 323 296 … … 345 318 * End: 346 319 */ 347 ?>
Note: See TracChangeset
for help on using the changeset viewer.
