Class Config

Description

Class Config is a read only data container based on a config file.

Pass the name (and path) of a config file to the constructor to have all defined variables from the given file in a readonly Config container. The container is private and not modifyable, original config values are never in the global scope.

Use merge() and insert() to operate on multiple config files within one single Config object. The merge() and insert() methods support a parameter "context" which can be an array of variable names to be imported to the scope of the merged or inserted config file. All variables defined in the context array must already be present in the config object. Otherwise they will be ignored.

Located in /config.php (line 25)

PHOOL
   |
   --Config
Variable Summary
static Array $values
Method Summary
static mixed|null get ([string $key = false], [ $module = false])
static mixed|null get_module (string $module)
static boolean has (scalar $k, [ $m = false])
static void insert (string $file, string $key, [ $context = array( )])
static void merge (string $file, [array $context = array( )])
static void read (string $file, [array $context = array( )])
Config Config (string $file)
void __clone ()
void __tostring ()
Variables
static Array $values = array( ) (line 31)

Contains all config values

  • access: private

Inherited Variables

Inherited from PHOOL

PHOOL::$debug
PHOOL::$errorlabels
PHOOL::$errorlevels
PHOOL::$errors
PHOOL::$exists
PHOOL::$logdir
PHOOL::$loglevel
PHOOL::$objname
Methods
static get (line 54)

Get a specified value from config.

static mixed|null get ([string $key = false], [ $module = false])
  • string $key: keyname of config value
  • $module
static get_module (line 77)

Get a module config

static mixed|null get_module (string $module)
  • string $module: keyname of config module (inserted)
static has (line 92)

Test if a key is available

static boolean has (scalar $k, [ $m = false])
  • scalar $k: keyname
  • $m
static insert (line 122)

Insert another file into the value container

static void insert (string $file, string $key, [ $context = array( )])
  • string $file: name and path of config file to read
  • string $key: name of the key where to insert the values
  • $context
static merge (line 107)

Merge another file into the value container

static void merge (string $file, [array $context = array( )])
  • string $file: name and path of config file to read
  • array $context: a list of variables to be imported to the reader scope
static read (line 141)

Return values from a config file.

Used by construct and merge

  • access: private
static void read (string $file, [array $context = array( )])
  • string $file: name and path of config file to read
  • array $context: context values to be imported before include
Constructor Config (line 38)

Constructor for Config objects

Config Config (string $file)
  • string $file: name and path of config file to read
__clone (line 180)

Deny cloning of Config Objects

  • access: private
void __clone ()
__tostring (line 175)

Deny string conversion of Config Objects

  • access: private
void __tostring ()

Inherited Methods

Inherited From PHOOL

PHOOL::PHOOL()
PHOOL::debug()
PHOOL::error()
PHOOL::get_errors()
PHOOL::handle_error()
PHOOL::has_error()
PHOOL::log_error()
PHOOL::set_debug()
PHOOL::set_logdir()
PHOOL::set_loglevel()
Class Constants

Inherited Constants

Inherited from PHOOL

PHOOL::ERROR
PHOOL::UNKNOWN
PHOOL::USER
PHOOL::WARNING

Documentation generated on Tue, 12 May 2009 23:09:36 +0200 by phpDocumentor 1.4.1