Class CoughConfig

Description

Base config class for other config classes to extend.

  • author: Anthony Bush
  • abstract:

Located in /cough_generator/CoughConfig.class.php (line 9)


	
			
Direct descendents
Class Description
CoughGeneratorConfig Config class for CoughGenerator.
DatabaseSchemaGeneratorConfig Config class for DatabaseSchemaGenerator.
XmlSchemaGeneratorConfig XML Schema Generator takes an XML schema file and generates the Schema objects that CoughGenerator takes.
Class Constant Summary
Variable Summary
mixed $config
Method Summary
CoughConfig __construct ( $config)
mixed getArrayValueFromMultiKey ( &$value,  $keys)
mixed getConfigValue ($configKey $configKey, [ $dbName = null], [ $tableName = null], [ $scope = self::SCOPE_GLOBAL])
void initConfig ()
void mergeIntoConfig ( $config)
Variables
mixed $config = array() (line 14)
  • access: protected
Methods
Constructor __construct (line 16)
  • access: public
CoughConfig __construct ( $config)
  • $config
getArrayValueFromMultiKey (line 107)

Takes a source array and an array of keys and attempts to traverse the source array using the keys. It's a way to dynamically retrieve a value deep in an array using keys that are not none until runtime.

For example:

$source = array('one' => array('two' => 'three')); $keys = array('one', 'two'); echo getArrayValueFromMultiKey($source, $keys);

outputs "three"

  • return: - null if any of the keys are found, otherwise the value deep in the source array.
  • author: Anthony Bush
  • access: protected
mixed getArrayValueFromMultiKey ( &$value,  $keys)
  • &$value
  • $keys
getConfigValue (line 65)

Internal method to get a configuration setting. If a database name is given,

it will check if the requested config has been overridden for that database and return that config instead of the globally set one. If a database name AND a table name is given, Then it will check if the table config has been overridden first, then the database config and then the globally set config. The first config it finds will be the one returned.

  • return: - config value or null if not found.
  • author: Anthony Bush
  • access: protected
mixed getConfigValue ($configKey $configKey, [ $dbName = null], [ $tableName = null], [ $scope = self::SCOPE_GLOBAL])
  • $configKey $configKey: - separate config sections by a slash '/'. For example, if you want the "match_table_name_prefixes" config in the "table_settings" section, $configKey should be "table_settings/match_table_name_prefixes"
  • $dbName
  • $tableName
  • $scope
initConfig (line 28)

Initializes config to the defaults

  • author: Anthony Bush
  • abstract:
  • since: 2007-06-15
  • access: protected
void initConfig ()

Redefined in descendants as:
mergeIntoConfig (line 37)

Merges the given config into the current config, overriding any of the current config values to new ones.

  • author: Anthony Bush
  • access: protected
void mergeIntoConfig ( $config)
  • $config
Class Constants
SCOPE_DATABASE = 2 (line 11)
SCOPE_GLOBAL = 1 (line 10)
SCOPE_TABLE = 3 (line 12)

Documentation generated on Wed, 12 Nov 2008 21:56:15 -0600 by phpDocumentor 1.4.0