DatabaseConnector
From Tera-WURFL
The Tera-WURFL DatabaseConnector object provides a database logic abstraction layer. It contains all the database-related logic for Tera-WURFL, making it easy to extend the system to support new databases. Every DatabaseConnector must extend the TeraWurflDatabase Interface so it maintains compatibility with the existing code.
There are three DatabaseConnectors included with Tera-WURFL as of v 2.0.1:
- MySQL4: Provides compatibility with MySQL 4.x. This DatabaseConnector is also compatible with MySQL 5.x as is does not contain any stored procedures or other MySQL 5 features. The performance of this connector is 10-20% slower on average than the MySQL5 connector.
- MySQL5: Provides compatibility with MySQL 5.x and improves performance over the MySQL4 connector by moving the Reduction in String (RIS) algorithm to a MySQL Stored Procedure as well as performing some other logic on the database directly.
- MSSQL2005: ***EXPERIMENTAL*** Provides compatibility with Microsoft SQL Server 2005/2008. As of 05Feb2010 this connector is considerably slower than either of the MySQL connectors. The Reduction in String (RIS) stored procedure has been ported to T-SQL but performs many times slower than expected. If you are experimenting with this connector, you can edit the TeraWurflDatabase_MSSQL2005 file and change the $implements_ris property to false to disable the native T-SQL RIS code; this will force the library to use the internal PHP RIS function which is much faster.