Source for file basicconfigreader.php
Documentation is available at basicconfigreader.php
* Generic configuration management object
* Parses the {@link bumblebee.ini } file
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: basicconfigreader.php,v 1.13 2007/02/16 23:10:19 themill Exp $
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
// Conditionally include the singleton functions if PHP5 is being used
require_once 'inc/bb/basicconfigreadersingleton_php5.php';
// pull in the singleton file and translate the PHP5 to PHP4 (that is still known to work)
array('@static function@', '@<\?php@', '@\?>@'),
array('function', '', ''),
function LoadFile($filename, $fatalErrors=
true) {
function MergeFile($filename, $section=
null, $fatalErrors=
true) {
trigger_error("System misconfiguration: I could fine the config file '$filename' but
not in the designated location.", $fatalErrors ?
E_USER_ERROR :
E_USER_NOTICE);
trigger_error("System misconfiguration: I could not find the config file '$filename'. Please give me a config file so I can do something useful.", $fatalErrors ?
E_USER_ERROR :
E_USER_NOTICE);
// if the config file doesn't exist, then we're pretty much stuffed
trigger_error("System misconfiguration: I could not find the config file '$filename'. Please give me a config file so I can do something useful.", $fatalErrors ?
E_USER_ERROR :
E_USER_NOTICE);
function value($section, $parameter, $default=
null) {
return issetSet($this->data[$section], $parameter, $default);
return $this->data[$section];
/** merge an array into the config data. If a section is provided the array is added as a new sub key */
} else if(!isset
($this->data[$section])) {
$tmp =
$this->data[$section];
$this->data[$section] =
$tmp;
trigger_error("Tried to merge a non array into the config values");
$parameterColumn =
'parameter', $valueColumn =
'value') {
$q =
"SELECT $sectionColumn as section, $parameterColumn as parameter, $valueColumn as value from $TABLEPREFIX$table";
if (! isset
($this->data[$g['section']]) ||
! is_array($this->data[$g['section']])) {
$this->data[$g['section']] =
array();
$this->data[$g['section']][$g['parameter']] =
$g['value'];
//printf('[%s]::$s = %s', $g['section'], $g['parameter'], $g['value']);
Documentation generated on Tue, 06 Mar 2007 10:00:40 +0000 by phpDocumentor 1.3.0