@@ 118-132 (lines=15) @@ | ||
115 | * |
|
116 | * @return bool |
|
117 | */ |
|
118 | private static function checkOSX(Os $os, UserAgent $userAgent) |
|
119 | { |
|
120 | if (stripos($userAgent->getUserAgentString(), 'OS X') !== false) { |
|
121 | $os->setName($os::OSX); |
|
122 | if (preg_match('/OS X ([\d\._]*)/i', $userAgent->getUserAgentString(), $matches)) { |
|
123 | if (isset($matches[1])) { |
|
124 | $os->setVersion(str_replace('_', '.', $matches[1])); |
|
125 | } |
|
126 | } |
|
127 | ||
128 | return true; |
|
129 | } |
|
130 | ||
131 | return false; |
|
132 | } |
|
133 | ||
134 | /** |
|
135 | * Determine if the user's operating system is Windows. |
|
@@ 215-229 (lines=15) @@ | ||
212 | * |
|
213 | * @return bool |
|
214 | */ |
|
215 | private static function checkWindowsPhone(Os $os, UserAgent $userAgent) |
|
216 | { |
|
217 | if (stripos($userAgent->getUserAgentString(), 'Windows Phone') !== false) { |
|
218 | $os->setName($os::WINDOWS_PHONE); |
|
219 | // Windows version |
|
220 | if (preg_match('/Windows Phone ([\d\.]*)/i', $userAgent->getUserAgentString(), $matches)) { |
|
221 | if (isset($matches[1])) { |
|
222 | $os->setVersion((float)$matches[1]); |
|
223 | } |
|
224 | } |
|
225 | ||
226 | return true; |
|
227 | } |
|
228 | return false; |
|
229 | } |
|
230 | ||
231 | /** |
|
232 | * Determine if the user's operating system is SymbOS. |