1 | <?php |
||
10 | trait Browser |
||
11 | { |
||
12 | /** |
||
13 | * Get client ip-address |
||
14 | * |
||
15 | * @return null|string User ip-address |
||
16 | */ |
||
17 | public static function getClientIpAddress($fallbackReturn = null) |
||
35 | |||
36 | /** |
||
37 | * Get client operating system |
||
38 | * |
||
39 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
40 | * |
||
41 | * @used-by: Holt45::kbdSymbol() |
||
42 | * |
||
43 | * @return null|string User operating system(win|mac|linux) |
||
44 | */ |
||
45 | public static function getClientOperatingSystem() |
||
61 | |||
62 | /** |
||
63 | * Get client browser |
||
64 | * |
||
65 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
66 | * |
||
67 | * @deprecated 0.6 Need total rewrite with decent patterns. |
||
68 | * |
||
69 | * @return null|string User browser(Internet Explorer|Camino|Firefox|Safari|Chrome|Konqueror|Opera) |
||
70 | */ |
||
71 | public static function getClientBrowser() |
||
100 | |||
101 | /** |
||
102 | * Check if browser is Google Chrome and not one of the browsers derived from Google Chrome. |
||
103 | * |
||
104 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
105 | * |
||
106 | * @return bool |
||
107 | */ |
||
108 | public static function isClientBrowserGoogleChrome() |
||
121 | |||
122 | /** |
||
123 | * Get access key modifiers |
||
124 | * |
||
125 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
126 | * |
||
127 | * @link https://en.wikipedia.org/wiki/Access_key Source |
||
128 | * |
||
129 | * @param string $accessKey |
||
130 | * @param string $getClientBrowser |
||
131 | * @param string $getClientOperatingSystem |
||
132 | * @return array|null |
||
133 | */ |
||
134 | public static function getBrowserAccessKeyModifiers($accessKey = null, $getClientBrowser = "auto", $getClientOperatingSystem = "auto") |
||
168 | } |
||
169 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.