fmII
Sun, May 11th home | browse | articles | contact | chat | submit | faq | newsletter | about | stats | scoop 20:02 PDT
in
Section
login «
register «
recover password «
[Project] add release | add branch | add screenshot | broken links | change owner | email subscribers | update project | update branch (urls) [Project]

 Tera-WURFL - Default branch
Section: Unix

 

Added: Sat, Oct 28th 2006 13:21 PDT (1 year, 6 months ago) Updated: Tue, Jul 24th 2007 00:05 PDT (9 months, 22 days ago)


Screenshot About:
Tera-WURFL is a PHP class that can identify the capabilities of mobile devices using the standardized Wireless Universal Resource File (WURFL). This implementation uses the same methods as the stock PHP WURFL library, but significantly improves performance by storing the WURFL data in a MySQL database. You can also obtain a thumbnail image of the device and include your own device definitions in a patch file. It can figure out if the client visiting your site is a mobile device or a desktop Web browser. It can also identify a wide variety of capabilities.

Author:
Steve Kamerman [contact developer]

Rating:
(not rated)

Homepage:
http://www.tera-wurfl.com
Zip:
http://devel.teratechnologies.net/tera-wurfl/tera_wurfl-stable_v1.5.2.zip
Demo site:
http://devel.tera-tones.com:8000/ringtones/tera_wurfl/admin/

Trove categories: [change]
[Development Status]  4 - Beta, 5 - Production/Stable
[Environment]  Handheld
[Intended Audience]  Developers
[License]  OSI Approved :: Mozilla Public License (MPL)
[Operating System]  OS Independent
[Programming Language]  PHP
[Topic]  Internet :: WWW/HTTP, Internet :: WWW/HTTP :: Dynamic Content, Software Development :: Libraries :: PHP Classes

Dependencies: [change]
No dependencies filed

 
Project admins: [change]
» Steve Kamerman (Owner)

» Rating: (not rated)
» Vitality: 0.00% (Rank 8801)
» Popularity: 0.31% (Rank 17333)

project statsdownload stats
(click to enlarge graphs)
   Record hits: 3,753
   URL hits: 843
   Subscribers: 7

Other projects from the same categories:
Djambala
PHP Ticket
Macao
WidgetServer
My Guestbook

Users who subscribed to this project also subscribed to:
Star Voyager
Object Shell
Nautix
TuneQuiz
ispCP Omega


Add comment · Rate this project · Subscribe to new releases · Ignore this project · Email this project to a friend · Project record in XML

 Branches

Branch Version Last release License URLs
Default Stable 1.5.2 24-Jul-2007 Mozilla Public License (MPL) Homepage Zip

 Comments

[»] PHP5 + MySQL5 Version
by Steve Kamerman - Oct 31st 2006 18:31:25

I've been playing around with MySQL 5's Stored Procedures a bit, and I completely implemented the searching section of $obj->getDeviceCapabilitesFromAgent method in 1 stored procedure. This one is a mouthfull but could speed things up significantly!

CREATE PROCEDURE `findUserAgent`(IN minlen INT, IN ua VARCHAR(128), IN preferroot TINYINT)
findua:BEGIN
DECLARE curlen INT;
DECLARE prematch VARCHAR(45) DEFAULT NULL;
DECLARE matches INT DEFAULT 0;
DECLARE maxmatch INT DEFAULT 0;
/* Look for an exact match first */
SELECT deviceID INTO prematch FROM tera_wurfl_hybrid WHERE user_agent=ua LIMIT 1;
IF prematch IS NOT NULL
THEN
/* Found an exact match - done. */
SELECT "Matched Exactly" AS match_type;
SELECT * FROM tera_wurfl_hybrid WHERE deviceID=prematch;
LEAVE findua;
END IF;
/* See if there is ever going to be a match */
SELECT COUNT(user_agent) INTO maxmatch FROM tera_wurfl_hybrid WHERE user_agent LIKE (CONCAT(LEFT(ua,minlen),'%'));
IF maxmatch = 0
THEN
/* No matches were found, even down to the smallest char length - we don't need to continue */
SELECT "Will Never Match" AS match_type;
LEAVE findua;
END IF;
/* We've already tested the full length and the smallest length, so don't test them again */
SELECT LEFT(ua, curlen - 1 ) INTO ua;
SET minlen = minlen + 1;
SELECT CHAR_LENGTH(ua) INTO curlen;
WHILE ( curlen > minlen AND matches = 0) DO
SELECT COUNT(user_agent) INTO matches FROM tera_wurfl_hybrid WHERE user_agent LIKE CONCAT(ua,'%');
IF matches > 0 AND curlen > minlen
THEN
SELECT "Matched After Trimming" AS match_type;
IF preferroot = 1
THEN
/* We would prefer a device root if there are multiple matching user agents */
SELECT * FROM tera_wurfl_hybrid WHERE user_agent LIKE CONCAT(ua,'%') ORDER BY actual_device_root DESC LIMIT 1;
LEAVE findua;
ELSE
/* We could really through a 'ORDER BY RAND() ' in there if we wanted to get creative */
SELECT * FROM tera_wurfl_hybrid WHERE user_agent LIKE CONCAT(ua,'%') ORDER BY actual_device_root ASC LIMIT 1;
LEAVE findua;
END IF;
END IF;
SELECT LEFT(ua, curlen - 1 ) INTO ua;
SELECT CHAR_LENGTH(ua) INTO curlen;
END WHILE;
/*SELECT "done" AS `status`;*/
SELECT "Did Not Match" AS match_type;
END

I may branch off the main PHP4+MySQL4 version and make a new version using this method since it's so fast.

This is auto formatted very poorly so if you want a copy of it in a different form let me know.

[reply] [top]




© Copyright 2008 SourceForge, Inc., All Rights Reserved.
About freshmeat.net •  Privacy Statement •  Terms of Use •  Trademark Guidelines •  Advertise •  Contact Us • 
ThinkGeek •  Slashdot  •  ITMJ •  Linux.com •  NewsForge  •  SourceForge.net  •  Surveys •  Jobs •  PriceGrabber