API / Minn\Runtime / BrowserGlobals

BrowserGlobals final class

Minn\Runtime\BrowserGlobals · public/minn/src/Minn/Runtime/BrowserGlobals.php · 45 lines

The browser and web server a request names, as the reference's globals have them from boot ($is_chrome, $is_safari, $is_IE, $is_apache, $is_nginx, …; probe vars-matrix): one browser at most, read from the user agent in the reference's order (Lynx, Edge, Opera, Chrome, Safari, Internet Explorer on a Mac then elsewhere, Gecko, Netscape 4), an iPhone being a mobile Safari; the server from SERVER_SOFTWARE, IIS 7 and up apart. Chrome Frame's switch is the facade's (use_google_chrome_frame).

Constants and properties

constNAMES = array ( 0 => 'is_lynx', 1 => 'is_gecko', 2 => 'is_winIE', 3 => 'is_macIE', 4 => 'is_opera', 5 => 'is_NS4', 6 => 'is_safari', 7 => 'is_chrome', 8 => 'is_iphone', 9 => 'is_IE', 10 => 'is_edge', 11 => 'is_apache', 12 => 'is_IIS', 13 => 'is_iis7', 14 => 'is_nginx', 15 => 'is_caddy', )

The globals, in the order the reference sets them.

Public

staticdetect(string $agent, string $software): array#

Each global's value for this user agent and server software.

@return array<string, bool>

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatebrowser(string $agent): ?string#

The one browser global the user agent sets, or null.