PHP Класс CI_User_agent, TastyIgniter

Identifies the platform, browser, robot, or mobile devise of the browsing agent
Автор: EllisLab Dev Team
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$agent string Current user-agent
$browser string Current user-agent browser
$browsers array List of browsers to compare against current user agent
$charsets array Character sets accepted by the current user agent
$is_browser boolean Flag for if the user-agent belongs to a browser
$is_mobile boolean Flag for if the user-agent is a mobile browser
$is_robot boolean Flag for if the user-agent is a robot
$languages array Languages accepted by the current user agent
$mobile string Current user-agent mobile name
$mobiles array List of mobile browsers to compare against current user agent
$platform string Current user-agent platform
$platforms array List of platforms to compare against current user agent
$referer mixed HTTP Referer
$robot string Current user-agent robot name
$robots array List of robots to compare against current user agent
$version string Current user-agent version

Открытые методы

Метод Описание
__construct ( ) : void Constructor
accept_charset ( string $charset = 'utf-8' ) : boolean Test for a particular character set
accept_lang ( string $lang = 'en' ) : boolean Test for a particular language
agent_string ( ) : string Agent String
browser ( ) : string Get Browser Name
charsets ( ) : array Get the accepted Character Sets
is_browser ( string $key = NULL ) : boolean Is Browser
is_mobile ( string $key = NULL ) : boolean Is Mobile
is_referral ( ) : boolean Is this a referral from another site?
is_robot ( string $key = NULL ) : boolean Is Robot
languages ( ) : array Get the accepted languages
mobile ( ) : string Get the Mobile Device
parse ( string $string ) : void Parse a custom user-agent string
platform ( ) : string Get Platform
referrer ( ) : boolean Get the referrer
robot ( ) : string Get The Robot Name
version ( ) : string Get the Browser Version

Защищенные методы

Метод Описание
_compile_data ( ) : boolean Compile the User Agent Data
_load_agent_file ( ) : boolean Compile the User Agent Data
_set_browser ( ) : boolean Set the Browser
_set_charsets ( ) : void Set the accepted character sets
_set_languages ( ) : void Set the accepted languages
_set_mobile ( ) : boolean Set the Mobile Device
_set_platform ( ) : boolean Set the Platform
_set_robot ( ) : boolean Set the Robot

Описание методов

__construct() публичный Метод

Sets the User Agent and runs the compilation routine
public __construct ( ) : void
Результат void

_compile_data() защищенный Метод

Compile the User Agent Data
protected _compile_data ( ) : boolean
Результат boolean

_load_agent_file() защищенный Метод

Compile the User Agent Data
protected _load_agent_file ( ) : boolean
Результат boolean

_set_browser() защищенный Метод

Set the Browser
protected _set_browser ( ) : boolean
Результат boolean

_set_charsets() защищенный Метод

Set the accepted character sets
protected _set_charsets ( ) : void
Результат void

_set_languages() защищенный Метод

Set the accepted languages
protected _set_languages ( ) : void
Результат void

_set_mobile() защищенный Метод

Set the Mobile Device
protected _set_mobile ( ) : boolean
Результат boolean

_set_platform() защищенный Метод

Set the Platform
protected _set_platform ( ) : boolean
Результат boolean

_set_robot() защищенный Метод

Set the Robot
protected _set_robot ( ) : boolean
Результат boolean

accept_charset() публичный Метод

Test for a particular character set
public accept_charset ( string $charset = 'utf-8' ) : boolean
$charset string
Результат boolean

accept_lang() публичный Метод

Test for a particular language
public accept_lang ( string $lang = 'en' ) : boolean
$lang string
Результат boolean

agent_string() публичный Метод

Agent String
public agent_string ( ) : string
Результат string

browser() публичный Метод

Get Browser Name
public browser ( ) : string
Результат string

charsets() публичный Метод

Get the accepted Character Sets
public charsets ( ) : array
Результат array

is_browser() публичный Метод

Is Browser
public is_browser ( string $key = NULL ) : boolean
$key string
Результат boolean

is_mobile() публичный Метод

Is Mobile
public is_mobile ( string $key = NULL ) : boolean
$key string
Результат boolean

is_referral() публичный Метод

Is this a referral from another site?
public is_referral ( ) : boolean
Результат boolean

is_robot() публичный Метод

Is Robot
public is_robot ( string $key = NULL ) : boolean
$key string
Результат boolean

languages() публичный Метод

Get the accepted languages
public languages ( ) : array
Результат array

mobile() публичный Метод

Get the Mobile Device
public mobile ( ) : string
Результат string

parse() публичный Метод

Parse a custom user-agent string
public parse ( string $string ) : void
$string string
Результат void

platform() публичный Метод

Get Platform
public platform ( ) : string
Результат string

referrer() публичный Метод

Get the referrer
public referrer ( ) : boolean
Результат boolean

robot() публичный Метод

Get The Robot Name
public robot ( ) : string
Результат string

version() публичный Метод

Get the Browser Version
public version ( ) : string
Результат string

Описание свойств

$agent публичное свойство

Current user-agent
public string $agent
Результат string

$browser публичное свойство

Current user-agent browser
public string $browser
Результат string

$browsers публичное свойство

List of browsers to compare against current user agent
public array $browsers
Результат array

$charsets публичное свойство

Character sets accepted by the current user agent
public array $charsets
Результат array

$is_browser публичное свойство

Flag for if the user-agent belongs to a browser
public bool $is_browser
Результат boolean

$is_mobile публичное свойство

Flag for if the user-agent is a mobile browser
public bool $is_mobile
Результат boolean

$is_robot публичное свойство

Flag for if the user-agent is a robot
public bool $is_robot
Результат boolean

$languages публичное свойство

Languages accepted by the current user agent
public array $languages
Результат array

$mobile публичное свойство

Current user-agent mobile name
public string $mobile
Результат string

$mobiles публичное свойство

List of mobile browsers to compare against current user agent
public array $mobiles
Результат array

$platform публичное свойство

Current user-agent platform
public string $platform
Результат string

$platforms публичное свойство

List of platforms to compare against current user agent
public array $platforms
Результат array

$referer публичное свойство

HTTP Referer
public mixed $referer
Результат mixed

$robot публичное свойство

Current user-agent robot name
public string $robot
Результат string

$robots публичное свойство

List of robots to compare against current user agent
public array $robots
Результат array

$version публичное свойство

Current user-agent version
public string $version
Результат string