Storing runtime configuration

Hi All,
I hope everybody red “book” :wink:
http://book.cakephp.org/2.0/en/development/configuration.html

I’m trying to store data, here is simple test:
$test = [‘127.0.0.10’, ‘127.0.0.11’];
_ debug(Configure::store(‘allow_ip’, ‘default’, $test));_
_ debug(Configure::restore(‘allow_ip’, ‘default’));_
_ debug(Configure::check(‘allow_ip’));_
_ debug(Configure::read(‘allow_ip’));_
RESULTS:
true
true
false
_ull

I cannot to restore data, but I see the file tmp/cashe/cake_allow_ip exists and has data :slight_smile:
1472571323
a:2:{i:0;s:10:“127.0.0.10”;i:1;s:10:“127.0.0.11”;}

Could somebody clarify How it works or it doesn’t works ?

Thank you.

Looks like the restore() is not working. The cached data cannot be read and loaded back into Configure. Does Cache::read('allow_ip', 'default'); return the data you’re expecting? Internally that is what Configure::restore() is doing.

Hi Markstory,
Thanks for you answer.
Yes it works.
But strange why doesn’t work restore (cake version is 2.6.4)

Not sure, you might want to try upgrading as it could be a problem that has been fixed since 2.6.4.