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() |
||
60 | |||
61 | /** |
||
62 | * Get client browser |
||
63 | * |
||
64 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
65 | * |
||
66 | * @return null|string User browser |
||
67 | */ |
||
68 | public static function getClientBrowser() |
||
86 | |||
87 | /** |
||
88 | * Check if browser is Google Chrome and not one of the browsers derived from Google Chrome. |
||
89 | * |
||
90 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public static function isClientBrowserGoogleChrome() |
||
105 | |||
106 | /** |
||
107 | * Get access key modifiers |
||
108 | * |
||
109 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
110 | * |
||
111 | * @link https://en.wikipedia.org/wiki/Access_key Source |
||
112 | * |
||
113 | * @param string|null $accessKey |
||
114 | * @param string $getClientBrowser |
||
115 | * @param string $getClientOperatingSystem |
||
116 | * @return array|null |
||
117 | */ |
||
118 | public static function getBrowserAccessKeyModifiers( |
||
155 | } |
||
156 |
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.