Net_UserAgent_Detect (Constructor) [line 59]
Net_UserAgent_Detect Net_UserAgent_Detect(
[
$in_userAgent = null], [
$in_detect = null])
|
|
Parameters:
detect [line 105]
void detect(
[string
$in_userAgent = null], [mixed
$in_detect = null])
|
|
Detect the user agent and prepare flags, features and quirks based on what is found
This is the core of the Net_UserAgent_Detect class. It moves its way through the user agent string setting up the flags based on the vendors and versions of the browsers, determining the OS and setting up the features and quirks owned by each of the relevant clients. Note that if you are going to be calling methods of this class statically then set all the parameters using th setOption()
Parameters:
getAcceptType [line 891]
string getAcceptType(
string
$in_expectList, string
$in_type)
|
|
Retrive the accept type for the current browser.
To keep track of the mime-types, languages, charsets and encodings that each browser accepts we use associative arrays for each type. This function works like getBrowser() as it takes an expect list and returns the first match. For instance, to find the language you would pass in your allowed languages and see if any of the languages set in the browser match.
Parameters:
getBrowser [line 520]
string getBrowser(
array
$in_expectList)
|
|
Since simply returning the "browser" is somewhat ambiguous since there are different ways to classify the browser, this function works by taking an expect list and returning the string of the first match, so put the important ones first in the array.
Parameters:
getBrowserString [line 548]
string getBrowserString(
[array
$in_vendorStrings = null])
|
|
This function returns the vendor string corresponding to the flag.
Either use the default matches or pass in an associative array of flags and corresponding vendor strings. This function will find the highest version flag and return the vendor string corresponding to the appropriate flag. Be sure to pass in the flags in ascending order if you want a basic matches first, followed by more detailed matches.
Parameters:
getFeature [line 865]
string getFeature(
string
$in_feature)
|
|
Get the capabilities for the current browser.
Since the capabilities of client browsers vary widly, this interface helps keep track of the core features of a client, such as if the client supports dhtml, dom, javascript, etc.
Parameters:
getOS [line 679]
string getOS(
$in_expectList)
|
|
Since simply returning the "os" is somewhat ambiguous since there are different ways to classify the browser, this function works by taking an expect list and returning the string of the first match, so put the important ones first in the array.
Parameters:
getOSString [line 707]
string getOSString(
[array
$in_osStrings = null])
|
|
This function returns the os string corresponding to the flag.
Either use the default matches or pass in an associative array of flags and corresponding os strings. This function will find the highest version flag and return the os string corresponding to the appropriate flag. Be sure to pass in the flags in ascending order if you want a basic matches first, followed by more detailed matches.
Parameters:
getQuirk [line 801]
string getQuirk(
string
$in_quirk)
|
|
Get the unique behavior for the current browser.
Many client browsers do some really funky things, and this mechanism allows the coder to determine if an excepetion must be made with the current client.
Parameters:
getUserAgent [line 968]
Return the user agent string that is being worked on
hasAcceptType [line 954]
bool hasAcceptType(
string
$in_value, string
$in_type)
|
|
Check the accept types for the current browser.
To keep track of the mime-types, languages, charsets and encodings that each browser accepts we use associative arrays for each type. This function checks the array for the given type and determines if the browser accepts it.
Parameters:
hasFeature [line 845]
bool hasFeature(
string
$in_feature)
|
|
Check the capabilities for the current browser.
Since the capabilities of client browsers vary widly, this interface helps keep track of the core features of a client, such as if the client supports dhtml, dom, javascript, etc.
Parameters:
hasQuirk [line 781]
bool hasQuirk(
string
$in_quirk)
|
|
Check a unique behavior for the current browser.
Many client browsers do some really funky things, and this mechanism allows the coder to determine if an excepetion must be made with the current client.
Parameters:
isBrowser [line 499]
boolean isBrowser(
string
$in_match)
|
|
Look up the provide browser flag and return a boolean value
Given one of the flags listed in the properties, this function will return the value associated with that flag.
Parameters:
isIE [line 603]
Determine if the browser is an Internet Explorer browser
isNavigator [line 619]
Determine if the browser is a Netscape Navigator browser
isNetscape [line 639]
Determine if the browser is a Netscape or Mozilla browser
Note that this function is not the same as isNavigator, since the new Mozilla browsers are still sponsered by Netscape, and hence are Netscape products, but not the original Navigators
isOS [line 660]
boolean isOS(
string
$in_match)
|
|
Look up the provide OS flag and return a boolean value
Given one of the flags listed in the properties, this function will return the value associated with that flag for the operating system.
Parameters:
setAcceptType [line 925]
void setAcceptType(
array
$in_values, string
$in_type)
|
|
Set the accept types for the current browser.
To keep track of the mime-types, languages, charsets and encodings that each browser accepts we use associative arrays for each type. This function takes and array of accepted values for the type and records them for retrieval.
Parameters:
setFeature [line 824]
void setFeature(
string
$in_feature, [string
$in_hasFeature = true])
|
|
Set capabilities for the current browser.
Since the capabilities of client browsers vary widly, this interface helps keep track of the core features of a client, such as if the client supports dhtml, dom, javascript, etc.
Parameters:
setOption [line 479]
void setOption(
string
$in_field, mixed
$in_value)
|
|
Sets a class option. The available settings are:
- 'userAgent' => The user agent string to detect (useful for
checking a string manually).
- 'detectOptions' => The level of checking to do. A single level
- r an array of options. Default is NET_USERAGENT_DETECT_ALL.
Parameters:
setQuirk [line 759]
void setQuirk(
string
$in_quirk, [string
$in_hasQuirk = true])
|
|
Set a unique behavior for the current browser.
Many client browsers do some really funky things, and this mechanism allows the coder to determine if an excepetion must be made with the current client.
Parameters:
singleton [line 73]
To be used in place of the contructor to return only open instance.
Overridden in child classes as:
- Net_UserAgent_Detect_APC::singleton()
- To be used in place of the contructor to return only open instance.
Parameters: