X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;f=testbed%2Fua_test.php;h=97309b3b84102bbcfa2b93d37603a335544bf793;hb=c797f39a6abd6294e222b01d9be5d53ef442462a;hp=4fe45a72b5558036d46a1b114284813a14f0f9f0;hpb=a8464009aaa1e6f4f3e1125345309e504a121e06;p=php-utility-classes.git
diff --git a/testbed/ua_test.php b/testbed/ua_test.php
index 4fe45a7..97309b3 100644
--- a/testbed/ua_test.php
+++ b/testbed/ua_test.php
@@ -5,6 +5,9 @@ include("inchandler.inc");
$wrapper->pgtop("KaiRo's Browser-Test");
+// set default time zone - right now, always the one the server is in!
+date_default_timezone_set('Europe/Vienna');
+
$httpvars = $util->getHTTPvars();
if (strlen($httpvars["ua"])) {
$ua = new userAgent($httpvars["ua"]);
@@ -16,23 +19,30 @@ else {
print("
KaiRo's Browser-Test
\n");
print("I read the following user agent string from ".(strlen($httpvars["ua"])?"your input":"your browser").":\n
");
-print("".$ua->uastring."\n");
-
-print("
This is ".($ua->isns()?"a":"no")." Netscape browser.\n");
-print("
This is ".($ua->isns4()?"a":"no")." Netscape Communicator 4 browser.\n");
-print("
This is ".($ua->isie()?"an":"no")." Internet Explorer browser.\n");
-print("
This is ".($ua->geckobased()?"a":"no")." Gecko-based browser.\n");
-print("
This is ".($ua->khtmlbased()?"a":"no")." KHTML-based browser.\n");
-print("
This is ".($ua->isbot()?"an":"no")." automated robot.\n");
-print("
The browser brand is reported as "".$ua->getBrand().""\n");
+print("".$ua->getUAString()."\n");
+
+print("
The browser brand is reported as "".$ua->getBrand().""\n");
print("
The browser version is reported as "".$ua->getVersion().""\n");
-if ($ua->geckobased()) { print("
The Gecko date is reported as "".$ua->geckodate().""\n"); }
+print("
The browser engine is reported as "".$ua->getEngine().""\n");
+print("
The engine version is reported as "".$ua->getEngineVersion().""\n");
+print("
The operating system is reported as "".$ua->getOS().""\n");
+print("
The system platform is reported as "".$ua->getPlatform().""\n");
+print("
The browser language is reported as "".$ua->getLanguage().""\n");
+if ($ua->hasEngine('gecko')) {
+ print("
The Gecko date is reported as "".$ua->getGeckoDate().""\n");
+ print("
The full Gecko date/time is reported as "".date('r',$ua->getGeckoTime()).""\n");
+}
print("
I conclude this must be ".$ua->getBrand()." ".$ua->getVersion()."\n");
+print("
This is ".($ua->isBot()?"an":"no")." automated robot.\n");
+
+$acclang = $ua->getAcceptLanguages();
+print("
Accepted Languages: ");
+foreach ($acclang as $lang=>$q) { print($lang."(".$q.") "); }
+print("\n");
print("
Test the following UA string (leave empty to read it from your browser):\n");
print("\n");
-
$wrapper->pgbottom();
?>