*/
private function getVariableIndex ($var, $stack = NULL) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// First everything is not found
$found = false;
*/
protected function readVariable ($var, $stack = NULL) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// First everything is not found
$content = NULL;
*/
public function addGroupVariable ($var, $value) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Debug message
//* DEBUG: */ $this->debugOutput(__METHOD__.': group=' . $this->currGroup . ', var=' . $var . ', value=' . $value);
*/
private function modifyVariable ($var, $value) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Get index for variable
$index = $this->getVariableIndex($var);
*/
protected function setVariable ($varGroup, $var, $value) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Get index for variable
$index = $this->getVariableIndex($var);
*/
private function generateVariableArray ($var, $value) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Generate the temporary array
$varData = array(
*/
public final function assignVariable ($var, $value) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Empty variable found?
if (empty($var)) {
*/
private function assignTemplateVariable ($varName, $var) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Debug message
//* DEBUG: */ $this->debugOutput(__METHOD__ . ': varName=' . $varName . ',var=' . $var);
preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
// Debug message
- //* DEBUG: */ $this->debugOutput(__METHOD__ . ':rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
+ //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
// Did we find some variables?
if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
// Search for all variables
foreach ($varMatches[1] as $key => $var) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Debug message
$this->debugOutput(__METHOD__ . ':key=' . $key . ',var=' . $var);
if (($foundIndex !== false) && (isset($templateMatches[3][$foundIndex]))) {
// Split it up with another reg. exp. into variable=value pairs
preg_match_all($this->regExpVarValue, $templateMatches[3][$foundIndex], $varMatches);
- ///* DEBUG: */ $this->debugOutput(__METHOD__ . ':varMatches=' . print_r($varMatches,true));
+ //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':varMatches=' . print_r($varMatches, true));
// Assign all variables
$this->assignAllVariables($varMatches);
*/
public function assignConfigVariable ($var) {
// Replace all dashes to underscores to match variables with configuration entries
- $var = trim(str_replace('-', '_', $var));
+ $var = trim($this->convertDashesToUnderscores($var));
// Sweet and simple...
//* DEBUG: */ $this->debugOutput(__METHOD__ . ': var=' . $var . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($var));
preg_match_all($this->regExpCodeTags, $rawData, $templateMatches);
// Debug message
- //* DEBUG: */ $this->debugOutput(__METHOD__ . ':templateMatches=' . print_r($templateMatches , true));
+ //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':templateMatches=' . print_r($templateMatches , true));
// Analyze the matches array
if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) {
*/
public function compileRawCode ($rawCode, $setMatchAsCode=false) {
// Find the variables
- //* DEBUG: */ $this->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
+ //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
// Compile all variables
- //* DEBUG: */ $this->debugOutput(__METHOD__ . ':<pre>' . print_r($varMatches, true) . '</pre>');
+ //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':<pre>' . print_r($varMatches, true) . '</pre>');
foreach ($varMatches[0] as $match) {
// Add variable tags around it
$varCode = '{?' . $match . '?}';
// Is the variable found in code? (safes some calls)
if (strpos($rawCode, $varCode) !== false) {
// Debug message
- //* DEBUG: */ $this->debugOutput(__METHOD__ . ': match=' . $match . ',value[' . gettype($value) . ']=' . $value);
+ //* DEBUG: */ $this->debugOutput(__METHOD__ . ': match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode);
// Use $match as new value or $value from read variable?
if ($setMatchAsCode === true) {