public function loadConfigVars($sections = null, $scope = 'local')
    {
        if ($this->data instanceof Smarty_Internal_Template) {
            $this->data->properties['file_dependency'][sha1($this->source->filepath)] = array($this->source->filepath, $this->source->timestamp, 'file');
        }
        if ($this->mustCompile()) {
            $this->compileConfigSource();
        }
        // pointer to scope
        if ($scope == 'local') {
            $scope_ptr = $this->data;
        } elseif ($scope == 'parent') {
            if (isset($this->data->parent)) {
                $scope_ptr = $this->data->parent;
            } else {
                $scope_ptr = $this->data;
            }
        } elseif ($scope == 'root' || $scope == 'global') {
            $scope_ptr = $this->data;
            while (isset($scope_ptr->parent)) {
                $scope_ptr = $scope_ptr->parent;
            }
        }
        $_config_vars = array();
        include($this->getCompiledFilepath());
        // copy global config vars
        foreach ($_config_vars['vars'] as $variable => $value) {
            if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
                $scope_ptr->config_vars[$variable] = $value;
            } else {
                $scope_ptr->config_vars[$variable] = array_merge((array) $scope_ptr->config_vars[$variable], (array) $value);
            }
        }
        // scan sections
        if (!empty($sections)) {
            foreach ((array) $sections as $this_section) {
                if (isset($_config_vars['sections'][$this_section])) {
                    foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) {
                        if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
                            $scope_ptr->config_vars[$variable] = $value;
                        } else {
                            $scope_ptr->config_vars[$variable] = array_merge((array) $scope_ptr->config_vars[$variable], (array) $value);
                        }
                    }
                }
            }
        }
    }
public function loadConfigVars($sections = null, $scope = 'local')
    {
        if ($this->data instanceof Smarty_Internal_Template) {
            $this->data->properties['file_dependency'][sha1($this->source->filepath)] = array($this->source->filepath, $this->source->timestamp, 'file');
        }
        if ($this->mustCompile()) {
            $this->compileConfigSource();
        }
        // pointer to scope
        if ($scope == 'local') {
            $scope_ptr = $this->data;
        } elseif ($scope == 'parent') {
            if (isset($this->data->parent)) {
                $scope_ptr = $this->data->parent;
            } else {
                $scope_ptr = $this->data;
            }
        } elseif ($scope == 'root' || $scope == 'global') {
            $scope_ptr = $this->data;
            while (isset($scope_ptr->parent)) {
                $scope_ptr = $scope_ptr->parent;
            }
        }
        $_config_vars = array();
        include($this->getCompiledFilepath());
        // copy global config vars
        foreach ($_config_vars['vars'] as $variable => $value) {
            if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
                $scope_ptr->config_vars[$variable] = $value;
            } else {
                $scope_ptr->config_vars[$variable] = array_merge((array) $scope_ptr->config_vars[$variable], (array) $value);
            }
        }
        // scan sections
        if (!empty($sections)) {
            foreach ((array) $sections as $this_section) {
                if (isset($_config_vars['sections'][$this_section])) {
                    foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) {
                        if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
                            $scope_ptr->config_vars[$variable] = $value;
                        } else {
                            $scope_ptr->config_vars[$variable] = array_merge((array) $scope_ptr->config_vars[$variable], (array) $value);
                        }
                    }
                }
            }
        }
    }
public function loadConfigVars ( $ sections = null , $ scope = 'local' ) { if ( $ this -> data instanceof Smarty_Internal_Template ) { $ this -> data -> properties [ 'file_dependency' ] [ sha1 ( $ this -> source -> filepath ) ] = array ( $ this -> source -> filepath , $ this -> source -> timestamp , 'file' ) ; } if ( $ this -> mustCompile ( ) ) { $ this -> compileConfigSource ( ) ; } // pointer to scope if ( $ scope == 'local' ) { $ scope_ptr = $ this -> data ; } elseif ( $ scope == 'parent' ) { if ( isset ( $ this -> data -> parent ) ) { $ scope_ptr = $ this -> data -> parent ; } else { $ scope_ptr = $ this -> data ; } } elseif ( $ scope == 'root' || $ scope == 'global' ) { $ scope_ptr = $ this -> data ; while ( isset ( $ scope_ptr -> parent ) ) { $ scope_ptr = $ scope_ptr -> parent ; } } $ _config_vars = array ( ) ; include ( $ this -> getCompiledFilepath ( ) ) ; // copy global config vars foreach ( $ _config_vars [ 'vars' ] as $ variable => $ value ) { if ( $ this -> smarty -> config_overwrite || ! isset ( $ scope_ptr -> config_vars [ $ variable ] ) ) { $ scope_ptr -> config_vars [ $ variable ] = $ value ; } else { $ scope_ptr -> config_vars [ $ variable ] = array_merge ( ( array ) $ scope_ptr -> config_vars [ $ variable ] , ( array ) $ value ) ; } } // scan sections if ( ! empty ( $ sections ) ) { foreach ( ( array ) $ sections as $ this_section ) { if ( isset ( $ _config_vars [ 'sections' ] [ $ this_section ] ) ) { foreach ( $ _config_vars [ 'sections' ] [ $ this_section ] [ 'vars' ] as $ variable => $ value ) { if ( $ this -> smarty -> config_overwrite || ! isset ( $ scope_ptr -> config_vars [ $ variable ] ) ) { $ scope_ptr -> config_vars [ $ variable ] = $ value ; } else { $ scope_ptr -> config_vars [ $ variable ] = array_merge ( ( array ) $ scope_ptr -> config_vars [ $ variable ] , ( array ) $ value ) ; } } } } } }
load config variables

@param mixed  $sections array of section names, single section or null
@param object $scope    global,parent or local
load config variables