FSO:Config

FSO:Config is a simple lockable configuration class that can be loaded into FSO. It is pretty much the only FSO module that does not extend the FSO_Module class.

This module allows you to access the configuration parameters you give it as properties of the object. By default once loaded the properties cannot be edited (prevents accidental modification) however the object can be unlocked and relocked, and can start off in an unlocked state.

Usage

<?php
$config['foo'] = 'a';
$config['bar'] = 'b';
$conf =& FSO::load_module('config', array($config));
// Use array($config, FALSE) as the parameters to start off unlocked

//  Now we can access the properties with
echo $conf->foo;
//  But this will raise an error
$conf->foo = 'newvalue';

//  This is allowed
$conf->unlock();
$conf->foo = 'newvalue';
$conf->lock();
?>
Last modified April 13th, 2008 at 2:50 a.m.