/**
  * Method to get a system configuration parameter.
  *
  * @var string $pvalue The value code of the config item
  * @var string $pname The name of the parameter being set, use UPPER_CASE
  * @return  string $value The value of the config parameter
  */
 public function getItem($pname, $pvalue)
 {
     die($pname . $pvalue);
     try {
         //Read conf
         $read = NULL;
         if ($this->_root == NULL) {
             $read = $this->readConfig();
         }
         if ($read == FALSE) {
             return $read;
         }
         //Lets get the parent node section first
         $Settings =& $this->_root->getItem("section", "Settings");
         //Now onto the directive node
         //check to see if one of them isset to search by
         if (isset($pname)) {
             $this->SettingsDirective =& $Settings->getItem("directive", "{$pname}");
             $pname = $this->SettingsDirective->getContent();
             return $pname;
         }
         if (isset($pvalue)) {
             $this->SettingsValue =& $Settings->getItem("directive", "{$pvalue}");
             $pvalue = $this->SettingsValue->getContent();
             return $pvalue;
         }
     } catch (Exception $e) {
         customException::cleanUp();
         exit;
     }
 }
示例#2
0
 /**
  * Method to get a system configuration parameter.
  *
  * @var    string $pvalue The value code of the config item
  * @var    string $pname The name of the parameter being set, use UPPER_CASE
  * @return string $value The value of the config parameter
  */
 public function getItem($pname, $pvalue, $Directive)
 {
     try {
         //Read conf
         if ($this->_root == false) {
             $read = $this->readConfig();
         }
         if ($read == FALSE) {
             return $read;
         }
         //Lets get the parent node section first
         $Settings =& $this->_root->getItem("section", "{$Directive}");
         //Now onto the directive node
         //check to see if one of them isset to search by
         if (isset($pname)) {
             $this->SettingsDirective =& $Settings->getItem("directive", "{$pname}");
             $pname = $this->SettingsDirective->getContent();
             return $pname;
         }
         if (isset($pvalue)) {
             $this->SettingsValue =& $Settings->getItem("directive", "{$pvalue}");
             $pvalue = $this->SettingsValue->getContent();
             return $pvalue;
         }
     } catch (Exception $e) {
         $this->errorCallback($this->Text('word_caught_exception') . $e->getMessage());
         exit;
     }
 }