library/Dot/UserAgent.php

Properties

Description

DotBoost Technologies Inc.

DotKernel Application Framework


Classes

Dot_UserAgent

Properties

 
 
No 
No 

Description

Extract all informations from User Agent , including interaction with Luca's Passani WURFL library

Methods

__construct, _getDeviceForHttpRequest, _getDeviceForUserAgent, _getDeviceFromCache, _isAndroid, _isBlackberry, _isIphone, _isSmartphone, _isSymbian, _isWindowsMobile, _prepareDeviceInfo, _saveDeviceToCache, createWurflFactory, getDevice, getDeviceCapabilities, getDeviceFallBack, getWurflVersion, removeWurflFactory,

__construct( ) : Dot_UserAgent

Description

Constructor, set the WURFL configuration paramethers

Return value

Type Description
Dot_UserAgent

Tags

Name Description
access public

_getDeviceForHttpRequest( object   $server, ) : object

Description

Return a hige un-usable object . Use it with precaution !

Arguments

Name Type Description Default
$server object where is usually an object similar with $_SERVER global variable

Return value

Type Description
object

Tags

Name Description
access private , we don't want to be called within controller, is too expensive

_getDeviceForUserAgent( string   $userAgent, ) : object

Description

Return a hige un-usable object . Use it with precaution !

Arguments

Name Type Description Default
$userAgent string UserAgent, usually $_SERVER["HTTP_USER_AGENT"]

Return value

Type Description
object

Tags

Name Description
access private , we don't want to be called within controller, is too expensive

_getDeviceFromCache( object   $cacheToken, ) :

Description

Retrieve from cache a serializes array with device infos. Called only when we have the _cache set

Arguments

Name Type Description Default
$cacheToken object

Return value

Type Description

Tags

Name Description
access private

_isAndroid(   $deviceOsName, ) : bool

Description

Check again device OS Name the string Android

Arguments

Name Type Description Default
$deviceOsName n/a

Return value

Type Description
bool

Tags

Name Description
access private

_isBlackberry(   $deviceFallBack, ) : bool

Description

Check again device fallBack the string Blackberry

Arguments

Name Type Description Default
$deviceFallBack n/a

Return value

Type Description
bool

Tags

Name Description
access private

_isIphone(   $deviceFallBack, ) : bool

Description

Check again device fallBack the string iphone

Arguments

Name Type Description Default
$deviceFallBack n/a

Return value

Type Description
bool

Tags

Name Description
access private

_isSmartphone( array   $deviceCapabilities, bool   $isMobile,   $deviceOs, ) : bool

Description

Check device capabilities for screen size. We assume that a screen size lower then 240x320 is not a real smartphone, but more something that you can shove it up your ass ( a.k.a "feature phone") Second mandatory condition: to have an Operating System

Arguments

Name Type Description Default
$deviceCapabilities array
$isMobile bool
$deviceOs n/a

Return value

Type Description
bool

Tags

Name Description
access private

_isSymbian( object   $deviceOsName, ) : bool

Description

Check if is a Symbian device

Arguments

Name Type Description Default
$deviceOsName object

Return value

Type Description
bool

_isWindowsMobile( object   $deviceOsName, object   $isMobile, ) : bool

Description

Check if is an Windows Mobile device

Arguments

Name Type Description Default
$deviceOsName object
$isMobile object

Return value

Type Description
bool

_prepareDeviceInfo( object   $userAgent, ) : object

Description

Core function. Prepare the device short info

Arguments

Name Type Description Default
$userAgent object

Return value

Type Description
object

Tags

Name Description
access private

_saveDeviceToCache( object   $device,   $cacheToken, ) : void

Description

Save into the cache the device info array

Arguments

Name Type Description Default
$device object , $cacheToken
$cacheToken n/a

Return value

Type Description
void

createWurflFactory( ) : void

Description

Create the WURFL object and store the content. Use with precaution !!! As will load a lot of files

Return value

Type Description
void

Tags

Name Description
access public

getDevice( object   $userAgent, ) : array

Description

get from WURFL huge object only few interesting params

Arguments

Name Type Description Default
$userAgent object

Return value

Type Description
array with short summary related to device

Tags

Name Description
access public

getDeviceCapabilities( string   $userAgent, ) : array

Description

Return a nice usable array with device capabilities

Arguments

Name Type Description Default
$userAgent string

Return value

Type Description
array

Tags

Name Description
access public

getDeviceFallBack( object   $userAgent, ) :

Description

Return device fall back, for instance the string 'apple_iphone_ver3_1_2'

Arguments

Name Type Description Default
$userAgent object

Return value

Type Description

getWurflVersion( ) : bidimensional

Description

Get information about WURFL

Return value

Type Description
bidimensional array, with version and lastUpdated

Tags

Name Description
access public

removeWurflFactory( ) : void

Description

Remove the content from the persistent storage

Return value

Type Description
void

Tags

Name Description
access public

Properties

$_cache,

  private  $_cache =


Documentation was generated by DocBlox.

Packages

  • Admin
    • Admin
      Admin Model Here are all the actions related to the user
    • Admin_View
      Admin View Class class that prepare output related to User controller
    • System
      System Model Here are all the actions related to the system settings
    • System_View
      System View Class class that prepare output related to User controller
    • User
      User Model Here are all the actions related to the user
    • User_View
      User View Class class that prepare output related to User controller
    • View
      Admin View abstract over the Dot_Template class
  • DotKernel
    • DotLibrary
    • Frontend
      • Page
        Page Model Dummy class, is not doing anything
      • Page
        Page Model Dummy class, is not doing anything yet
      • Page_View
        Page View Class functions that prepare output related to Page controller
      • User
        User Model Here are all the actions related to the user
      • User_View
        User View Class class that prepare output related to User controller
      • View
        View Model abstract over the Dot_Template class
    • Mobile
      • Page_View
        Page View Class functions that prepare output related to Page controller
      • View
        View Model abstract over the Dot_Template class
    • Rss
      • Sample
        Sample Model Here are all the actions related to the Sample
      • Sample_View
        Sample View Class
      • View
        View class - used for outputting rss content