Property | Type | Description | |
---|---|---|---|
$clientTypes | array | Holds all registered client types |
Property | Type | Description | |
---|---|---|---|
$bot | array | boolean | If $discardBotInformation is set to true, this property will be set to true if parsed UA is identified as bot, additional information will be not available If $skipBotDetection is set to true, bot detection will not be performed and isBot will always be false | |
$brand | string | Holds the device brand data after parsing the UA | |
$cache | DeviceDetector\Cache\Cache | |
Holds the cache class used for caching the parsed yml-Files | |
$client | array | Holds the client data after parsing the UA | |
$clientParsers | DeviceDetector\Parser\Client\ClientParserAbstract[] | ||
$desktopOsArray | array | Operating system families that are known as desktop only | |
$device | string | Holds the device type after parsing the UA | |
$deviceParsers | |||
$discardBotInformation | boolean | ||
$model | string | Holds the device model data after parsing the UA | |
$os | array | Holds the operating system data after parsing the UA | |
$skipBotDetection | boolean | ||
$userAgent | string | Holds the useragent that should be parsed | |
$yamlParser | DeviceDetector\Yaml\Parser | Holds the parser class used for parsing yml-Files |
Method | Description | |
---|---|---|
__call ( $methodName, $arguments ) | ||
__construct ( string $userAgent = '' ) | Constructor | |
addClientParser ( DeviceDetector\Parser\Client\ClientParserAbstract | string $parser ) | ||
addDeviceParser ( |
||
discardBotInformation ( boolean $discard = true ) | Sets whether to discard additional bot information If information is discarded it's only possible check whether UA was detected as bot or not. | |
getBot ( ) : array | Returns the bot extracted from the parsed UA | |
getBrand ( ) : string | Returns the device brand extracted from the parsed UA | |
getBrandName ( ) : string | Returns the full device brand name extracted from the parsed UA | |
getCache ( ) : |
Returns Cache object | |
getClient ( string $attr = '' ) : array | string | Returns the client data extracted from the parsed UA | |
getClientParsers ( ) | ||
getDevice ( ) : integer | null | Returns the device type extracted from the parsed UA | |
getDeviceName ( ) : string | Returns the device type extracted from the parsed UA | |
getDeviceParsers ( ) | ||
getInfoFromUserAgent ( string $ua ) : array | Parses a useragent and returns the detected data | |
getModel ( ) : string | Returns the device model extracted from the parsed UA | |
getOs ( string $attr = '' ) : array | string | Returns the operating system data extracted from the parsed UA | |
getUserAgent ( ) : string | Returns the user agent that is set to be parsed | |
getYamlParser ( ) : DeviceDetector\Yaml\Parser | Returns Yaml Parser object | |
isBot ( ) : boolean | Returns if the parsed UA was identified as a Bot | |
isDesktop ( ) : boolean | Returns if the parsed UA was identified as desktop device Desktop devices are all devices with an unknown type that are running a desktop os | |
isMobile ( ) | ||
isParsed ( ) : boolean | Returns true, if userAgent was already parsed with parse() | |
isTouchEnabled ( ) : boolean | Returns if the parsed UA was identified as a touch enabled device | |
parse ( ) | Triggers the parsing of the current user agent | |
setCache ( DeviceDetector\Cache\Cache | |
Sets the Cache class | |
setUserAgent ( string $userAgent ) | Sets the useragent to be parsed | |
setYamlParser ( $yamlParser ) | Sets the Yaml Parser class | |
skipBotDetection ( boolean $skip = true ) | Sets whether to skip bot detection. |
Method | Description | |
---|---|---|
hasAndroidMobileFragment ( ) : boolean | Returns if the parsed UA contains the 'Android; Mobile;' fragment | |
hasAndroidTableFragment ( ) : boolean | Returns if the parsed UA contains the 'Android; Tablet;' fragment | |
matchUserAgent ( $regex ) | ||
parseBot ( ) | Parses the UA for bot information using the Bot parser | |
parseClient ( ) | ||
parseDevice ( ) | ||
parseOs ( ) | ||
reset ( ) | ||
usesMobileBrowser ( ) |
public __construct ( string $userAgent = '' ) | ||
$userAgent | string | UA to parse |
public addClientParser ( DeviceDetector\Parser\Client\ClientParserAbstract | string $parser ) | ||
$parser | DeviceDetector\Parser\Client\ClientParserAbstract | string |
public addDeviceParser ( |
||
$parser |
public discardBotInformation ( boolean $discard = true ) | ||
$discard | boolean |
public getBrandName ( ) : string | ||
return | string |
public getCache ( ) : |
||
return |
public getDeviceName ( ) : string | ||
return | string |
public static getInfoFromUserAgent ( string $ua ) : array | ||
$ua | string | UserAgent to parse |
return | array |
public getUserAgent ( ) : string | ||
return | string |
public getYamlParser ( ) : DeviceDetector\Yaml\Parser | ||
return | DeviceDetector\Yaml\Parser |
protected hasAndroidMobileFragment ( ) : boolean | ||
return | boolean |
protected hasAndroidTableFragment ( ) : boolean | ||
return | boolean |
public isTouchEnabled ( ) : boolean | ||
return | boolean |
protected parseBot ( ) |
public setCache ( DeviceDetector\Cache\Cache | |
||
$cache | DeviceDetector\Cache\Cache | |
public setUserAgent ( string $userAgent ) | ||
$userAgent | string |
public skipBotDetection ( boolean $skip = true ) | ||
$skip | boolean |
protected string $brand | ||
return | string |
protected Cache,DeviceDetector\Cache|CacheProvider,Doctrine\Common\Cache $cache | ||
return | DeviceDetector\Cache\Cache | |
protected array $client | ||
return | array |
protected ClientParserAbstract[],DeviceDetector\Parser\Client $clientParsers | ||
return | DeviceDetector\Parser\Client\ClientParserAbstract[] |
public static array $clientTypes | ||
return | array |
protected static array $desktopOsArray | ||
return | array |
protected string $device | ||
return | string |
protected DeviceParserAbstract[],DeviceDetector\Parser\Device $deviceParsers | ||
return |
protected string $model | ||
return | string |
protected array $os | ||
return | array |
protected string $userAgent | ||
return | string |