protected function checkPlatform()
{
if (stripos($this->_agent, 'win') !== false) {
$this->_platform = self::PLATFORM_WINDOWS;
if (preg_match("/wi(n|ndows)[ \\-]?nt[ \\/]?6\\.(2|3)/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_8;
} elseif (preg_match("/wi(n|ndows)[ \\-]?nt[ \\/]?10\\.0/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_10;
} elseif (preg_match("/wi(n|ndows)[ \\-]?nt[ \\/]?6\\.1/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_7;
} elseif (preg_match("/wi(n|ndows)[ \\-]?nt[ \\/]?6\\.0/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_VISTA;
} elseif (preg_match("/wi(n|ndows)[ \\-]?(2003|nt[ \\/]?5\\.2)/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_2003;
} elseif (preg_match("/windows xp/i", $this->_agent) or preg_match("/wi(n|ndows)[ \\-]?nt[ \\/]?5\\.1/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_XP;
} elseif (preg_match("/wi(n|ndows)[ \\-]?ce/i", $this->_agent)) {
$this->_platform = self::PLATFORM_WINDOWS_CE;
}
} elseif (stripos($this->_agent, 'iPad') !== false) {
$this->_platform = self::PLATFORM_IPAD;
} elseif (stripos($this->_agent, 'iPod') !== false) {
$this->_platform = self::PLATFORM_IPOD;
} elseif (stripos($this->_agent, 'iPhone') !== false) {
$this->_platform = self::PLATFORM_IPHONE;
} elseif (stripos($this->_agent, 'mac') !== false) {
$this->_platform = self::PLATFORM_APPLE;
} elseif (stripos($this->_agent, 'android') !== false) {
$this->_platform = self::PLATFORM_ANDROID;
} elseif (stripos($this->_agent, 'linux') !== false or preg_match("/mdk for ([0-9.]{1,10})/i", $this->_agent)) {
$this->_platform = self::PLATFORM_LINUX;
} elseif (stripos($this->_agent, 'Nokia') !== false) {
$this->_platform = self::PLATFORM_NOKIA;
} elseif (stripos($this->_agent, 'BlackBerry') !== false) {
$this->_platform = self::PLATFORM_BLACKBERRY;
} elseif (stripos($this->_agent, 'FreeBSD') !== false) {
$this->_platform = self::PLATFORM_FREEBSD;
} elseif (stripos($this->_agent, 'OpenBSD') !== false) {
$this->_platform = self::PLATFORM_OPENBSD;
} elseif (stripos($this->_agent, 'NetBSD') !== false) {
$this->_platform = self::PLATFORM_NETBSD;
} elseif (stripos($this->_agent, 'OpenSolaris') !== false) {
$this->_platform = self::PLATFORM_OPENSOLARIS;
} elseif (stripos($this->_agent, 'SunOS') !== false) {
$this->_platform = self::PLATFORM_SUNOS;
} elseif (stripos($this->_agent, 'OS\\/2') !== false or preg_match("/warp[ \\/]?([0-9.]{1,10})/i", $this->_agent)) {
$this->_platform = self::PLATFORM_OS2;
} elseif (stripos($this->_agent, 'BeOS') !== false) {
$this->_platform = self::PLATFORM_BEOS;
} elseif (stripos($this->_agent, 'irix') !== false) {
$this->_platform = self::PLATFORM_IRIX;
} elseif (stripos($this->_agent, 'Palm') !== false) {
$this->_platform = self::PLATFORM_PALM;
}
}