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

Class: WURFL_Configuration_ArrayConfig

Source Location: /Configuration/ArrayConfig.php

Class Overview

WURFL_Configuration_Config
   |
   --WURFL_Configuration_ArrayConfig

Array-style WURFL configuration. To use this method you must create a php file that contains an array called $configuration with all of the required settings. NOTE: every path that you specify in the configuration must be absolute or relative to the folder that it is in.


Methods


Inherited Constants

Inherited Variables

Inherited Methods


Class Details

[line 63]
Array-style WURFL configuration. To use this method you must create a php file that contains an array called $configuration with all of the required settings. NOTE: every path that you specify in the configuration must be absolute or relative to the folder that it is in.

Example: Here is an example for file persistence without caching

  1.  <?php
  2.  // config.php
  3.  $configuration array(
  4.    'wurfl' => array(
  5.      'main-file' => "wurfl.xml",
  6.      'patches' => array("web_browsers_patch.xml"),
  7.    ),
  8.    'match-mode' => 'high-accuracy',
  9.    'allow-reload' => true,
  10.    'persistence' => array(
  11.      'provider' => "file",
  12.      'params' => array(
  13.        'dir' => "storage/persistence",
  14.      ),
  15.    ),
  16.    'cache' => array(
  17.      'provider' => "null",
  18.    ),
  19.  );
  20.  ?>
  21.  <?php
  22.  // usage-example.php
  23.  require_once '/WURFL/Application.php';
  24.  // Here's where we use our config.php file above
  25.  $wurflConfig new WURFL_Configuration_ArrayConfig('config.php');
  26.  $wurflManagerFactory new WURFL_WURFLManagerFactory($wurflConfig);
  27.  $wurflManager $wurflManagerFactory->create();
  28.  $info $wurflManager->getWURFLInfo();
  29.  printf("Version: %s\nUpdated: %s\nOfficialURL: %s\n\n",
  30.    $info->version,
  31.    $info->lastUpdated,
  32.    $info->officialURL
  33.  );
  34.  ?>




[ Top ]


Class Methods


method initialize [line 69]

void initialize( )

Initialize class - gets called from the parent constructor



Tags:

throws:  WURFL_WURFLException configuration not present
access:  protected


Overrides WURFL_Configuration_Config::initialize() (Initialize the Configuration object)

[ Top ]


Documentation generated on Fri, 30 Mar 2012 17:16:57 -0400 by phpDocumentor 1.4.4