Class Bluewater_Config

Overview

Configuration Class to process Bluewater MVC Core config file and an application level config file.

Configuration files are standard INI format file.

link: http://web.bluewatermvc.org
todo: look into converting this into a DBA access type class via SPL
todo: Create PHPUnit test, tutorials and example files for this class
howto: http://guides.bluewatermvc.org/doku.php/dev/classes/general/config#configuration_class
PHPUnit: Not Defined
usedby: Bluewater_Config::init()
example: example not found

Located in /config.php (line 61)


	
    		        
Properties Summary
static object $helper
static array $_conf
static object $_instance
static bool $_process_sections
Method Summary
static array config ([string $_section = false], [string $_field = false])
static void helper (void 0)
static object init ([bool $_process_sections = true])
static void setConfig ([string $_section = false], [string $_field = false], [string $_value = false])
static array _load ([string $file = false])
static void _parse_constants (void 0)
static void _parse_fields (void 0)
static string _parse_value (string $value, [boolean|string $section = false])
static booledan|null _save_boolean (string $_value)
void __construct ([bool $process_sections = true])
void locale ([string $_domain = 'core'])
void __clone (void 0)
Properties
static object $helper = null (line 112)

Helper Object Container

since: 1.0
access: private
usedby: Bluewater_Config::__construct()
static array $_conf = null (line 89)

Config data in named array

since: 1.0
access: private
usedby: Bluewater_Config::_parse_fields()
usedby: Bluewater_Config::_parse_constants()
usedby: Bluewater_Config::__construct()
usedby: Bluewater_Config::config()
usedby: Bluewater_Config::setConfig()
static object $_instance = false (line 78)

Class instance

since: 1.0
access: private
usedby: Bluewater_Config::init()
static bool $_process_sections = true (line 101)

Flag to determine whether to process and 'label' sections within CONFIG file

since: 1.0
access: private
usedby: Bluewater_Config::_load()
usedby: Bluewater_Config::__construct()
usedby: Bluewater_Config::setConfig()
Methods
static config (line 276)

Retrieve section of config data or specfic config element

return: Config info array
PHPUnit: Not Defined
since: 1.0
final:
access: public
usedby: Bluewater_Config::locale()
uses: Bluewater_Config::$_conf
static array config ([string $_section = false], [string $_field = false])
  • string $_section: Which section to pull
  • string $_field: specfic config element to pull info
static helper (line 250)

Return Helper Support Class

PHPUnit: Not Defined
since: 1.0
final:
access: public
usedby: Bluewater_View::__construct()
usedby: Bluewater_Controller_Abstract::__construct()
uses: Bluewater_Config::$_helper
static void helper (void 0)
  • void 0
static init (line 224)

Makes sure that this call is a single instance and returns that instance

return: Class instance
since: 1.0
PHPUnit: Not Defined
final:
access: public
uses: Bluewater_Config::$_instance
uses: Bluewater_Config
static object init ([bool $_process_sections = true])
  • bool $_process_sections: Whether to seperate section into seperate pieces
static setConfig (line 335)

Add or update specific config element

since: 1.0
PHPUnit: Not Defined
final:
access: public
usedby: Bluewater_Config::locale()
uses: Bluewater_Config::$_process_sections
uses: Bluewater_Config::$_conf
static void setConfig ([string $_section = false], [string $_field = false], [string $_value = false])
  • string $_section: Which section to place config element into
  • string $_field: Specfic config element to place value into
  • string $_value: Value to place into config element
static _load (line 370)

Load config data into Class propery array

This method is based upon the example given at http://us.php.net/manual/en/function.parse-ini-file.php#82900 by asohn@aircanopy.net

return: Results of INI file parsing
PHPUnit: Not Defined
since: 1.0
final:
access: private
usedby: Bluewater_Config::__construct()
uses: Bluewater_Config::$_process_sections
static array _load ([string $file = false])
  • string $file: INI file to load
static _parse_constants (line 483)

Converts items defined as constants into PHP constants and then removes the contant list from the class.

staticvar: array $_conf['constants']: array of defined constants
final:
PHPUnit: Not Defined
access: private
usedby: Bluewater_Config::__construct()
uses: Bluewater_Config::_parse_value()
uses: Bluewater_Config::$_conf
static void _parse_constants (void 0)
  • void 0
static _parse_fields (line 514)

Parses name/value pairs into variable names and their values.

staticvar: array $_conf['constants']: array of defined constants
final:
PHPUnit: Not Defined
access: private
usedby: Bluewater_Config::__construct()
uses: Bluewater_Config::_parse_value()
uses: Bluewater_Config::$_conf
static void _parse_fields (void 0)
  • void 0
static _parse_value (line 541)

Recursive method to parse individual value of a variable and convert it into its PHP datatype equivalent

return: Converted value
PHPUnit: Not Defined
final:
access: private
usedby: Bluewater_Config::_parse_fields()
usedby: Bluewater_Config::_parse_constants()
uses: Bluewater_Config::_save_boolean()
static string _parse_value (string $value, [boolean|string $section = false])
  • string $value: Value of name/value pair to convert
  • boolean|string $section: FALSE or 'constants', used to parse value as a constant or not
static _save_boolean (line 629)

Converts individual value of a variable into a BOOLEAN or a PHP NULL

return: Converted value
final:
PHPUnit: Not Defined
access: private
usedby: Bluewater_Config::_parse_value()
static booledan|null _save_boolean (string $_value)
  • string $_value: Value of name/value pair to convert
Constructor __construct (line 148)

Load actual config files for processing.

If config files are not defined, no error is thrown.

final:
since: 1.0
PHPUnit: Not Defined
access: private
uses: Bluewater_Helper
uses: Helper_Array_Insert
uses: Bluewater_Config::_parse_fields()
uses: Bluewater_Config::_parse_constants()
uses: Bluewater_Config::$helper
uses: BLUEWATER
uses: Bluewater_Config::$_conf
uses: Bluewater_Config::$_process_sections
uses: Bluewater_Config::_load()
uses: Bluewater_Config::local()
uses: APP
void __construct ([bool $process_sections = true])
  • bool $process_sections: Whether to seperate Sections into pieces
locale (line 666)

Loads the LOCALE config setting, defines 'locale' and activates get_text and its settings

final:
PHPUnit: Not Defined
access: public
uses: get_text
uses: Bluewater_Config::config()
uses: Bluewater_Config::setConfig()
uses: APP
void locale ([string $_domain = 'core'])
  • string $_domain: Which 'domain' of messages to use for translation
__clone (line 203)

A private 'clone' method it ensure that this singleton class can not be duplicated.

since: 1.0
PHPUnit: Not Defined
final:
access: private
void __clone (void 0)
  • void 0

Documentation generated on Tue, 18 Aug 2009 02:30:16 -0500 by phpDocumentor 1.4.2