X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=tests%2Fua_list.php;fp=tests%2Fua_list.php;h=3b417afd30053ccb5a604cd721e05b179fddb10e;hp=0000000000000000000000000000000000000000;hb=7b9ebce7d25e4eaa557e8a64f8b1ed15aad1a9bb;hpb=6638efd5690cd46471a3e01c164e572956a34aa3 diff --git a/tests/ua_list.php b/tests/ua_list.php new file mode 100644 index 0000000..3b417af --- /dev/null +++ b/tests/ua_list.php @@ -0,0 +1,65 @@ +pgtop('User Agents', $mycss); + +print('

User Agents

'."\n"); + +$ualist = is_readable($uafile)?file($uafile):array(); + +if (count($ualist)) { + print(''."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + + foreach ($ualist as $uastring) { + $uastring = trim($uastring); + if (substr($uastring, 0, 1) == '#') { + // comment + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + } + else { + $ua = new userAgent($uastring); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + print(' '."\n"); + } + } + print('
User Agent stringBrandVersionBotMobEngineeVerOSPlatformLang
'.substr($uastring, 1).'
'.$ua->getUAString().''.$ua->getBrand().''.$ua->getVersion().''.($ua->isBot()?'x':'-').''.($ua->isMobile()?'x':'-').''.$ua->getEngine().''.$ua->getEngineVersion().''.$ua->getOS().''.$ua->getPlatform().''.$ua->getLanguage().'
'."\n"); +} +else { + print('No User Agent strings found in file "'.$uafile.'".'."\n"); +} + +$wrapper->pgbottom(); +?>