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

Source for file TeraWurflDatabase_MySQL5_Profiling.php

Documentation is available at TeraWurflDatabase_MySQL5_Profiling.php

  1. <?php
  2. /**
  3.  * Tera_WURFL - PHP MySQL driven WURFL
  4.  * 
  5.  * Tera-WURFL was written by Steve Kamerman, and is based on the
  6.  * Java WURFL Evolution package by Luca Passani and WURFL PHP Tools by Andrea Trassati.
  7.  * This version uses a MySQL database to store the entire WURFL file, multiple patch
  8.  * files, and a persistent caching mechanism to provide extreme performance increases.
  9.  * 
  10.  * @package TeraWurflDatabase
  11.  * @author Steve Kamerman <stevekamerman AT gmail.com>
  12.  * @version Stable 2.1.3 $Date: 2010/09/18 15:43:21
  13.  * @license http://www.mozilla.org/MPL/ MPL Vesion 1.1
  14.  */
  15. /**
  16.  * Include required files
  17.  */
  18. require_once realpath(dirname(__FILE__).'/TeraWurflDatabase_MySQL5.php');
  19. /**
  20.  * Include required files
  21.  */
  22. require_once realpath(dirname(__FILE__).'/phpMyProfiler.php');
  23. /**
  24.  * Provides connectivity from Tera-WURFL to MySQL 5
  25.  * This "Profiling" connector logs profile data from MySQL during its queries
  26.  * @package TeraWurflDatabase
  27.  */
  28.     protected $profiler;
  29.     /**
  30.      * The path and file prefix to use for storing MySQL Query Profiles
  31.      * @var string 
  32.      */
  33.     protected $profile_log = "/tmp/TeraWurflProfile-";
  34.     /**
  35.      * Establishes connection to database (does not check for DB sanity)
  36.      */
  37.     public function connect(){
  38.         parent::connect();
  39.         $this->profiler = new phpMyProfiler($this->dbcon,$this->profile_log);
  40.     }
  41.     public function getDeviceFromUA_RIS($userAgent,$tolerance,UserAgentMatcher &$matcher){
  42.         $return parent::getDeviceFromUA_RIS($userAgent,$tolerance,$matcher);
  43.         $this->profiler->log();
  44.         return $return;
  45.     }
  46. }

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