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

Source for file TeraWurflConfig.php

Documentation is available at TeraWurflConfig.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 TeraWurfl
  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.  * This static class provides the global configuration settings for Tera-WURFL.
  17.  * @package TeraWurfl
  18.  * @see TeraWurflWebservice
  19.  *
  20.  */
  21.     /**
  22.      * Database Hostname
  23.      * To specify the MySQL 5 TCP port or use a named pipe / socket, put it at the end of your hostname,
  24.      * seperated by a colon (ex: "localhost:3310" or "localhost:/var/run/mysqld/mysqld.sock").
  25.      * For MS SQL Server, use the format HOSTNAME\Instance, like "MYHOSTNAME\SQLEXPRESS".
  26.      * For MongoDB, enter a hostname or a MongoDB Connection String, like "mongodb:///tmp/mongodb-27017.sock,localhost:27017"
  27.      * @var String 
  28.      */
  29.     public static $DB_HOST "localhost";
  30.     /**
  31.      * Database User
  32.      * For MongoDB, this may be blank if authentication is not used
  33.      * @var String 
  34.      */
  35.     public static $DB_USER "terawurfluser";
  36.     /**
  37.      * Database Password
  38.      * For MongoDB, this may be blank if authentication is not used
  39.      * @var String 
  40.      */
  41.     public static $DB_PASS 'wurfl';
  42.     /**
  43.      * Database Name / Schema Name
  44.      * @var String 
  45.      */
  46.     public static $DB_SCHEMA "tera_wurfl_demo";
  47.     /**
  48.      * Database Connector (MySQL4, MySQL5, MSSQL2005, MongoDB)
  49.      * @var String 
  50.      */
  51.     public static $DB_CONNECTOR "MySQL5";
  52.     /**
  53.      * Prefix used for all database tables
  54.      * @var String 
  55.      */
  56.     public static $TABLE_PREFIX "TeraWurfl";
  57.     /**
  58.      * URL of WURFL File.  If you have multiple installations of Tera-WURFL, you can set this to a location on your network.
  59.      * @var String 
  60.      */
  61.     public static $WURFL_DL_URL "http://downloads.sourceforge.net/project/wurfl/WURFL/latest/wurfl-latest.zip";
  62.     /**
  63.      * URL of CVS WURFL File
  64.      * @var String 
  65.      */
  66.     public static $WURFL_CVS_URL "http://wurfl.cvs.sourceforge.net/%2Acheckout%2A/wurfl/xml/wurfl.xml";
  67.     /**
  68.      * Data Directory
  69.      * @var String 
  70.      */
  71.     public static $DATADIR 'data/';
  72.     /**
  73.      * Enable Caching System
  74.      * @var Bool 
  75.      */
  76.     public static $CACHE_ENABLE true;
  77.     /**
  78.      * Enable Patches (must reload WURFL after changing)
  79.      * @var Bool 
  80.      */
  81.     public static $PATCH_ENABLE true;
  82.     /**
  83.      * Filename of patch file.  If you want to use more than one, seperate them with semicolons.  They are loaded in order.
  84.      * ex: $PATCH_FILE = 'web_browsers_patch.xml;custom_patch_ver2.3.xml';
  85.      * @var String 
  86.      */
  87.     public static $PATCH_FILE 'custom_web_patch.xml;web_browsers_patch.xml';
  88.     /**
  89.      * Filename of main WURFL file (found in DATADIR; default: wurfl.xml)
  90.      * @var String 
  91.      */
  92.     public static $WURFL_FILE 'wurfl.xml';
  93.     /**
  94.      * Filename of Log File (found in DATADIR; default: wurfl.log)
  95.      * @var String 
  96.      */
  97.     public static $LOG_FILE 'wurfl.log';
  98.     /**
  99.      * Log Level as defined by PHP Constants LOG_ERR, LOG_WARNING and LOG_NOTICE.
  100.      * Should be changed to LOG_WARNING or LOG_ERR for production sites
  101.      * @var Int 
  102.      */
  103.     public static $LOG_LEVEL LOG_WARNING;
  104.     /**
  105.      * Enable to override PHP's memory limit if you are having problems loading the WURFL data like this:
  106.      * Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in TeraWurflLoader.php on line 287
  107.      * @var Bool 
  108.      */
  109.     public static $OVERRIDE_MEMORY_LIMIT true;
  110.     /**
  111.      * PHP Memory Limit.  See OVERRIDE_MEMORY_LIMIT for more info
  112.      * @var String 
  113.      */
  114.     public static $MEMORY_LIMIT "768M";
  115.     /**
  116.      * Enable the SimpleDesktop Matching Engine.  This feature bypasses the advanced detection methods that are normally used while detecting
  117.      * desktop web browsers; instead, most desktop browsers are detected using simple keywords and expressions.  When enabled, this setting
  118.      *  will increase performance dramatically (200% in our tests) but could result in some false positives.  This will also reduce the size
  119.      *  of the cache table dramatically because all the devices detected by the SimpleDesktop Engine will be cached in one cache entry.
  120.      * @var Bool 
  121.      */
  122.     public static $SIMPLE_DESKTOP_ENGINE_ENABLE true;
  123.     /**
  124.      * Allows you to store only the specified capabilities from the WURFL file.  By default, every capability in the WURFL is stored in the
  125.      * database and made available to your scripts.  If you only want to know if the device is wireless or not, you can store only the
  126.      * is_wireless_device capability.  To disable the filter, set it to false, to enable it, you must set it to an array.  This array can
  127.      * contain the group names (if you want to include the entire group, i.e. "product_info") and/or capability names (if you want just a
  128.      * specific capability, i.e. "is_wireless_device").
  129.      * 
  130.      * Usage Example:
  131.      * <code>
  132.      *    public static $CAPABILITY_FILTER = array(
  133.      *        // Complete Capability Groups
  134.      *        "product_info",
  135.      *    
  136.      *        // Individual Capabilities
  137.      *        "max_image_width",
  138.      *        "max_image_height",
  139.      *        "chtml_make_phone_call_string",
  140.      *    );
  141.      * </code>
  142.      * @var Mixed 
  143.      */
  144.     public static $CAPABILITY_FILTER false;
  145. }

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