class Browser

Browser, Useragent Snippets

Constants

POST

GET

PUT

DELETE

Methods

__construct()

Constructor

array
getRequestInfo()

Get Request Info

int
getXelosAppVersion()

Checks if the request comes from the XELOS App and determines the version based on the user agent returns the major app version or 0 if the reques does not come from the APP

array
get_browser_info(string $agent = null)

Returns browser name and version info

string
get_browser_shortname()

Returns a human readable short string of the current browser of the user

string
get_hostname()

Returns the client hostname (DNS) if available

string|null
get_ip()

returns the client ip and checks therefor if user was forwarded by a proxy

array
get_long_info()

Get long Information about everything we can find out at this point

get_resolution()

Returns the browser resultion and device pixel ration / retine (dpr) if available The values are being detected in the frontend via JavaScript and passed as cookie. Therefore the first request to a XELOS system might not have the values ready

get_touch_status()

Returns if the browser device has_touch: The device is generally capable of interpreting touch inputs (e.g. Windows Tables with Touchscreen) use_touch: The user is currently using the device in touch mode. Use this value for best interface compatibility with hybrid devices (e.g. Windows Touch Laptop which is being used with a traditional mouse)

string
get_user_agent()

put your comment there.

string
get_version()

Returns numeric version of client

bool
isMatchingNetmask(string ...$networks)

Check if client/browser matches a given set of networks/ip ranges

bool
isRequestMethod(string $method = Browser::GET)

Is current Request of given Method?

static bool
isVUEBlobRequest() deprecated

Is the current request a blob request? Content requested in this call will be added to the iframe with src="blob:" and is slighty restricted: e.g. when origin-security is applied in JS content or forms are missing the action="" attribute

static bool
isVUEFrameRequest()

Very similar to the BlobRequest, but iframe is not using blob binary

bool
is_android(bool|string $user_agent = false)

Checks if the browser is running on Android and is not the XELOS app.

bool
is_chrome(bool|string $user_agent = false)

Returns TRUE of agent is Chrome

bool
is_device_ipad(bool|string $user_agent = false)

No description

bool
is_device_iphone(bool|string $user_agent = false)

No description

bool
is_device_ipod_touch(bool|string $user_agent = false)

No description

bool
is_firefox(string $user_agent = false)

Returns TRUE of agent is Firefox

is_hdpi_device()

Returns true if the DEVICE is a HighDPI / Retina Device

bool
is_ie(string $user_agent = false)

Returns TRUE of agent is Internet Explorer

bool
is_ios(bool|string $user_agent = false)

Returns true if it is an iOS browser and not the XELOS app.

bool
is_ip_in_range(string $ip, string $range)

Check if a given ip is in a network

bool
is_mobile(bool|string $user_agent = false, bool $strict = false)

Is Mobile Device/Browser?

bool
is_mobile_safari(bool|string $user_agent = false)

mobile Safari for

bool
is_ms_office()

Checks for MS Office App Useragent

bool
is_ms_office_mobile()

Checks for MS Office Mobile App Useragent e.g. Microsoft Office Word/2.23.304 (iOS/12.1.4; Phone; de-DE; AppStore; Apple/iPhone10,6)

is_post_request()

No description

bool
is_safari_webapp(bool|string $user_agent = false)

No description

bool
is_unsupported_browser()

Checks if the current browser of the user is supported or not by this xelos version

bool
is_xdc(string $user_agent = false)

Returns TRUE of agent is xelos Desktop Connector Tool (xdc)

bool
is_xelos_app()

Checks for XELOS App Useragent

bool
is_xoi(string $user_agent = false)

Returns TRUE of agent is xelos Office Integration (XOI)

static bool
removeCookie(string $name)

Remove a previously set cookie

bool
sendXAccelRedirect(string $path_to_file)

Send X-Accel-Redirect Header for NGINX

void
send_canonical_header(null $url = null, bool $overwrite = false)

Send Canonical HTTP Header

static bool
setCookie(string $name, string $value = '', int $expires = 0)

Set cookie using the correct global options (secure, httponly, samesite, domain)

Details

at line 23
__construct()

Constructor

at line 632
array getRequestInfo()

Get Request Info

Return Value

array

at line 471
int getXelosAppVersion()

Checks if the request comes from the XELOS App and determines the version based on the user agent returns the major app version or 0 if the reques does not come from the APP

Return Value

int

major app version

at line 64
array get_browser_info(string $agent = null)

Returns browser name and version info

Parameters

string $agent

Return Value

array

('browser' => [NAME], 'version' => [VERSION])

at line 232
string get_browser_shortname()

Returns a human readable short string of the current browser of the user

Return Value

string

at line 285
string get_hostname()

Returns the client hostname (DNS) if available

Return Value

string

at line 265
string|null get_ip()

returns the client ip and checks therefor if user was forwarded by a proxy

Return Value

string|null ip

at line 249
array get_long_info()

Get long Information about everything we can find out at this point

Return Value

array

at line 191
get_resolution()

Returns the browser resultion and device pixel ration / retine (dpr) if available The values are being detected in the frontend via JavaScript and passed as cookie. Therefore the first request to a XELOS system might not have the values ready

at line 210
get_touch_status()

Returns if the browser device has_touch: The device is generally capable of interpreting touch inputs (e.g. Windows Tables with Touchscreen) use_touch: The user is currently using the device in touch mode. Use this value for best interface compatibility with hybrid devices (e.g. Windows Touch Laptop which is being used with a traditional mouse)

at line 32
string get_user_agent()

put your comment there.

..

Return Value

string

at line 41
string get_version()

Returns numeric version of client

Return Value

string

at line 591
bool isMatchingNetmask(string ...$networks)

Check if client/browser matches a given set of networks/ip ranges

Parameters

string ...$networks

Return Value

bool

at line 304
bool isRequestMethod(string $method = Browser::GET)

Is current Request of given Method?

Parameters

string $method

Return Value

bool

at line 542
static bool isVUEBlobRequest() deprecated

deprecated Is not really in use anymore

Is the current request a blob request? Content requested in this call will be added to the iframe with src="blob:" and is slighty restricted: e.g. when origin-security is applied in JS content or forms are missing the action="" attribute

Return Value

bool

at line 551
static bool isVUEFrameRequest()

Very similar to the BlobRequest, but iframe is not using blob binary

Return Value

bool

at line 514
bool is_android(bool|string $user_agent = false)

Checks if the browser is running on Android and is not the XELOS app.

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 345
bool is_chrome(bool|string $user_agent = false)

Returns TRUE of agent is Chrome

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 431
bool is_device_ipad(bool|string $user_agent = false)

No description

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

is this an Apple iOS Device/Browser?

at line 421
bool is_device_iphone(bool|string $user_agent = false)

No description

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

is this an Apple iOS Device/Browser?

at line 440
bool is_device_ipod_touch(bool|string $user_agent = false)

No description

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

is this an Apple iOS Device/Browser?

at line 334
bool is_firefox(string $user_agent = false)

Returns TRUE of agent is Firefox

Parameters

string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 221
is_hdpi_device()

Returns true if the DEVICE is a HighDPI / Retina Device

at line 321
bool is_ie(string $user_agent = false)

Returns TRUE of agent is Internet Explorer

Parameters

string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 412
bool is_ios(bool|string $user_agent = false)

Returns true if it is an iOS browser and not the XELOS app.

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

is this an Apple iOS Device/Browser?

at line 561
bool is_ip_in_range(string $ip, string $range)

Check if a given ip is in a network

Parameters

string $ip

IP to check in IPV4 format eg. 127.0.0.1

string $range

IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 and 127.0.0.* is accepted

Return Value

bool

true if the ip is in this range / false if not.

at line 358
bool is_mobile(bool|string $user_agent = false, bool $strict = false)

internal  param strict $is ? (includes also if mobile=1 from GPVars)
 

Is Mobile Device/Browser?

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

bool $strict

Return Value

bool

true if mobile

at line 526
bool is_mobile_safari(bool|string $user_agent = false)

mobile Safari for

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 493
bool is_ms_office()

Checks for MS Office App Useragent

Return Value

bool

at line 502
bool is_ms_office_mobile()

Checks for MS Office Mobile App Useragent e.g. Microsoft Office Word/2.23.304 (iOS/12.1.4; Phone; de-DE; AppStore; Apple/iPhone10,6)

Return Value

bool

at line 289
is_post_request()

No description

at line 451
bool is_safari_webapp(bool|string $user_agent = false)

No description

Parameters

bool|string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 49
bool is_unsupported_browser()

Checks if the current browser of the user is supported or not by this xelos version

Return Value

bool

at line 392
bool is_xdc(string $user_agent = false)

Returns TRUE of agent is xelos Desktop Connector Tool (xdc)

Parameters

string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 461
bool is_xelos_app()

Checks for XELOS App Useragent

Return Value

bool

at line 401
bool is_xoi(string $user_agent = false)

Returns TRUE of agent is xelos Office Integration (XOI)

Parameters

string $user_agent

custom user-agent. if boolean false, else use default global $_SERVER['HTTP_USER_AGENT']

Return Value

bool

at line 673
static bool removeCookie(string $name)

Remove a previously set cookie

Parameters

string $name

Return Value

bool

at line 688
bool sendXAccelRedirect(string $path_to_file)

Send X-Accel-Redirect Header for NGINX

Parameters

string $path_to_file

Absolute path to file. File MUST be located under _files, all other files are not valid

Return Value

bool status

at line 611
void send_canonical_header(null $url = null, bool $overwrite = false)

Send Canonical HTTP Header

Parameters

null $url

Canonical URL (absoulte with http:// ), if no URL is supplied this URL will determined automatically

bool $overwrite

Should previously set headers be overriden? (Only possible if headers have not been sent yet)

Return Value

void

at line 651
static bool setCookie(string $name, string $value = '', int $expires = 0)

Set cookie using the correct global options (secure, httponly, samesite, domain)

Parameters

string $name
string $value
int $expires

0 - Until Session ends

Return Value

bool