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

Class: Config

Source Location: /Config-1.10.8RC1/Config.php

Class Overview


Config


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 43]
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 57]

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

Type:   string


[ Top ]

$container =

[line 69]

Container object

Type:   object


[ Top ]

$datasrc =

[line 50]

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

Type:   mixed


[ Top ]

$parserOptions = array()

[line 63]

Options for parser

Type:   string


[ Top ]



Method Detail

Config (Constructor)   [line 77]

Config Config( )

Constructor Creates a root container
  • Access: public

[ Top ]

getRoot   [line 144]

object reference &getRoot( )

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

[ Top ]

isConfigTypeRegistered   [line 89]

bool isConfigTypeRegistered( string $configType)

Returns true if container is registered
  • Access: public

Parameters:

string   $configType     Type of config

[ Top ]

parseConfig   [line 186]

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 110]

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 159]

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 216]

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 Thu, 19 Oct 2006 23:30:08 -0400 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.