+ * @param $variableName The variable we are looking for
+ * @param $value The value we want to store in the variable
+ * @return void
+ * @throws NoVariableException If the given variable is not found
+ */
+ private function modifyVariable ($variableName, $value) {
+ // Replace all dashes to underscores to match variables with configuration entries
+ $variableName = trim($this->convertDashesToUnderscores($variableName));
+
+ // Get index for variable
+ $index = $this->getVariableIndex($variableName);
+
+ // Is the variable set?
+ if ($index === FALSE) {
+ // Unset variables cannot be modified
+ throw new NoVariableException(array($this, $variableName, $value), self::EXCEPTION_VARIABLE_IS_MISSING);
+ } // END - if
+
+ // Then modify it
+ $this->setVariableValue($this->currGroup, $index, $value);
+ }
+
+ /**
+ * Sets a variable value for given variable group and index
+ *
+ * @param $varGroup Variable group to use
+ * @param $index Index in variable array
+ * @param $value Value to set
+ * @return void
+ */
+ private function setVariableValue ($varGroup, $index, $value) {
+ $this->varStack[$varGroup][$index]['value'] = $value;
+ }
+
+ /**
+ * Sets a variable within given group. This method does detect if the
+ * variable is already set. If so, the variable got modified, otherwise
+ * added.
+ *
+ * @param $varGroup Variable group to use
+ * @param $variableName Variable to set
+ * @param $value Value to set