TeraWurfl
[ class tree: TeraWurfl ] [ index: TeraWurfl ] [ all elements ]

Class: TeraWurfl

Source Location: /TeraWurfl.php

Class Overview


The main Tera-WURFL Class, provides all end-user methods and properties for interacting with Tera-WURFL


Variables

Methods



Class Details

[line 33]
The main Tera-WURFL Class, provides all end-user methods and properties for interacting with Tera-WURFL



[ Top ]


Class Variables

static $required_php_version =  "5.0.0"

[line 94]

The required version of PHP for this release



Tags:

access:  public

Type:   String


[ Top ]

$capabilities =

[line 44]

Array of WURFL capabilities of the requested device



Tags:

access:  public

Type:   Array


[ Top ]

$db =  false

[line 52]

Database connector to be used, must extend TeraWurflDatabase. All database functions are performed in the database connector through its methods and properties.



Tags:

see:  TeraWurflDatabase
see:  TeraWurflDatabase_MySQL5
access:  public

Type:   TeraWurflDatabase


[ Top ]

$errors =

[line 39]

Array of errors that were encountered while processing the request



Tags:

access:  public

Type:   Array


[ Top ]

$foundInCache =

[line 78]

Was the evaluated device found in the cache



Tags:

access:  public

Type:   Bool


[ Top ]

$httpAccept =

[line 68]

The HTTP Accept header that is being evaluated



Tags:

access:  public

Type:   String


[ Top ]

$lookup_end =

[line 105]

Lookup end time



Tags:

access:  protected

Type:   int


[ Top ]

$lookup_start =

[line 100]

Lookup start time



Tags:

access:  protected

Type:   int


[ Top ]

$matchData =

[line 116]

The Tera-WURFL specific data that is added to the capabilities array



Tags:

access:  protected

Type:   array


[ Top ]

$matchDataKey =  "tera_wurfl"

[line 111]

The array key that is returned as a WURFL capability group in the capabilities

array that stored Tera-WURFL specific information about the request




Tags:

access:  protected

Type:   String


[ Top ]

$matcherHistory =

[line 121]

Array of UserAgentMatchers and match attempt types that the API used to find a matching device



Tags:

access:  protected

Type:   Array


[ Top ]

$maxDeviceDepth =  40

[line 126]



Tags:

access:  protected

Type:   mixed


[ Top ]

$release_branch =  "Stable"

[line 84]

The installed branch of Tera-WURFL



Tags:

access:  public

Type:   String


[ Top ]

$release_version =  "2.1.2"

[line 89]

The installed version of Tera-WURFL



Tags:

access:  public

Type:   String


[ Top ]

$rootdir =

[line 57]

The directory that TeraWurfl.php is in



Tags:

access:  public

Type:   String


[ Top ]

$tablename =

[line 58]



Tags:

access:  public

Type:   mixed


[ Top ]

$userAgent =

[line 63]

The user agent that is being evaluated



Tags:

access:  public

Type:   String


[ Top ]

$userAgentMatcher =

[line 73]

The UserAgentMatcher that is currently in use



Tags:

access:  public

Type:   UserAgentMatcher


[ Top ]



Class Methods


static method absoluteDataDir [line 516]

static String absoluteDataDir( )

Get the absolute path to the data directory on the filesystem



Tags:

return:  Absolute path to data directory
access:  public


[ Top ]

static method mergeCapabilities [line 490]

static void mergeCapabilities( &$baseDevice, $addedDevice)

Merges given $addedDevice array onto $baseDevice array



Tags:

access:  public


Parameters:

Array   &$baseDevice   Main capabilities array
Array   $addedDevice   New capabilities array

[ Top ]

constructor __construct [line 129]

TeraWurfl __construct( )



Tags:

access:  public


[ Top ]

method addCapabilities [line 474]

void addCapabilities( $newCapabilities)

Add new capabilities to the capabilities array



Tags:

access:  public


Parameters:

Array   $newCapabilities   Capabilities that are to be added

[ Top ]

method addTopLevelSettings [line 463]

void addTopLevelSettings( $newCapabilities)

Adds the top level properties to the capabilities array, like id and user_agent



Tags:

access:  public


Parameters:

Array   $newCapabilities   New properties to be added

[ Top ]

method fullTableName [line 426]

void fullTableName( )



Tags:

access:  public


[ Top ]

method getDeviceCapabilitiesFromAgent [line 262]

Bool getDeviceCapabilitiesFromAgent( [String $userAgent = null], [String $httpAccept = null])

Detects the capabilities of a device from a given user agent and optionally, the HTTP Accept Headers



Tags:

return:  matching device was found
access:  public


Parameters:

String   $userAgent   HTTP User Agent
String   $httpAccept   HTTP Accept Header

[ Top ]

method getDeviceCapabilitiesFromRequest [line 252]

Bool getDeviceCapabilitiesFromRequest( Array $server)

Detects the capabilities from a given request object ($_SERVER)



Tags:

return:  Match
access:  public


Parameters:

Array   $server   Request object ($_SERVER contains this data)

[ Top ]

method getDeviceCapability [line 408]

Mixed getDeviceCapability( String $capability)

Returns the value of the requested capability for the detected device



Tags:

return:  Capability value
access:  public


Parameters:

String   $capability   Capability name (e.g. "is_wireless_device")

[ Top ]

method getDeviceIDFromUALoose [line 146]

String getDeviceIDFromUALoose( )

Returns the matching WURFL ID for a given User Agent



Tags:

return:  WURFL ID
access:  protected


[ Top ]

method getFullCapabilities [line 324]

void getFullCapabilities( String $deviceID)

Builds the full capabilities array from the WURFL ID



Tags:

access:  public


Parameters:

String   $deviceID   WURFL ID

[ Top ]

method setMatcherHistory [line 481]

void setMatcherHistory( )

Combines the MatcherHistory array into a string and stores it in the matchData



Tags:

access:  protected


[ Top ]

method toLog [line 437]

void toLog( String $text, [Int $requestedLogLevel = LOG_NOTICE], [String $func = "Tera-WURFL"])

Log an error in the Tera-WURFL log file



Tags:

see:  TeraWurflConfig
access:  public


Parameters:

String   $text   The error message text
Int   $requestedLogLevel   The log level / severity of the error
String   $func   The function or code that was being run when the error occured

[ Top ]


Documentation generated on Thu, 20 May 2010 20:20:25 +0000 by phpDocumentor 1.4.3