TeraWurflDatabase
[ class tree: TeraWurflDatabase ] [ index: TeraWurflDatabase ] [ all elements ]

Class: TeraWurflDatabase_MySQL4

Source Location: /DatabaseConnectors/TeraWurflDatabase_MySQL4.php

Class Overview

TeraWurflDatabase
   |
   --TeraWurflDatabase_MySQL4

Provides connectivity from Tera-WURFL to MySQL 4. This connector is also compatible with MySQL 5.


Variables

Methods


Inherited Variables

Inherited Methods

Class: TeraWurflDatabase

TeraWurflDatabase::__construct()
TeraWurflDatabase::clearTable()
Truncate or drop+create the given table
TeraWurflDatabase::connect()
Establishes a database connection and stores connection in $this->dbcon
TeraWurflDatabase::createCacheTable()
Creates the cache table
TeraWurflDatabase::createGenericDeviceTable()
Creates a table capable of holding devices (WURFL ID, User Agent and Capabilities)
TeraWurflDatabase::createIndexTable()
Creates the index table
TeraWurflDatabase::createProcedures()
Creates supporting stored procedures
TeraWurflDatabase::createSettingsTable()
Creates the settings table
TeraWurflDatabase::getActualDeviceAncestor()
Returns the WURFL ID for the Actual Device Root in the given device's fall back tree. This can be null if it does not exist.
TeraWurflDatabase::getCachedUserAgents()
Returns and array of the cached User Agents
TeraWurflDatabase::getDeviceFallBackTree()
Find the matching Device ID for a given User Agent using LD (Leveshtein Distance)
TeraWurflDatabase::getDeviceFromCache()
Return capabilities array for the given User Agent, or null if not found
TeraWurflDatabase::getDeviceFromID()
Returns the capabilities array from a given WURFL Device ID
TeraWurflDatabase::getDeviceFromUA()
Returns the WURFL ID from a raw User Agent if an exact match is found
TeraWurflDatabase::getDeviceFromUA_LD()
Find the matching Device ID for a given User Agent using LD (Leveshtein Distance)
TeraWurflDatabase::getDeviceFromUA_RIS()
Find the matching Device ID for a given User Agent using RIS (Reduction in String)
TeraWurflDatabase::getFullDeviceList()
Returns an associative array of all the data from the given table in the form [WURFL ID] => [User Agent]
TeraWurflDatabase::getLastError()
Returns the most recent error message
TeraWurflDatabase::getMatcherTableList()
Returns an array of the User Agent Matcher tables in the database
TeraWurflDatabase::getServerVersion()
Returns the version string of the database server
TeraWurflDatabase::getSetting()
Get setting from settings table by a given key
TeraWurflDatabase::getTableList()
Returns an array of all the tables in the database
TeraWurflDatabase::getTableStats()
Returns an associative array of statistics from given table
TeraWurflDatabase::initializeDB()
Creates and prepares the database
TeraWurflDatabase::loadDevices()
Loads the pre-processed WURFL tables into the database
TeraWurflDatabase::rebuildCacheTable()
Rebuilds the cache table by redetecting the cached devices against the loaded WURFL
TeraWurflDatabase::saveDeviceInCache()
Save the given User Agent and Device capabilities array to the database
TeraWurflDatabase::SQLPrep()
Prepares raw text for use in queries (adding quotes and escaping characters if necessary)
TeraWurflDatabase::updateSetting()
Adds/updates a key=>value pair in the settings table
TeraWurflDatabase::verifyConfig()
Checks if the database configuration is correct and that all required permissions

Class Details

[line 20]
Provides connectivity from Tera-WURFL to MySQL 4. This connector is also compatible with MySQL 5.



[ Top ]


Class Variables

static $DB_MAX_INSERTS =  500

[line 36]

The maximum number of new rows that the database can handle in one INSERT statement



Tags:

access:  protected

Type:   unknown_type


[ Top ]

$connected =  false

[line 27]



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]

$dbcon =

[line 29]



Tags:

access:  protected

Type:   mixed
Overrides:   Array


[ Top ]

$db_implements_ld =  false

[line 25]



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]

$db_implements_ris =  false

[line 24]



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]

$errors =

[line 23]



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]

$maxquerysize =  0

[line 31]



Tags:

access:  public

Type:   mixed


[ Top ]

$numQueries =  0

[line 26]



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]



Class Methods


constructor __construct [line 38]

TeraWurflDatabase_MySQL4 __construct( )



Tags:

access:  public


Overrides TeraWurflDatabase::__construct() (parent method not documented)

[ Top ]

destructor __destruct [line 44]

void __destruct( )

Destructor, disconnect from database



Tags:

access:  public


[ Top ]

method clearMatcherTables [line 187]

boolean clearMatcherTables( )

Drops then creates all the UserAgentMatcher device tables



Tags:

return:  success
access:  protected


[ Top ]

method clearTable [line 352]

void clearTable( $tablename)



Tags:

access:  public


Overrides TeraWurflDatabase::clearTable() (Truncate or drop+create the given table)

Parameters:

   $tablename  

[ Top ]

method connect [line 362]

void connect( )

Establishes connection to database (does not check for DB sanity)



Tags:

access:  public


Overrides TeraWurflDatabase::connect() (Establishes a database connection and stores connection in $this->dbcon)

[ Top ]

method createCacheTable [line 276]

void createCacheTable( )



Tags:

access:  public


Overrides TeraWurflDatabase::createCacheTable() (Creates the cache table)

[ Top ]

method createGenericDeviceTable [line 162]

boolean createGenericDeviceTable( string $tablename)

Drops and creates the given device table



Tags:

return:  success
access:  public


Overrides TeraWurflDatabase::createGenericDeviceTable() (Creates a table capable of holding devices (WURFL ID, User Agent and Capabilities))

Parameters:

string   $tablename   Table name (ex: TeraWurflConfig::$HYBRID)

[ Top ]

method createIndexTable [line 215]

boolean createIndexTable( )

Drops and creates the index table



Tags:

return:  success
access:  public


Overrides TeraWurflDatabase::createIndexTable() (Creates the index table)

[ Top ]

method createMergeTable [line 200]

boolean createMergeTable( array $tables)

Drops and creates the MERGE table



Tags:

return:  success
access:  public


Parameters:

array   $tables   Table names

[ Top ]

method createSettingsTable [line 233]

boolean createSettingsTable( )

Creates the settings table if it does not already exist



Tags:

return:  success
access:  public


Overrides TeraWurflDatabase::createSettingsTable() (Creates the settings table)

[ Top ]

method createTempCacheTable [line 290]

void createTempCacheTable( )



Tags:

access:  public


[ Top ]

method getActualDeviceAncestor [line 59]

void getActualDeviceAncestor( $wurflID)



Tags:

access:  public


Overrides TeraWurflDatabase::getActualDeviceAncestor() (Returns the WURFL ID for the Actual Device Root in the given device's fall back tree. This can be null if it does not exist.)

Parameters:

   $wurflID  

[ Top ]

method getCachedUserAgents [line 438]

void getCachedUserAgents( )



Tags:

access:  public


Overrides TeraWurflDatabase::getCachedUserAgents() (Returns and array of the cached User Agents)

[ Top ]

method getDeviceFromCache [line 251]

void getDeviceFromCache( $userAgent)



Tags:

access:  public


Overrides TeraWurflDatabase::getDeviceFromCache() (Return capabilities array for the given User Agent, or null if not found)

Parameters:

   $userAgent  

[ Top ]

method getDeviceFromID [line 48]

void getDeviceFromID( $wurflID)



Tags:

access:  public


Overrides TeraWurflDatabase::getDeviceFromID() (Returns the capabilities array from a given WURFL Device ID)

Parameters:

   $wurflID  

[ Top ]

method getDeviceFromUA [line 83]

void getDeviceFromUA( $userAgent)



Tags:

access:  public


Overrides TeraWurflDatabase::getDeviceFromUA() (Returns the WURFL ID from a raw User Agent if an exact match is found)

Parameters:

   $userAgent  

[ Top ]

method getFullDeviceList [line 69]

void getFullDeviceList( $tablename)



Tags:

access:  public


Overrides TeraWurflDatabase::getFullDeviceList() (Returns an associative array of all the data from the given table in the form [WURFL ID] => [User Agent])

Parameters:

   $tablename  

[ Top ]

method getMatcherTableList [line 406]

void getMatcherTableList( )



Tags:

access:  public


Overrides TeraWurflDatabase::getMatcherTableList() (Returns an array of the User Agent Matcher tables in the database)

[ Top ]

method getServerVersion [line 445]

void getServerVersion( )



Tags:

access:  public


Overrides TeraWurflDatabase::getServerVersion() (Returns the version string of the database server)

[ Top ]

method getSetting [line 384]

void getSetting( $key)



Tags:

access:  public


Overrides TeraWurflDatabase::getSetting() (Get setting from settings table by a given key)

Parameters:

   $key  

[ Top ]

method getTableList [line 399]

void getTableList( )



Tags:

access:  public


Overrides TeraWurflDatabase::getTableList() (Returns an array of all the tables in the database)

[ Top ]

method getTableStats [line 413]

void getTableStats( $table)



Tags:

access:  public


Overrides TeraWurflDatabase::getTableStats() (Returns an associative array of statistics from given table)

Parameters:

   $table  

[ Top ]

method loadDevices [line 95]

void loadDevices( &$tables)



Tags:

access:  public


Overrides TeraWurflDatabase::loadDevices() (Loads the pre-processed WURFL tables into the database)

Parameters:

   &$tables  

[ Top ]

method rebuildCacheTable [line 304]

void rebuildCacheTable( )



Tags:

access:  public


Overrides TeraWurflDatabase::rebuildCacheTable() (Rebuilds the cache table by redetecting the cached devices against the loaded WURFL)

[ Top ]

method saveDeviceInCache [line 265]

void saveDeviceInCache( $userAgent, $device)



Tags:

access:  public


Overrides TeraWurflDatabase::saveDeviceInCache() (Save the given User Agent and Device capabilities array to the database)

Parameters:

   $userAgent  
   $device  

[ Top ]

method SQLPrep [line 394]

void SQLPrep( $value)



Tags:

access:  public


Overrides TeraWurflDatabase::SQLPrep() (Prepares raw text for use in queries (adding quotes and escaping characters if necessary))

Parameters:

   $value  

[ Top ]

method updateSetting [line 378]

void updateSetting( $key, $value)



Tags:

access:  public


Overrides TeraWurflDatabase::updateSetting() (Adds/updates a key=>value pair in the settings table)

Parameters:

   $key  
   $value  

[ Top ]


Documentation generated on Sun, 19 Sep 2010 00:16:00 +0000 by phpDocumentor 1.4.3