Welcome Guest, Not a member yet? Register   Sign In
config bug?
#1

[eluser]Unknown[/eluser]
Code:
//默认的配置 (log_threshold 0)
                echo $this->config->item('log_threshold').'<br>';
                
                //动态修改配置为 (log_threshold 2)
                $this->config->_assign_to_config(array('log_threshold'=>2));
                echo $this->config->item('log_threshold').'<br>';
                
                //bug来了 被默认配置覆盖了 (log_threshold 0)
                $this->config->load('config');
                echo $this->config->item('log_threshold').'<br>';
                
                //再次设置为 2, 两个2了 (log_threshold 2)
                $this->config->_assign_to_config(array('log_threshold'=>2));            
                echo $this->config->item('log_threshold').'<br>';

                //再次载入config,这次则没有覆盖2  (log_threshold 2)
                $this->config->load('config');
                echo $this->config->item('log_threshold').'<br>';
                exit();




Theme © iAndrew 2016 - Forum software by © MyBB