EllisLab/CodeIgniter — Issue #708: Re-set config_item() cache
Author: SlimDeluxe
Created: 2011-11-24 13:19:05+00:00
State: open

Hi,
when you change a config item during parse time, the config_item( ) would need to drop it's static "cache".
If you use this procedure:
in config.php:
```$config['foo'] = 'bar';```
in some controller:
```echo config_item('foo'); # produces: bar
$CI->config->set_item('foo', 'baz');
echo config_item('foo'); # still produces: bar```

The workaround is to use the direct Config method: $CI->config->item('foo).

This should be fixed or at least noted in the documentation, that the common function config_item() uses a static var for caching purposes and can not be changed during parsetime (if the variable was already read and therefore cached one before).