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

Class: Config

Source Location: /Config-1.10.12/Config.php

Class Overview


Config


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 44]
Config

This class allows for parsing and editing of configuration datasources. Do not use this class only to read datasources because of the overhead it creates to keep track of the configuration structure.



[ Top ]


Class Variables

$configType =  ''

[line 58]

Type of datasource for config Ex: IniCommented, Apache...

Type:   string


[ Top ]

$container =

[line 70]

Container object

Type:   object


[ Top ]

$datasrc =

[line 51]

Datasource Can be a file url, a dsn, an object...

Type:   mixed


[ Top ]

$parserOptions = array()

[line 64]

Options for parser

Type:   string


[ Top ]



Method Detail

Config (Constructor)   [line 78]

Config Config( )

Constructor Creates a root container
  • Access: public

[ Top ]

getRoot   [line 145]

object reference &getRoot( )

Returns the root container for this config object
  • Return: to config's root container object
  • Access: public

[ Top ]

isConfigTypeRegistered   [line 90]

bool isConfigTypeRegistered( string $configType)

Returns true if container is registered
  • Access: public

Parameters:

string   $configType     Type of config

[ Top ]

parseConfig   [line 187]

mixed &parseConfig( mixed $datasrc, string $configType, [array $options = array()])

Parses the datasource contents

This method will parse the datasource given and fill the root Config_Container object with other Config_Container objects.

  • Return: PEAR_Error on error or Config_Container object
  • Access: public

Parameters:

mixed   $datasrc     Datasource to parse
string   $configType     Type of configuration
array   $options     Options for the parser

[ Top ]

registerConfigType   [line 111]

true|PEAR_Error registerConfigType( string $configType, [array|false $configInfo = false])

Register a new container

Parameters:

string   $configType     Type of config
array|false   $configInfo     

Array of format: array('path/to/Name.php', 'Config_Container_Class_Name').

If left false, defaults to: array('Config/Container/$configType.php', 'Config_Container_$configType')


[ Top ]

setRoot   [line 160]

mixed setRoot( &$rootContainer, object $rootContainer)

Sets the content of the root Config_container object.

This method will replace the current child of the root Config_Container object by the given object.

  • Return: true on success or PEAR_Error
  • Access: public

Parameters:

object   $rootContainer     container to be used as the first child to root
   &$rootContainer     

[ Top ]

writeConfig   [line 217]

mixed writeConfig( [mixed $datasrc = null], [string $configType = null], [array $options = array()])

Writes the container contents to the datasource.
  • Return: PEAR_Error on error or true if ok
  • Access: public

Parameters:

mixed   $datasrc     Datasource to write to
string   $configType     Type of configuration
array   $options     Options for config container

[ Top ]


Documentation generated on Fri, 24 Dec 2010 08:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.