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 | * Convert UA to browser name |
||
63 | * |
||
64 | * @param Useragent-string |
||
65 | * return null|string Browser name |
||
66 | */ |
||
67 | public static function getBrowserNameFromUA($userAgent) |
||
82 | |||
83 | /** |
||
84 | * Get client browser |
||
85 | * |
||
86 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
87 | * |
||
88 | * @return null|string User browser |
||
89 | */ |
||
90 | public static function getClientBrowser() |
||
97 | |||
98 | /** |
||
99 | * Check if browser is Google Chrome and not one of the browsers derived from Google Chrome. |
||
100 | * |
||
101 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | public static function isClientBrowserGoogleChrome() |
||
116 | |||
117 | /** |
||
118 | * Get access key modifiers |
||
119 | * |
||
120 | * NOTICE: HTTP_USER_AGENT is easily spoofed. Don't trust this data. |
||
121 | * |
||
122 | * @link https://en.wikipedia.org/wiki/Access_key Source |
||
123 | * |
||
124 | * @used-by: Holt45::kbdSymbol() |
||
125 | * |
||
126 | * @param string|null $accessKey |
||
127 | * @param string $getClientBrowser |
||
128 | * @param string $getClientOS |
||
129 | * @return array|null |
||
130 | */ |
||
131 | public static function getBrowserAccessKeyModifiers( |
||
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.