mosOSData.php

Go to the documentation of this file.
00001 <?php
00016 class mosOSData {
00017 
00018 private $osSearchOrder = array (
00019 "windows nt 6\.0",
00020 "windows nt 5\.2",
00021 "windows nt 5\.1",
00022 "windows nt 5\.0",
00023 "winnt4\.0",
00024 "winnt",
00025 "windows 98",
00026 "windows 95",
00027 "win98",
00028 "win95",
00029 "mac os x",
00030 "debian",
00031 "freebsd",
00032 "linux",
00033 "ppc",
00034 "beos",
00035 "sunos",
00036 "apachebench",
00037 "aix",
00038 "irix",
00039 "osf",
00040 "hp-ux",
00041 "netbsd",
00042 "bsdi",
00043 "openbsd",
00044 "gnu",
00045 "unix"
00046 );
00047 
00048 private $osAlias = array (
00049 "windows nt 6\.0"=>"Windows Longhorn",
00050 "windows nt 5\.2"=>"Windows 2003",
00051 "windows nt 5\.0"=>"Windows 2000",
00052 "windows nt 5\.1"=>"Windows XP",
00053 "winnt"=>"Windows NT",
00054 "winnt 4\.0"=>"Windows NT",
00055 "windows 98"=>"Windows 98",
00056 "win98"=>"Windows 98",
00057 "windows 95"=>"Windows 95",
00058 "win95"=>"Windows 95",
00059 "sunos"=>"Sun Solaris",
00060 "freebsd"=>"FreeBSD",
00061 "ppc"=>"Macintosh",
00062 "mac os x"=>"Mac OS X",
00063 "linux"=>"Linux",
00064 "debian"=>"Debian",
00065 "beos"=>"BeOS",
00066 "winnt4\.0"=>"Windows NT 4.0",
00067 "apachebench"=>"ApacheBench",
00068 "aix"=>"AIX",
00069 "irix"=>"Irix",
00070 "osf"=>"DEC OSF",
00071 "hp-ux"=>"HP-UX",
00072 "netbsd"=>"NetBSD",
00073 "bsdi"=>"BSDi",
00074 "openbsd"=>"OpenBSD",
00075 "gnu"=>"GNU/Linux",
00076 "unix"=>"Unknown Unix system"
00077 );
00078 
00079     function getOS ($agent) {
00080         foreach ($this->osSearchOrder as $key) {
00081             if (preg_match( "/$key/i", $agent )) {
00082                 return $this->osAlias[$key];
00083             }
00084         }
00085         return 'Unknown';
00086     }
00087 
00088 }

Generated on Wed May 14 13:01:56 2008 for ALIRO by  doxygen 1.5.5