Class TParameterModule

Description

TParameterModule class

TParameterModule enables loading application parameters from external storage other than the application configuration. To load parameters from an XML file, configure the module by setting its ParameterFile property. Note, the property only accepts a file path in namespace format with file extension being '.xml'. The file format is as follows, which is similar to the parameter portion in an application configuration,

  1. <parameters>
  2. <parameter id="param1" value="paramValue1" />
  3. <parameter id="param2" Property1="Value1" Property2="Value2" ... />
  4. </parameters>

In addition, any content enclosed within the module tag is also treated as parameters, e.g.,

  1. <module class="System.Util.TParameterModule">
  2. <parameter id="param1" value="paramValue1" />
  3. <parameter id="param2" Property1="Value1" Property2="Value2" ... />
  4. </module>

If a parameter is defined both in the external file and within the module tag, the former takes precedence.

  • since: 3.0
  • version: $Id: TParameterModule.php 2363 2008-01-11 15:17:42Z xue $
  • author: Qiang Xue <qiang.xue@gmail.com>

Located in /Util/TParameterModule.php (line 47)

TComponent
   |
   --TApplicationComponent
      |
      --TModule
         |
         --TParameterModule
Class Constant Summary
 PARAM_FILE_EXT = '.xml'
Method Summary
string getParameterFile ()
void init (TXmlElement $config)
void loadParameters (TXmlElement $xmlNode)
void setParameterFile (string $value)
Methods
getParameterFile (line 124)
  • return: the parameter file path
  • access: public
string getParameterFile ()
init (line 57)

Initializes the module by loading parameters.

  • access: public
void init (TXmlElement $config)
  • TXmlElement $config: content enclosed within the module tag

Redefinition of:
TModule::init()
Initializes the module.
loadParameters (line 87)

Loads parameters into application.

  • access: protected
  • throws: TConfigurationException if the parameter file format is invalid
void loadParameters (TXmlElement $xmlNode)
  • TXmlElement $xmlNode: XML representation of the parameters
setParameterFile (line 135)
  • access: public
  • throws: TInvalidOperationException if the module is initialized
  • throws: TConfigurationException if the file is invalid
void setParameterFile (string $value)
  • string $value: the parameter file path. It must be in namespace format and the file extension is '.xml'.

Inherited Methods

Inherited From TModule

TModule::getID()
TModule::init()
TModule::setID()

Inherited From TApplicationComponent

TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()
Class Constants
PARAM_FILE_EXT = '.xml' (line 49)

Documentation generated on Mon, 21 Apr 2008 11:35:51 -0400 by phpDocumentor 1.3.0RC4