Tera-WURFL is a project mainly written in PHP, it's free.
Tera-WURFL is a PHP & MySQL based library that uses the Wireless Universal Resource File (WURFL) to identify specific mobile device capabilities and features.
JUST GET ME TO THE INSTALLATION! Ok, it took me a lot longer to write this then it will take you to read it, so please read EVERYTHING from INSTALLATION on. Feel free to email me if you need help with anything, or to request new features.
ABOUT TERA-WURFL Tera-WURFL is a PHP based library with a database backend (MySQL, MSSQL, MongoDB) that uses the Wireless Universal Resource File (WURFL). The WURFL website nicely defines the WURFL as follows: "The WURFL is an "ambitious" configuration file that contains info about all known Wireless devices on earth. Of course, new devices are created and released at all times. While this configuration file is bound to be out of date one day after each update, chances are that the WURFL lists all of the WAP devices you can purchase in the nearest shops."
Tera-WURFL takes some functionality from the original PHP Tools Library by Andrea Trasatti and a prerelease version of the Java WURFL Evolution. It serves as a drop in replacement for the original PHP Tools with only minor changes to your existing code. Since Tera-WURFL uses a database backend, the real world performance increase over the existing PHP Tools implementation is extremely high - normally between 5x and 10x faster!
The author of Tera-WURFL is Steve Kamerman, a professional PHP Programmer, MySQL DBA, Flash/Flex Actionscript Developer, Linux Administrator, IT Manager and part-time American Soldier. This project was originally sponsored by Tera Technologies and was developed as an internal project used for delivering content to customers of the mobile ringtone and image creation site Tera-Tones.com.
Read more about Tera-WURFL and download the latest release at: http://www.tera-wurfl.com/
See what else Steve Kamerman has cookin' at his blog: http://www.stevekamerman.com/
INSTALLATION
CONFIGURATION FILE
FILE PERMISSIONS
DATABASE OPTIONS
LOADING THE Tera-WURFL DATABASE
Database Update OK
WURFL Version: www.wurflpro.com - 2009-08-25 08:15:48 (Tue Aug 25 08:19:41 -0500 2009) WURFL Devices: 13714 PATCH New Devices: 3036 PATCH Merged Devices: 2
Update Complete!
If there are errors, they are most likely problems connecting to the WURFL site or permission problems trying to write the temporary downloaded file to the DATADIR directory. Also, many users have reported a "memory allocation" error - to fix this look for "OVERRIDE_MEMORY_LIMIT" in the config file. If there are no errors, click on "Return to administration tool".
ADMINISTRATION PAGE 11.Verify that the WURFL is loaded by clicking on "Statistics, Settings, Log File". You should see that there is data in your MERGE and INDEX tables. The CACHE table will fill up with cached data as devices access your site, and it will be cleared ONLY if you click on "Clear the device cache" from main administration page. 12.Click on "Tera-WURFL test script" to test the installation. You can type in any user agent to search for it in the WURFL. If you have caching enabled (default), the first time you search for a user agent you will see the total number of queries that Tera-WURFL performed to find a match (unless there was no match). If there was a match, the device will be cached and the next time you search for it you will see "Total Queries: 1 (Found in cache)". Tera-WURFL only needed to perform 1 query since the devices full capabilities were cached. If you go back to the admin page and look at the settings, you will see that the CACHE now has a couple rows in it. You can verify the device was cached properly by going to "Cache Browser" from the main page and clicking on your user agent.
SECURITY 13.You should delete the admin/install.php file if everything is working ok. 14.Protect your 'admin' directory by using a method specific to your web server software. For Apache, this means a .htaccess file would work: http://www.mobilefish.com/developer/apache/apache_quickguide_htaccess.html#protect
EXAMPLE Here is a very simple example: <?php // Include the Tera-WURFL file require_once('./TeraWurfl.php');
// instantiate the Tera-WURFL object $wurflObj = new TeraWurfl();
// Get the capabilities of the current client. $wurflObj->getDeviceCapabilitiesFromAgent();
// see if this client is on a wireless device (or if they can't be identified) if(!$wurflObj->getDeviceCapability("is_wireless_device")){ echo "
// see what this device's preferred markup language is echo "Markup: ".$wurflObj->getDeviceCapability("preferred_markup");
// see the display resolution
$width = $wurflObj->getDeviceCapability("resolution_width");
$height = $wurflObj->getDeviceCapability("resolution_height");
echo "
Resolution: $width x $height
";
?>
The complete list of capabilities is available here: http://wurfl.sourceforge.net/help_doc.php#product_info If you use $wurflObj->getDeviceCapability("cap_name") you can just use the capability name from the WURFL site, otherwise you can access it directly from the wurfl object's capabilities array like this: $wurflObj->capabilities['group_name']['cap_name']
Please see the test script (check_wurfl.php) for another example of usage.
SUPPORT
Please direct your questions to the Tera-WURFL Forum: http://www.tera-wurfl.com/forum You can also contact Steve Kamerman by sending a GitHub message: https://github.com/kamermans/