Class Config

Description

Config Class

Handles loading the site's configuration file (if available). At the moment this class is a very skewed Singleton. The plan is to eventually extend this out to support multiple configuration files, and the ability to load in custom config files on the fly as well. The core of PICKLES uses the class as a Singleton so we're not loading the configuration multiple times per page load.

  • usage:
    1. $config new Config($filename);

Located in /classes/Config.php (line 30)

Object
   |
   --Config
Method Summary
static object self::$instance getInstance ([string $class = 'Config'])
Config __construct ([string $filename = '../config.php'])
boolean load (string $filename)
mixed __get (string $name)
void __set (string $name, mixed $value)
Variables

Inherited Variables

Inherited from Object

Object::$config
Object::$instances
Methods
static method getInstance (line 149)

Get instance of the object

Let's the parent class do all the work

  • return: instance of the Config class
  • access: public
static object self::$instance getInstance ([string $class = 'Config'])
  • string $class: name of the class to instantiate

Redefinition of:
Object::getInstance()
Get Instance
Constructor __construct (line 47)

Constructor

Calls the parent constructor and loads the passed file.

  • access: public
Config __construct ([string $filename = '../config.php'])
  • string $filename: optional Filename of the config

Redefinition of:
Object::__construct()
Constructor
load (line 60)

Loads a configuration file

  • return: success of the load process
  • access: public
boolean load (string $filename)
  • string $filename: filename of the config file
__get (line 176)

Magic Getter Method

Attempts to load the config variable. If it's not set, will override the variable with boolean false.

  • return: value of the variable or boolean false
  • access: public
mixed __get (string $name)
  • string $name: name of the variable requested
__set (line 162)

Magic Setter Method

Prohibits the direct modification of module variables.

  • access: public
void __set (string $name, mixed $value)
  • string $name: name of the variable to be set
  • mixed $value: value of the variable to be set

Inherited Methods

Inherited From Object

Object::__construct()
Object::getInstance()
Object::__destruct()

Documentation generated on Sun, 17 Oct 2010 23:17:22 -0400 by phpDocumentor 1.4.3