Class dvt_cfg

Description

DVT configuration and query builder class

Located in /classes/class.dvt_cfg.php (line 18)


	
			
Variable Summary
array $aLogMsg
object $dvtDB
object $oLogger
array $tables
Method Summary
boolean __destruct ()
string|FALSE convertMacros (string $sXML, array $aReplace)
array|FALSE getAllMacros (array $aValidationMacros, [string $macroTag = "macro"])
array|FALSE getBenchmarks ([string $benchMarkID = ""])
array|FALSE getHostInfo (array $rulesets)
array|FALSE getRules (integer $benchMarkID, [string $aMacros = ""])
array|FALSE getRulesets (integer $benchMarkID)
array|FALSE getValidationMacros (array $aAllRulesetData)
boolean logMsg (string $msg, [integer $type = 2])
object|FALSE macroStr2XMLObj (string $str)
boolean writeLog ()
Variables
array $aLogMsg = array() (line 27)

Array of log messages

object $dvtDB (line 32)

DVT database instance

object $oLogger (line 22)

Logger object passed externally

array $tables = array (
"rules" => array (
"name"=>"dvt_rules",
"structure"=> array(
"ID"=>"ID",
"benchmarkID"=>"benchmarkID",
"macro"=>"macro",
"ruledesc"=>"ruledesc",
"striproot"=>"striproot",
"node"=>"node",
"sortorder"=>"sortorder"
)),"rulesets"=>array("name"=>"dvt_rulesets","structure"=>array("ID"=>"ID","hostID"=>"hostID","benchmarkID"=>"benchmarkID","rulesetname"=>"rulesetname","rulesetdesc"=>"rulesetdesc","validationmacro"=>"validationmacro")),"benchmarks"=>array("name"=>"dvt_benchmarks","structure"=>array("ID"=>"ID","name"=>"name","childName"=>"childName","childIDnode"=>"childIDnode","level"=>"level","schema"=>"schema")),"dvt_dbs"=>array("name"=>"dvt_dbs","structure"=>array("ID"=>"ID","host_name"=>"host_name","host_type"=>"host_type","host_port"=>"host_port","host_username"=>"host_username","host_password"=>"host_password","host_database"=>"host_database","timestamp"=>"timestamp")))
(line 37)

Structure of tables used

Methods
Destructor __destruct (line 394)

Destructor

boolean __destruct ()
convertMacros (line 298)

Converts xml maco tags into replacement text $sXML is the maco string with XML-based tags (nbo root tag,, this is added later) $aReplace is an array where the key=content of tag, which is replaced with value of array Returns replaced string.

string|FALSE convertMacros (string $sXML, array $aReplace)
  • string $sXML: is the maco string
  • array $aReplace: is an array where the key=content of tag
getAllMacros (line 212)

Gets all required macros from an array of validation macro strings

Returns array of macro keys or FALSE if none found

array|FALSE getAllMacros (array $aValidationMacros, [string $macroTag = "macro"])
  • array $aValidationMacros
  • string $macroTag: default =$aMacros"
getBenchmarks (line 407)

Returns benchmarks array.

The array contains ID and NAME for each benchmark

array|FALSE getBenchmarks ([string $benchMarkID = ""])
  • string $benchMarkID
getHostInfo (line 441)

Gets host info

Gets all host data corresponding to the ruleset

array|FALSE getHostInfo (array $rulesets)
  • array $rulesets: array of rulesets.
getRules (line 95)

Gets all rules corresponding to a particular benchmark $benchMarkID INTEGER becnhmark ID from database, $aMacroID ARRAY of macro strings returned by getValidationMacros().

array|FALSE getRules (integer $benchMarkID, [string $aMacros = ""])
  • integer $benchMarkID
  • string $aMacros
getRulesets (line 156)

Retrieve rulesets

Returns array of ruleset data

array|FALSE getRulesets (integer $benchMarkID)
  • integer $benchMarkID
getValidationMacros (line 193)

Gets macros only from multidimensional array

Returns array of ruleset data. or FALSE if none found

array|FALSE getValidationMacros (array $aAllRulesetData)
  • array $aAllRulesetData: Contains the rulesets for which you wish to obtain macros
logMsg (line 356)

Writes log msg to class var aLogMsg;

boolean logMsg (string $msg, [integer $type = 2])
  • string $msg: The message you want to add to the log
  • integer $type: indicates which log you wish to append to 1= userlog, 2= adminlog
macroStr2XMLObj (line 273)

Converts the macro string to a simple XML object (use for simple XML strings only - -does not work with default namesapce)

Returns object

object|FALSE macroStr2XMLObj (string $str)
  • string $str: The macro string to be converted to SimpleXML
writeLog (line 368)

Writes all log msgs to class var oLogger if exists;

boolean writeLog ()

Documentation generated on Tue, 21 Sep 2004 13:46:01 +0100 by phpDocumentor 1.3.0RC3