laruence / yac

A fast, lock-free, shared memory user data cache for PHP
Other
824 stars 198 forks source link

no way to determine if bool(false) was stored, or the key couldn't be looked up #34

Open OlliL opened 10 years ago

OlliL commented 10 years ago

Hi,

I have some variables containing bool(false) or bool(true) I'd like to add and get. The problem is now, when I store false and get it back later, I don't know if false was stored, or the key is unknown to yac.

In Memcached for example I can check Memcached::getResultCode() with Memcached::RES_NOTFOUND. In Yac, when false is returned, I have to do all this expensive-SQL-stuff to re-determine the information.

thbourlove commented 10 years ago

Hi, @OlliL . Maybe #33 is a good choice for you. with this patch, you can set yac.default_null = 1 in your php.ini. Then you will get null when the key is unknown to yac.