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

Class: TeraWurflRemoteClient

Source Location: /TeraWurflRemoteClient/TeraWurflRemoteClient.php

Class Overview


Tera-WURFL remote webservice client for PHP


Variables

Methods



Class Details

[line 19]
Tera-WURFL remote webservice client for PHP



[ Top ]


Class Variables

static $FORMAT_JSON =  'json'

[line 31]

The JSON Data Format is the default transport for Tera-WURFL 2.1.2 and newer due to it's smaller size

and better performance with the builtin PHP functions




Tags:

access:  public

Type:   String


[ Top ]

static $FORMAT_XML =  'xml'

[line 25]

XML Data Format - this should only be used to communicate with Tera-WURFL 2.1.1 and older



Tags:

access:  public

Type:   String


[ Top ]

static $userAgentHeaders = array(
      'HTTP_X_DEVICE_USER_AGENT',
      'HTTP_X_ORIGINAL_USER_AGENT',
      'HTTP_X_OPERAMINI_PHONE_UA',
      'HTTP_X_SKYFIRE_PHONE',
      'HTTP_X_BOLT_PHONE_UA',
      'HTTP_USER_AGENT'
   )

[line 53]

The HTTP Headers that Tera-WURFL will look through to find the best User Agent, if one is not specified



Tags:

access:  public

Type:   Array


[ Top ]

$apiVersion =

[line 67]



Tags:

access:  protected

Type:   mixed


[ Top ]

$autolookup =  true

[line 37]

If you try to use a capability that has not been retrieved yet and this is set to true, it will generate another request to the webservice and retrieve this capability automatically.



Tags:

access:  public

Type:   Bool


[ Top ]

$capabilities = array()

[line 43]

Flattened version of Tera-WURFL's capabilities array, containing only capability names and values.

Since it is 'Flattened', there a no groups in this array, just individual capabilities.




Tags:

access:  public

Type:   Array


[ Top ]

$clientVersion =  '2.1.3'

[line 66]



Tags:

access:  protected

Type:   mixed


[ Top ]

$errors =

[line 48]

Array of errors that were encountered while processing the request and/or response.



Tags:

access:  public

Type:   Array


[ Top ]

$format =

[line 61]



Tags:

access:  protected

Type:   mixed


[ Top ]

$json =

[line 65]



Tags:

access:  protected

Type:   mixed


[ Top ]

$loadedDate =

[line 68]



Tags:

access:  protected

Type:   mixed


[ Top ]

$timeout =

[line 69]



Tags:

access:  protected

Type:   mixed


[ Top ]

$userAgent =

[line 62]



Tags:

access:  protected

Type:   mixed


[ Top ]

$webserviceUrl =

[line 63]



Tags:

access:  protected

Type:   mixed


[ Top ]

$xml =

[line 64]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method getUserAgent [line 266]

static String getUserAgent( [$source $source = null])

Return the requesting client's User Agent



Tags:

access:  public


Parameters:

$source   $source  

[ Top ]

static method niceCast [line 241]

static Mixed niceCast( $value $value)

Cast strings into proper variable types, i.e. 'true' into true



Tags:

return:  String, Bool, Float
access:  protected


Parameters:

$value   $value  

[ Top ]

static method validURL [line 257]

static Bool validURL( $url $url)

Is the given URL valid



Tags:

access:  protected


Parameters:

$url   $url  

[ Top ]

constructor __construct [line 78]

TeraWurflRemoteClient __construct( String $TeraWurflWebserviceURL, [String $data_format = 'json'], [ $timeout = 1])

Creates a TeraWurflRemoteClient object. NOTE: in Tera-WURFL 2.1.2 the default data format is JSON.

This format is not supported in Tera-WURFL 2.1.1 or earlier, so if you must use this client with an earlier version of the server, set the second parameter to TeraWurflRemoteClient::$FORMAT_XML




Tags:

access:  public


Parameters:

String   $TeraWurflWebserviceURL   URL to the master Tera-WURFL Server's webservice.php
String   $data_format   TeraWurflRemoteClient::$FORMAT_JSON or TeraWurflRemoteClient::$FORMAT_XML
   $timeout  

[ Top ]

method callTeraWurfl [line 162]

void callTeraWurfl( String $uri)

Make the webservice call to the server using the GET method and load the response.



Tags:

access:  protected


Parameters:

String   $uri   The URI of the master server

[ Top ]

method getAPIVersion [line 146]

String getAPIVersion( )

Get the version of the Tera-WURFL Webservice (webservice.php on server). This is only available after a query has been made since it is returned in the response.



Tags:

access:  public


[ Top ]

method getCapabilitiesFromAgent [line 114]

bool getCapabilitiesFromAgent( String $userAgent, $capabilities)

Maintains backwards compatibility with Tera-WURFL <= 2.1.2. This function is an

alias for TeraWurflRemoteClient::getDeviceCapabilitiesFromAgent()




Tags:

return:  Success
access:  public


Parameters:

String   $userAgent   HTTP User Agent of the device being detected
Array   $capabilities   Array of capabilities that you would like to retrieve

[ Top ]

method getClientVersion [line 138]

String getClientVersion( )

Get the version of the Tera-WURFL Remote Client (this file)



Tags:

access:  public


[ Top ]

method getDeviceCapabilitiesFromAgent [line 95]

bool getDeviceCapabilitiesFromAgent( String $userAgent, $capabilities)

Get the requested capabilities from Tera-WURFL for the given user agent



Tags:

return:  Success
access:  public


Parameters:

String   $userAgent   HTTP User Agent of the device being detected
Array   $capabilities   Array of capabilities that you would like to retrieve

[ Top ]

method getDeviceCapability [line 122]

Mixed getDeviceCapability( String $capability)

Returns the value of the requested capability



Tags:

return:  String, Numeric, Bool
access:  public


Parameters:

String   $capability   The WURFL capability you are looking for (e.g. "is_wireless_device")

[ Top ]

method getLoadedDate [line 154]

String getLoadedDate( )

Get the date that the Tera-WURFL was last updated. This is only available after a query has been made since it is returned in the response.



Tags:

access:  public


[ Top ]

method loadCapabilities [line 200]

void loadCapabilities( )

Parse the response into the capabilities array



Tags:

access:  protected


[ Top ]

method loadErrors [line 223]

void loadErrors( )

Parse the response's errors into the errors array



Tags:

access:  protected


[ Top ]


Documentation generated on Sun, 19 Sep 2010 00:16:03 +0000 by phpDocumentor 1.4.3