|
|
(7 intermediate revisions not shown) |
Line 1: |
Line 1: |
- | WALL4PHP is the PHP version of the [http://wurfl.sourceforge.net/java/wall.php WURFL WALL Library] by Luca Passani. It was written by Kaspars Foigts and was originally maintained on the [http://wall.laacz.lv/ WALL4PHP website].
| |
| | | |
- | In order to increase compatibility with Tera-WURFL, an updated version of the library is maintained here at the Tera-WURFL site.
| |
- | ===Download===
| |
- | You can download the updated WALL4PHP library from the [[Downloads#WALL4PHP|Tera-WURFL Downloads page]].
| |
- |
| |
- | ===Installation (Standard Tera-WURFL)===
| |
- | After you download and extract the WALL4PHP library, you must edit [b]wall_prepend.php[/b] (excerpt shown below). On line 28, you need to set the location of your Tera-WURFL installation.
| |
- |
| |
- | <geshi lang="php" lines="1">
| |
- | <?php
| |
- |
| |
- | if (!defined('WALL_INCLUDED')) {
| |
- |
| |
- | # We explicitly tell wurfl_class to use cache.php.
| |
- | # From PHP_Tools by Andrea.
| |
- | # WARNING: This fails with:
| |
- | # Notice: Constant LOG_LEVEL already defined in [..path..]/wurfl/wurfl_class.php on line 89
| |
- | ### define('LOG_LEVEL', 0);
| |
- |
| |
- | # Shall we use classic PHP Tools or Tera WURFL?
| |
- | define('WALL_USE_TERA_WURFL', true);
| |
- | # For Tera-WURFL 1.x use '1', for 2.x use '2'
| |
- | # For the Tera-WURFL Remote Webservice, use 'webservice'
| |
- | define('TERA_WURFL_VERSION', 2);
| |
- | # If you are using the Tera-WURFL Remote Webservice, set this to the URL of the webservice
| |
- | define('TERA_WURFL_WEBSERVICE_URL','http://localhost/Tera-Wurfl/webservice.php');
| |
- |
| |
- | # Configuration of PHP Tools or Tera WURFL by Steve Kamerman
| |
- | if (defined('WALL_USE_TERA_WURFL') && WALL_USE_TERA_WURFL) {
| |
- | switch(TERA_WURFL_VERSION){
| |
- | case 1:
| |
- | require_once(dirname(__FILE__) . '/tera-wurfl/tera_wurfl_config.php');
| |
- | break;
| |
- | case 2:
| |
- | // For Tera-WURFL 2.x we just need to load the Tera-WURFL class
| |
- | // TODO: Set this to the location of your TeraWurfl.php file.
| |
- | require_once(dirname(__FILE__) . '../../Tera-WURFL/TeraWurfl.php');
| |
- | break;
| |
- | case 'webservice':
| |
- | // For the Tera-WURFL 2.x Remote Webservice we just need to load the remote client
| |
- | // TODO: Set this to the location of your TeraWurflRemoteClient.php file.
| |
- | require_once(dirname(__FILE__) . '/TeraWurflRemoteClient.php');
| |
- | break;
| |
- | }
| |
- | } else {
| |
- | require_once(dirname(__FILE__) . '/wurfl/wurfl_config.php');
| |
- | }
| |
- | </geshi>
| |
- |
| |
- | ===Installation (Remote Webservice)===
| |
- | After you download and extract the WALL4PHP library, you must edit '''wall_prepend.php''' (excerpt shown below).<br/>
| |
- | You can either edit line 33 and provide the location of your '''TeraWurflRemoteClient.php''' file, or you can just copy that file and place it in the WALL4PHP directory.<br/>
| |
- | Line 15: Set '''TERA_WURFL_VERSION''' to '''webservice''' (the default is '''2''').<br/>
| |
- | Line 17: Set '''TERA_WURFL_WEBSERVICE_URL''' to the URL of your Tera-WURFL installation's '''webservice.php'''
| |
- | <geshi lang="php" lines="1">
| |
- | <?php
| |
- |
| |
- | if (!defined('WALL_INCLUDED')) {
| |
- |
| |
- | # We explicitly tell wurfl_class to use cache.php.
| |
- | # From PHP_Tools by Andrea.
| |
- | # WARNING: This fails with:
| |
- | # Notice: Constant LOG_LEVEL already defined in [..path..]/wurfl/wurfl_class.php on line 89
| |
- | ### define('LOG_LEVEL', 0);
| |
- |
| |
- | # Shall we use classic PHP Tools or Tera WURFL?
| |
- | define('WALL_USE_TERA_WURFL', true);
| |
- | # For Tera-WURFL 1.x use '1', for 2.x use '2'
| |
- | # For the Tera-WURFL Remote Webservice, use 'webservice'
| |
- | define('TERA_WURFL_VERSION', 'webservice');
| |
- | # If you are using the Tera-WURFL Remote Webservice, set this to the URL of the webservice
| |
- | define('TERA_WURFL_WEBSERVICE_URL','http://localhost/Tera-Wurfl/webservice.php');
| |
- |
| |
- | # Configuration of PHP Tools or Tera WURFL by Steve Kamerman
| |
- | if (defined('WALL_USE_TERA_WURFL') && WALL_USE_TERA_WURFL) {
| |
- | switch(TERA_WURFL_VERSION){
| |
- | case 1:
| |
- | require_once(dirname(__FILE__) . '/tera-wurfl/tera_wurfl_config.php');
| |
- | break;
| |
- | case 2:
| |
- | // For Tera-WURFL 2.x we just need to load the Tera-WURFL class
| |
- | // TODO: Set this to the location of your TeraWurfl.php file.
| |
- | require_once(dirname(__FILE__) . '../../Tera-WURFL/TeraWurfl.php');
| |
- | break;
| |
- | case 'webservice':
| |
- | // For the Tera-WURFL 2.x Remote Webservice we just need to load the remote client
| |
- | // TODO: Set this to the location of your TeraWurflRemoteClient.php file.
| |
- | require_once(dirname(__FILE__) . '/TeraWurflRemoteClient.php');
| |
- | break;
| |
- | }
| |
- | } else {
| |
- | require_once(dirname(__FILE__) . '/wurfl/wurfl_config.php');
| |
- | }
| |
- | </geshi>
| |