/**
  * 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 setItem($pname, $pvalue)
 {
     try {
         // Read conf
         $read = NULL;
         if ($this->_root == NULL) {
             $read = $this->readConfig();
         }
         //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
         $this->SettingsDirective = $Settings->getItem("directive", "{$pname}");
         if ($this->SettingsDirective) {
             $this->SettingsDirective->setContent($pvalue);
             $result = $this->objConf->writeConfig();
         } else {
             $this->insert = array($pname => $pvalue);
             $result = $this->writeConfig($this->insert);
         }
         return $result;
     } 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 setItem($pname, $pvalue, $Directive)
 {
     try {
         //Read conf
         if ($this->_root == FALSE) {
             $read = $this->readConfig();
         }
         //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
         $this->SettingsDirective =& $Settings->getItem("directive", "{$pname}");
         $this->SettingsDirective->setContent($pvalue);
         $result = $this->objConf->writeConfig();
         return $result;
     } catch (Exception $e) {
         $this->errorCallback($this->Text('word_caught_exception') . $e->getMessage());
         exit;
     }
 }