Overview

Namespaces

  • None
  • Wei
    • Validator

Classes

  • Apc
  • App
  • ArrayCache
  • Asset
  • Base
  • BaseCache
  • BaseController
  • Bicache
  • Cache
  • Config
  • Cookie
  • Couchbase
  • Counter
  • Db
  • DbCache
  • E
  • Env
  • Error
  • FileCache
  • Gravatar
  • Http
  • Lock
  • Logger
  • Memcache
  • Memcached
  • MongoCache
  • Password
  • PhpError
  • PhpFileCache
  • Pinyin
  • Record
  • Redis
  • Request
  • Response
  • Router
  • SafeUrl
  • Session
  • Soap
  • T
  • Ua
  • Upload
  • Url
  • Uuid
  • Validate
  • View
  • WeChatApp
  • Wei
  • Overview
  • Namespace
  • Class

Class Ua

A service to detect user OS, browser and device name and version

Wei\Base
Extended by Wei\Ua
Namespace: Wei
Author: Twin Huang twinhuang@qq.com
Located at Ua.php
Methods summary
public
# __construct( array $options = array() )

Constructor

Constructor

Parameters

$options

Throws

InvalidArgumentException
When option "wei" is not an instance of "Wei\Wei"

Overrides

Wei\Base::__construct()
public boolean
# __invoke( string $name )

Check if in the specified browser, OS or device

Check if in the specified browser, OS or device

Parameters

$name
The name of browser, OS or device

Returns

boolean
public boolean
# is( string $name )

Check if in the specified browser, OS or device

Check if in the specified browser, OS or device

Parameters

$name
The name of browser, OS or device

Returns

boolean

Throws

InvalidArgumentException
When name is not defined in patterns array
public string
# getVersion( string $name )

Returns the version of specified browser, OS or device

Returns the version of specified browser, OS or device

Parameters

$name

Returns

string
public boolean
# __call( string $name, array $args )

Magic call for method isXXX

Magic call for method isXXX

Parameters

$name
$args

Returns

boolean

Overrides

Wei\Base::__call()
public boolean
# isMobile( )

Check if the device is mobile

Check if the device is mobile

Returns

boolean

License

License https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt

Link

https://github.com/serbanghita/Mobile-Detect
Methods inherited from Wei\Base
__get(), getOption(), setOption()
Magic methods summary
public boolean
# isIE( )

Check if the user is browsing in Internet Explorer browser

Check if the user is browsing in Internet Explorer browser

Returns

boolean
public boolean
# isChrome( )

Check if the user is browsing in Chrome browser

Check if the user is browsing in Chrome browser

Returns

boolean
public boolean
# isFirefox( )

Check if the user is browsing in Firefox browser

Check if the user is browsing in Firefox browser

Returns

boolean
public boolean
# isIOS( )

Check if the device is running on Apple's iOS platform

Check if the device is running on Apple's iOS platform

Returns

boolean
public boolean
# isAndroid( )

Check if the device is running on Google's Android platform

Check if the device is running on Google's Android platform

Returns

boolean
public boolean
# isWindowsPhone( )

Check if the device is running on Windows Phone platform

Check if the device is running on Windows Phone platform

Returns

boolean
public boolean
# isIPhone( )

Check if the user is browsing by iPhone/iPod

Check if the user is browsing by iPhone/iPod

Returns

boolean
public boolean
# isIPad( )

Check if the user is browsing by iPad

Check if the user is browsing by iPad

Returns

boolean
public boolean
# isWeChat( )

Check if the user is browsing in WeChat App

Check if the user is browsing in WeChat App

Returns

boolean
Properties summary
protected array $patterns
# array( // Browser 'ie' => 'MSIE ([\w.]+)', 'chrome' => 'Chrome\/([\w.]+)', 'firefox' => 'Firefox\/([\w.]+)', // OS 'ios' => 'iP(?:hone|ad).*OS ([\d_]+)', // Contains iPod 'android' => 'Android ([\w.]+)', 'windowsphone' => 'Windows Phone (?:OS )?([\w.]+)', // Device (Mobile & Tablet) 'iphone' => 'iPhone OS ([\d_]+)', 'ipad' => 'iPad.*OS ([\d_]+)', // App 'wechat' => 'MicroMessenger', )
protected string $versions

The versions of detected os

The versions of detected os

# array()
protected string $userAgent

The user agent string from request header

The user agent string from request header

#
protected array $server

The server and execution environment parameters, equals to $_SERVER on default

The server and execution environment parameters, equals to $_SERVER on default

#
Properties inherited from Wei\Base
$providers, $wei
Wei Framework API documentation generated by ApiGen