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 42]
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 107]

The required version of PHP for this release



Tags:

access:  public

Type:   string


[ Top ]

static $SETTING_LOADED_DATE =  'loaded_date'

[line 49]



Tags:

var:  Settings constants
access:  public

Type:   string


[ Top ]

static $SETTING_PATCHES_LOADED =  'patches_loaded'

[line 50]



Tags:

var:  Settings constants
access:  public

Type:   string


[ Top ]

static $SETTING_WURFL_DATE =  'wurfl_date'

[line 48]



Tags:

var:  Settings constants
access:  public

Type:   string


[ Top ]

static $SETTING_WURFL_VERSION =  'wurfl_version'

[line 47]



Tags:

var:  Settings constants
access:  public

Type:   string


[ Top ]

$capabilities =

[line 62]

Array of WURFL capabilities of the requested device



Tags:

access:  public

Type:   Array


[ Top ]

$db =  false

[line 70]

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 57]

Array of errors that were encountered while processing the request



Tags:

access:  public

Type:   Array


[ Top ]

$foundInCache =

[line 90]

Was the evaluated device found in the cache



Tags:

access:  public

Type:   boolean


[ Top ]

$historical_release_version =  "2.1.6"

[line 102]



Tags:

access:  public

Type:   mixed


[ Top ]

$httpRequest =

[line 80]

The incoming HTTP Request



Tags:

access:  public



[ Top ]

$lookup_end =

[line 118]

Lookup end time



Tags:

access:  protected

Type:   int


[ Top ]

$lookup_start =

[line 113]

Lookup start time



Tags:

access:  protected

Type:   int


[ Top ]

$matchData =

[line 129]

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



Tags:

access:  public

Type:   array


[ Top ]

$matchDataKey =  "tera_wurfl"

[line 124]

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 134]

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 140]

This keeps the device fallback lookup from running away.

The deepest device I've seen is sonyericsson_z520a_subr3c at 15




Tags:

access:  protected

Type:   int


[ Top ]

$release_branch =  "Stable"

[line 96]

The installed branch of Tera-WURFL



Tags:

access:  public

Type:   string


[ Top ]

$release_version =  "1.4.0"

[line 101]

The installed version of Tera-WURFL



Tags:

access:  public

Type:   string


[ Top ]

$rootdir =

[line 75]

The directory that TeraWurfl.php is in



Tags:

access:  public

Type:   string


[ Top ]

$userAgentMatcher =

[line 85]

The UserAgentMatcher that is currently in use



Tags:

access:  public

Type:   UserAgentMatcher


[ Top ]



Class Methods


static method absoluteDataDir [line 545]

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 519]

static void mergeCapabilities( Array &$baseDevice, Array $addedDevice, array $baseDevice)

Merges given $addedDevice array onto $baseDevice array



Tags:

access:  public


Parameters:

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

[ Top ]

constructor __construct [line 145]

TeraWurfl __construct( )

Instatiate a new TeraWurfl object



Tags:

access:  public


[ Top ]

method addCapabilities [line 393]

void addCapabilities( Array $newCapabilities)

Add new capabilities to the capabilities array



Tags:

access:  public


Parameters:

array   $newCapabilities   Capabilities that are to be added

[ Top ]

method addTopLevelSettings [line 382]

void addTopLevelSettings( array $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 350]

string fullTableName( )

Full name of the table in use in the current UserAgentMatcher



Tags:

access:  public


[ Top ]

method getDeviceCapabilitiesFromAgent [line 163]

boolean 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 178]

boolean getDeviceCapabilitiesFromRequest( [array $request_headers = null])

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



Tags:

return:  Match
access:  public


Parameters:

array   $request_headers   Request object ($_SERVER contains this data)

[ Top ]

method getDeviceCapability [line 322]

integer|string|boolean|null 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 getDeviceIDFromRequestLoose [line 400]

string getDeviceIDFromRequestLoose( )

Returns the matching WURFL ID for a given User Agent



Tags:

return:  WURFL ID
access:  protected


[ Top ]

method getFullCapabilities [line 233]

void getFullCapabilities( string $deviceID)

Builds the full capabilities array from the WURFL ID



Tags:

access:  public


Parameters:

string   $deviceID   WURFL ID

[ Top ]

method getSetting [line 343]

string getSetting( string $key)

Returns the value of the given setting name



Tags:

return:  Value
access:  public


Parameters:

string   $key   Setting value

[ Top ]

method setMatcherHistory [line 511]

void setMatcherHistory( )

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



Tags:

access:  protected


[ Top ]

method toLog [line 360]

void toLog( string $text, [integer $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
integer   $requestedLogLevel   The log level / severity of the error
string   $func   The function or code that was being run when the error occurred

[ Top ]


Documentation generated on Sat, 31 Mar 2012 15:45:09 -0400 by phpDocumentor 1.4.4