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

Source for file tera_wurfl_config.php

Documentation is available at tera_wurfl_config.php

  1. <?php
  2. /*
  3.  * Tera_WURFL - PHP MySQL driven WURFL
  4.  * 
  5.  * Tera-WURFL was written by Steve Kamerman, Tera Technologies and is based on the
  6.  * WURFL PHP Tools from http://wurfl.sourceforge.net/.  This version uses a MySQL database
  7.  * to store the entire WURFL file to provide extreme performance increases.
  8.  * 
  9.  * @package tera_wurfl
  10.  * @author Steve Kamerman, Tera Technologies (kamermans AT teratechnologies DOT net)
  11.  * @version Stable 1.5.0 $Date: 2007/02/27 04:23:25 $
  12.  * @license http://www.mozilla.org/MPL/ MPL Vesion 1.1
  13.  * $Id: tera_wurfl_config.php,v 1.1.4.5.2.21 2007/02/27 04:23:25 kamermans Exp $
  14.  * $RCSfile: tera_wurfl_config.php,v $
  15.  * 
  16.  * Based On: WURFL PHP Tools by Andrea Trasatti ( atrasatti AT users DOT sourceforge DOT net )
  17.  *
  18.  */
  19. $branch "Stable";
  20. $version "1.5.0";
  21. /*
  22.  * This is the configuration file for Tera-WURFL PHP class.
  23.  * All configurable options are in this file.
  24.  *
  25.  * Defines used by this library:
  26.  * 
  27.  * -- Database options --
  28.  * DB_HOST                string,    database server hostname or IP
  29.  * DB_USER                string,    database username (needs SELECT,INSERT,DELETE,DROP,CREATE)
  30.  * DB_PASS                string, database password
  31.  * DB_SCHEMA            string, database schema (database name)
  32.  * DB_TYPE                string, database table type (MyISAM, InnoDB, HEAP, etc...);
  33.  * DB_DEVICE_TABLE        string, database table name for the WURFL
  34.  * DB_PATCH_TABLE        string, database table name for the patch
  35.  * DB_HYBRID_TABLE        string, database table name for the Hybrid of the WURFL and the patch
  36.  * DB_CACHE_TABLE        string, database table name for the Cache
  37.  * DB_MULTI_INSERT        boolean,use multiple inserts to speed DB updating
  38.  * DB_MAX_INSERTS        integer,number of inserts per query
  39.  * DB_EMPTY_METHOD        string, either DROP_CREATE or EMPTY; method for emptying tables.
  40.  * DB_TEMP_EXT            string, extension that will be used for temporary tables like "mytablename_TEMP"
  41.  * 
  42.  * -- General options --
  43.  * WURFL_DL_URL            string, full URL to the current WURFL
  44.  * WURFL_CVS_URL        string, full URL to development (CVS) WURFL
  45.  * WURFL_CONFIG            boolean,lets other file know the config is loaded
  46.  * DATADIR                string,    where all data is stored (wurfl.xml, temp files, logs)
  47.  * IMAGE_CHECKING        boolean,checks the IMAGE_DIR for an image that matches the device
  48.  * IMAGE_DIR            string, relative path to the device images with trailing slash
  49.  * WURFL_CACHE_ENABLE    boolean,enables the DB caching system
  50.  * WURFL_PATCH_ENABLE    boolean,enables or disables the patch
  51.  * WURFL_PATCH_FILE        string, optional patch file for WURFL
  52.  * WURFL_PARSER_FILE    string, path and filename of wurfl_parser.php
  53.  * WURFL_CLASS_FILE        string, path and filename of wurfl_class.php
  54.  * WURFL_FILE            string, path and filename of wurfl.xml
  55.  * WURFL_LOG_FILE         string, defines full path and filename for logging
  56.  * LOG_LEVEL            integer, desired logging level. Use the same constants as for PHP logging
  57.  *
  58.  */
  59.  
  60. /**
  61.  * Database hostname or IP Address
  62.  */
  63. define("DB_HOST","localhost");
  64. /**
  65.  * Database username
  66.  */
  67. define("DB_USER","wurfluser");
  68. /**
  69.  * Database password
  70.  */
  71. define("DB_PASS","wurfl");
  72. /**
  73.  * Database schema (the database name itself)
  74.  */
  75. define("DB_SCHEMA","tera-wurfl");
  76. /**
  77.  * Database type - you probably want to use either "InnoDB" or "MyISAM".
  78.  * In testing I have found MyISAM to be about 10% faster than InnoDB.
  79.  * Note: You can use any database type that your server supports
  80.  */
  81. define("DB_TYPE","MyISAM");
  82. /**
  83.  * The table you want to use to store the WURFL devices
  84.  */
  85. define("DB_DEVICE_TABLE","tera_wurfl_devices");
  86. /**
  87.  * The table you want to use to store the WURFL patch file devices
  88.  */
  89. define("DB_PATCH_TABLE","tera_wurfl_patch");
  90. /**
  91.  * The table you want to use to store the hybrid data (the merged data
  92.  * between the WURFL and the patch.  This is only used when WURFL_PATCH_ENABLE
  93.  * is true and a patch is loaded.
  94.  */
  95. define("DB_HYBRID_TABLE","tera_wurfl_hybrid");
  96. /**
  97.  * The table you want to use to store the temporary cache data (given caching
  98.  * is enabled below).
  99.  */
  100. define("DB_CACHE_TABLE""tera_wurfl_cache");
  101. /**
  102.  * The extension used for temporary tables.  These tables are used to allow the
  103.  * class to rollback any changes that fail sanity checks
  104.  */
  105. define("DB_TEMP_EXT","_TEMP");
  106. /**
  107.  * Insert more than one record per query.  This will SIGNIFICANTLY increase the
  108.  * speed of database updates.  See DB_MAX_INSERTS.
  109.  */
  110. define("DB_MULTI_INSERT",true);
  111. /**
  112.  * Number of inserts to use per query - too many will exceed the 'max_allowed_packet'
  113.  * directive in the MySQL configuration file. Using a setting above 1000 wil probably
  114.  * have a negative impact on performance because the queries will be too large.  If
  115.  * your database is not on the same server as your class file you may want to try
  116.  * increasing this number to speed things up a bit since it would result in less queries.
  117.  */
  118. define("DB_MAX_INSERTS",500);
  119. /**
  120.  * Specify the method for emptying tables.  Either "DROP_CREATE" or "EMPTY".  As of
  121.  * version 1.3.0, "DROP_CREATE is HIGHLY recommended for stability, and EMPTY may result
  122.  * in a MySQL warning or error while updating the database.
  123.  */
  124. define("DB_EMPTY_METHOD""DROP_CREATE");
  125. /**
  126.  * The URL to download the current WURFL file from.
  127.  * This was updated on November 16, 2006 v1.4.2
  128.  * TODO: use compressed version to speed up download!
  129.  */
  130. define("WURFL_DL_URL","http://wurfl.sourceforge.net/wurfl.xml");
  131. /**
  132.  * The URL to download the current WURFL file from.
  133.  * This was updated on December 26, 2006 v1.4.3
  134.  */
  135. define("WURFL_CVS_URL","http://wurfl.cvs.sourceforge.net/%2Acheckout%2A/wurfl/xml/wurfl.xml");
  136. /**
  137.  * ALWAYS set this to true - it is how the class knows the config file has been loaded
  138.  */
  139. define("WURFL_CONFIG"true);
  140. /**
  141.  * Where all data is stored (wurfl.xml, cache file, logs, etc)
  142.  */
  143. define("DATADIR"dirname(__FILE__).'/data/')// needs to end with a slash!
  144. /**
  145.  * Try to find an image for the device, accessible like $this->device_image
  146.  */
  147. define("IMAGE_CHECKING"true);
  148. /**
  149.  * Reletive path to images with trailing slash
  150.  */
  151. define("IMAGE_DIR","device_pix/");
  152. /**
  153.  * Enable or disable the WURFL cache.  This can increase performance under
  154.  * heavy database load or slow Web Server <-> DB networks
  155.  */
  156. define("WURFL_CACHE_ENABLE"true);
  157. /**
  158.  * Enable or disable the WURFL patch. This setting takes effect immediately -
  159.  * no database or patch update is required.
  160.  */
  161. define("WURFL_PATCH_ENABLE"true);
  162. /**
  163.  * Path and filename of your custom patch file.  You can use DATADIR."somefile"
  164.  * if your patch file is in the DATADIR directory
  165.  */
  166. define("WURFL_PATCH_FILE"DATADIR.'wurfl.patch.xml');
  167. /**
  168.  * Path and filename of wurfl_parser.php
  169.  */
  170. define("WURFL_PARSER_FILE"dirname(__FILE__).'/admin/tera_wurfl_parser.php');
  171. /*
  172.  * Path and filename of wurfl_class.php
  173.  */
  174. define("WURFL_CLASS_FILE"dirname(__FILE__).'/tera_wurfl.php');
  175. /**
  176.  * Path and name of the local wurfl.xml file
  177.  */
  178. define("WURFL_FILE"DATADIR."wurfl.xml");
  179. /**
  180.  * Path and name of the log file
  181.  */
  182. define("WURFL_LOG_FILE"DATADIR."wurfl.log");
  183. /**
  184.  * Log errors at or above this level of severity.
  185.  * Suggested log level for normal use: LOG_ERR or LOG_WARNING;
  186.  * all options: LOG_INFO, LOG_NOTICE, LOG_WARNING, LOG_ERR
  187.  * This directive is NOT a string value - it is a PHP Constant
  188.  * http://us2.php.net/manual/en/reserved.constants.php
  189.  */
  190. define("LOG_LEVEL"LOG_WARNING);
  191.  
  192. // Variables below this line are used for internal use only and should not be modified.
  193. define("CLASS_DIRNAME"dirname(__FILE__));
  194. //error_reporting(E_ALL);
  195. ?>

Documentation generated on Fri, 27 Apr 2007 12:10:19 -0400 by phpDocumentor 1.3.1