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

Class: Config_Container_db

Source Location: /Config-0.3.1/Config/Container/db.php

Class Overview

Config_Container
   |
   --Config_Container_db

Config-API-Implemtentation for DB-Ini-Entries


Author(s):

Version:

  • $Id: db.php,v 1.2 2001/12/11 19:45:37 sebastian Exp $

Variables

Methods


Inherited Variables

Inherited Methods

Class: Config_Container

Config_Container::getBlocks()
returns the name of all childblocks
Config_Container::getValue()
returns the value of the key in the given block
Config_Container::getValues()
returns all key-value-pairs of the given block
Config_Container::parseInput()
parses the input of the given data source
Config_Container::setFeatures()
Imports the requested datafields as object variables if allowed
Config_Container::setValue()
sets the value of the key in the given block
Config_Container::writeInput()
writes the data to the given data source or if not given to the datasource of parseInput

Class Details

[line 45]
Config-API-Implemtentation for DB-Ini-Entries

This class implements the Config-API based on ConfigDefault

The Table structure should be as follows:

CREATE TABLE config ( datasrc varchar(50) NOT NULL, block varchar(50) NOT NULL, name varchar(50) NOT NULL, value varchar(50) );

You can name the Table other than config, but you have to supply then this name in the $feature->array

  • Version: $Id: db.php,v 1.2 2001/12/11 19:45:37 sebastian Exp $
  • Access: public
  • Author: Christian Stocker <mailto:chregu@phant.ch>


[ Top ]


Class Variables

$feature = array("Table" => "config")

[line 53]

contains the features given by parseInput

Type:   array


[ Top ]



Method Detail

Config_Container_db (Constructor)   [line 63]

Config_Container_db Config_Container_db( $dsn $dsn)

Constructor of the class

Connects to the DB via the PEAR::DB-class


Parameters:

$dsn   $dsn     string with PEAR::DB "data source name" or object DB object

[ Top ]

parseInput   [line 110]

mixed parseInput( [string $datasrc = ""], [array $feature = array( )])

parses the input of the given data source

The Data Source can be a string with field-name of the datasrc field in the db

  • Return: returns a DB_ERROR, if error occurs
  • Access: public

Overrides Config_Container::parseInput() (parses the input of the given data source)

Parameters:

string   $datasrc     Name of the datasource to parse
array   $feature     Contains a hash of features

[ Top ]

writeInput   [line 147]

mixed writeInput( [string $datasrc = ""], [boolean $preserve = True])

writes the data to the given data source or if not given to the datasource of parseInput If $datasrc was a array, the last file will used.

See parseInput for $datasrc. If the second argument $preserve is true, the implementation should try to preserve the original format and data of the source except changed or added values. This mean to preserve for example comments in files or so.


Overrides Config_Container::writeInput() (writes the data to the given data source or if not given to the datasource of parseInput)

Parameters:

string   $datasrc     Name of the datasource to parse
boolean   $preserve     preserving behavior

[ Top ]


Documentation generated on Fri, 30 Apr 2004 21:21:35 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.