|
|
@@ -7,8 +7,16 @@ $autoloader = Zend_Loader_Autoloader::getInstance();
|
|
|
error_reporting(E_ALL);
|
|
|
set_time_limit(0);
|
|
|
|
|
|
-$config['config']['wurflapi']['wurfl_lib_dir'] = dirname(__FILE__) . '/_files/Wurfl/1.1/';
|
|
|
-$config['config']['wurflapi']['wurfl_config_file'] = dirname(__FILE__) . '/_files/Wurfl/resources/wurfl-config.php';
|
|
|
+$config['wurflapi']['wurfl_lib_dir'] = dirname(__FILE__) . '/_files/Wurfl/1.1/';
|
|
|
+$config['wurflapi']['wurfl_config_file'] = dirname(__FILE__) . '/_files/Wurfl/resources/wurfl-config.php';
|
|
|
+$config['terawurfl']['terawurfl_lib_dir'] = dirname(__FILE__) . '/_files/TeraWurfl_2.1.3/tera-WURFL/';
|
|
|
+$config['deviceatlas']['deviceatlas_lib_dir'] = dirname(__FILE__) . '/_files/DA_php_1.4.1/';
|
|
|
+$config['deviceatlas']['deviceatlas_data'] = dirname(__FILE__) . '/_files/DA_php_1.4.1/sample/json/20101014.json';
|
|
|
+$config['mobile']['features']['path'] = 'Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php';
|
|
|
+$config['mobile']['features']['classname'] = 'Zend_Http_UserAgent_Features_Adapter_TeraWurfl';
|
|
|
+$config['mobile']['features']['path'] = 'Zend/Http/UserAgent/Features/Adapter/DeviceAtlas.php';
|
|
|
+$config['mobile']['features']['classname'] = 'Zend_Http_UserAgent_Features_Adapter_DeviceAtlas';
|
|
|
+
|
|
|
$config['server'] = $_SERVER;
|
|
|
|
|
|
if (!empty($_GET['userAgent'])) {
|
|
|
@@ -18,7 +26,7 @@ if (!empty($_GET['userAgent'])) {
|
|
|
}
|
|
|
|
|
|
if (!empty($_GET['sequence'])) {
|
|
|
- $config['config']['identification_sequence'] = $_GET['sequence'];
|
|
|
+ $config['identification_sequence'] = $_GET['sequence'];
|
|
|
}
|
|
|
$oUserAgent = new Zend_Http_UserAgent($config);
|
|
|
|
|
|
@@ -30,7 +38,7 @@ function printBrowserDetails($browser)
|
|
|
$device = $browser->getDevice();
|
|
|
//Zend_Debug::dump($device->getAllFeatures());
|
|
|
if (isset($device)) {
|
|
|
- print "<b>General informations</b>";
|
|
|
+ print "<fieldset><legend><b>General informations</b></legend>";
|
|
|
print "<ul>";
|
|
|
print "<li>Browser Type: " . $browser->getBrowserType() . "</li>";
|
|
|
print "<li>Browser Name: " . $device->getFeature('browser_name') . "</li>";
|
|
|
@@ -39,17 +47,19 @@ function printBrowserDetails($browser)
|
|
|
print "<li>Browser Engine: " . $device->getFeature('browser_engine') . "</li>";
|
|
|
print "<li>Device OS Name: " . $device->getFeature('device_os_name') . "</li>";
|
|
|
print "<li>Device OS token: " . $device->getFeature('device_os_token') . "</li>";
|
|
|
- print "<li>Server Os: " . $device->getFeature('server_os') . "</li>";
|
|
|
- print "<li>Server OS Version: " . $device->getFeature('server_os_version') . "</li>";
|
|
|
+ print "<li>Server OS: " . $device->getFeature('server_os') . "</li>";
|
|
|
+ print "<li>Server Platform: " . $device->getFeature('server_platfom') . "</li>";
|
|
|
+ print "<li>Server Platform Version: " . $device->getFeature('server_platfom_version') . "</li>";
|
|
|
print "</ul>";
|
|
|
+ print '</fieldset>';
|
|
|
|
|
|
- $wurfl = $device->getFeature("mobile_browser");
|
|
|
+ $wurfl = $device->getFeature("brand_name");
|
|
|
if (!$wurfl) {
|
|
|
- print "<b>no WURFL identification</b>";
|
|
|
+ print "<fieldset><legend><b>no WURFL identification</b></legend>";
|
|
|
+ print '</fieldset>';
|
|
|
} else {
|
|
|
- print "<b>WURFL capabilities :</b>";
|
|
|
+ print "<fieldset><legend><b>WURFL capabilities</b></legend>";
|
|
|
print "<ul>";
|
|
|
- print "<li>WURFL ID: " . (isset($device->id) ? $device->id : "") . "</li>";
|
|
|
print "<li>Mobile browser: " . $device->getFeature("mobile_browser") . "</li>";
|
|
|
print "<li>Mobile browser version: " . $device->getFeature("mobile_browser_version") . "</li>";
|
|
|
print "<li>Device Brand Name: " . $device->getFeature("brand_name") . "</li>";
|
|
|
@@ -60,33 +70,44 @@ function printBrowserDetails($browser)
|
|
|
print "<li>Resolution Height:" . $device->getFeature('resolution_height') . "</li>";
|
|
|
print "<li>MP3:" . $device->getFeature('mp3') . "</li>";
|
|
|
print "</ul>";
|
|
|
+ print '</fieldset>';
|
|
|
}
|
|
|
|
|
|
- print "<br /><br />";
|
|
|
- print "<b>Full</b>";
|
|
|
+ print "<fieldset><legend><b>Full</b></legend>";
|
|
|
Zend_Debug::dump($device->getAllFeatures());
|
|
|
+ print '</fieldset>';
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+$options = array(
|
|
|
+ '',
|
|
|
+ 'mobile, text, desktop',
|
|
|
+ 'bot, mobile, validator, checker, console, offline, email, text',
|
|
|
+ 'text, bot, validator, checker, console, offline, email'
|
|
|
+);
|
|
|
?>
|
|
|
|
|
|
<div id="content">
|
|
|
|
|
|
<p><b>Query by providing the user agent:</b></p>
|
|
|
<p>look at <a target="_blank"
|
|
|
- href="http://www.useragentstring.com/pages/useragentstring.php">http://www.useragentstring.com/pages/useragentstring.php</a></p>
|
|
|
+ href="http://www.useragentstring.com/pages/useragentstring.php"
|
|
|
+ target="_blank">http://www.useragentstring.com/pages/useragentstring.php</a>
|
|
|
+or <a href="http://www.user-agents.org/" target="_blank">http://www.user-agents.org/</a></p>
|
|
|
<p>For mobile, look at <a target="_blank"
|
|
|
- href="http://www.mobilemultimedia.be/">http://www.mobilemultimedia.be/</a></p>
|
|
|
+ href="http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones">http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones</a></p>
|
|
|
<fieldset>
|
|
|
<form method="get">
|
|
|
-<div>Sequence : <select name="sequence">
|
|
|
- <option value="">(standard)</option>
|
|
|
- <option value="mobile, text, desktop">mobile, text, desktop</option>
|
|
|
- <option value="bot, validator, checker, console, offline, email, text">bot,
|
|
|
- validator, checker, console, offline, email, text</option>
|
|
|
+<div>Sequence : <select name="sequence" style="width: 500">
|
|
|
+ <?php
|
|
|
+foreach ($options as $option) {
|
|
|
+ $selected = ($option == $_GET['sequence'] ? ' selected ' : '');
|
|
|
+ echo '<option value="' . $option . '"' . $selected . '>' . ($option ? $option : '(standard)') . '</option>';
|
|
|
+}
|
|
|
+?>
|
|
|
</select> (DON'T FORGET TO CLEAN SESSION COOKIE)<br />
|
|
|
-User Agent : <input type="text" name="userAgent" size="40"
|
|
|
+User Agent : <input type="text" name="userAgent" style="width: 700"
|
|
|
value="<?=htmlentities($_GET['userAgent'])?>" /> <br />
|
|
|
<input type="submit" /></div>
|
|
|
</form>
|