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

Class: WURFL_Handlers_Utils

Source Location: /Handlers/Utils.php

Class Overview


WURFL user agent hander utilities


Constants

Methods



Class Details

[line 23]
WURFL user agent hander utilities



[ Top ]


Class Methods


static method checkIfContains [line 437]

static bool checkIfContains( string $haystack, string $needle)

Returns true if $haystack contains $needle



Tags:

access:  public


Parameters:

string   $haystack   Haystack
string   $needle   Needle

[ Top ]

static method checkIfContainsAll [line 460]

static bool checkIfContainsAll( string $haystack, [array $needles = array()])

Returns true if $haystack contains all of the (string)needles in $needles



Tags:

access:  public


Parameters:

string   $haystack   Haystack
array   $needles   Array of (string)needles

[ Top ]

static method checkIfContainsAnyOf [line 447]

static bool checkIfContainsAnyOf( string $haystack, array $needles)

Returns true if $haystack contains any of the (string)needles in $needles



Tags:

access:  public


Parameters:

string   $haystack   Haystack
array   $needles   Array of (string)needles

[ Top ]

static method checkIfContainsCaseInsensitive [line 474]

static bool checkIfContainsCaseInsensitive( string $haystack, string $needle)

Returns true if $haystack contains $needle without regard for case



Tags:

access:  public


Parameters:

string   $haystack   Haystack
string   $needle   Needle

[ Top ]

static method checkIfStartsWith [line 484]

static bool checkIfStartsWith( string $haystack, string $needle)

Returns true if $haystack starts with $needle



Tags:

access:  public


Parameters:

string   $haystack   Haystack
string   $needle   Needle

[ Top ]

static method checkIfStartsWithAnyOf [line 494]

static bool checkIfStartsWithAnyOf( string $haystack, array $needles)

Returns true if $haystack starts with any of the $needles



Tags:

access:  public


Parameters:

string   $haystack   Haystack
array   $needles   Array of (string)needles

[ Top ]

static method firstMatchOrLength [line 426]

static int firstMatchOrLength( string $string, string $toMatch)

First occurance of $toMatch string or length



Tags:

return:  Char index
access:  public


Parameters:

string   $string   Haystack
string   $toMatch   Needle

[ Top ]

static method firstSemiColonOrLength [line 416]

static int firstSemiColonOrLength( string $string)

First occurance of a ; character or length



Tags:

return:  Char index
access:  public


Parameters:

string   $string   Haystack

[ Top ]

static method firstSlash [line 384]

static int firstSlash( string $string)

First occurance of a / character



Tags:

return:  Char index
access:  public


Parameters:

string   $string   Haystack

[ Top ]

static method firstSpace [line 406]

static int firstSpace( string $string)

First occurance of a space character



Tags:

return:  Char index
access:  public


Parameters:

string   $string   Haystack

[ Top ]

static method getMobileCatchAllId [line 265]

static bool getMobileCatchAllId( string $userAgent)

Returns true if the give $userAgent is from a mobile device



Tags:

access:  public


Parameters:

string   $userAgent  

[ Top ]

static method indexOfAnyOrLength [line 204]

static int indexOfAnyOrLength( string $userAgent, [array $needles = array()], int $startIndex)

Lowest char index of the first instance of any of the $needles found in $userAgent, starting at $startIndex;

if no match is found, the length of the string is returned




Tags:

return:  Char index of left-most match or length of string
access:  public


Parameters:

string   $userAgent   haystack
array   $needles   Array of (string)needles to search for in $userAgent
int   $startIndex   Char index for start of search

[ Top ]

static method indexOfOrLength [line 190]

static int indexOfOrLength( string $string, string $target, [int $startingIndex = 0])

Char index of the first instance of $string found in $target, starting at $startingIndex;

if no match is found, the length of the string is returned




Tags:

return:  Char index of match or length of string
access:  public


Parameters:

string   $string   haystack
string   $target   needle
int   $startingIndex   Char index for start of search

[ Top ]

static method isDesktopBrowser [line 246]

static bool isDesktopBrowser( string $userAgent)

Returns true if the give $userAgent is from a desktop device



Tags:

access:  public


Parameters:

string   $userAgent  

[ Top ]

static method isDesktopBrowserHeavyDutyAnalysis [line 279]

static bool isDesktopBrowserHeavyDutyAnalysis( string $userAgent)

Is the given user agent very likely to be a desktop browser



Tags:

access:  public


Parameters:

string   $userAgent  

[ Top ]

static method isMobileBrowser [line 227]

static bool isMobileBrowser( string $userAgent)

Returns true if the give $userAgent is from a mobile device



Tags:

access:  public


Parameters:

string   $userAgent  

[ Top ]

static method isSmartTV [line 308]

static bool isSmartTV( string $userAgent)

Returns true if the give $userAgent is from a mobile device



Tags:

access:  public


Parameters:

string   $userAgent  

[ Top ]

static method isSpamOrCrawler [line 327]

static bool isSpamOrCrawler( string $userAgent)

Returns true if the give $userAgent is from a spam bot or crawler



Tags:

access:  public


Parameters:

string   $userAgent  

[ Top ]

static method ldMatch [line 178]

static string ldMatch( array $collection, string $needle, [int $tolerance = 7])

Alias of WURFL_Handlers_Matcher_LDMatcher::match()



Tags:

return:  Matched user agent
see:  WURFL_Handlers_Matcher_LDMatcher::match()
access:  public


Parameters:

array   $collection  
string   $needle  
int   $tolerance  

[ Top ]

static method ordinalIndexOf [line 355]

static int ordinalIndexOf( string $haystack, string $needle, int $ordinal)

The nth($ordinal) occurance of $needle in $haystack or -1 if no match is found



Tags:

return:  Char index of occurance
throws:  InvalidArgumentException
access:  public


Parameters:

string   $haystack  
string   $needle  
int   $ordinal  

[ Top ]

static method removeLocale [line 511]

static string removeLocale( string $userAgent)

Removes the locale portion from the userAgent



Tags:

return:  User agent without language string
access:  public


Parameters:

string   $userAgent  

[ Top ]

static method reset [line 216]

static void reset( )



Tags:

access:  public


[ Top ]

static method risMatch [line 166]

static string risMatch( array $collection, string $needle, int $tolerance)

Alias of WURFL_Handlers_Matcher_RISMatcher::match()



Tags:

return:  Matched user agent
see:  WURFL_Handlers_Matcher_RISMatcher::match()
access:  public


Parameters:

array   $collection  
string   $needle  
int   $tolerance  

[ Top ]

static method secondSlash [line 394]

static int secondSlash( string $string)

Second occurance of a / character



Tags:

return:  Char index
access:  public


Parameters:

string   $string   Haystack

[ Top ]

static method thirdSemiColumn [line 339]

static int thirdSemiColumn( string $haystack)

Returns the position of third occurrence of a ;(semi-column) if it exists

or the string length if no match is found




Tags:

return:  Char index of third semicolon or length
access:  public


Parameters:

string   $haystack  

[ Top ]


Class Constants

WORST_MATCH =  7

[line 29]

The worst allowed match tolerance


[ Top ]



Documentation generated on Fri, 30 Mar 2012 17:17:01 -0400 by phpDocumentor 1.4.4