gjerokrsteski / pimf-framework

Micro framework for PHP that emphasises minimalism and simplicity
pimf-framework.de
MIT License
43 stars 16 forks source link

Incoherent API in cache storage engines #25

Closed garrettw closed 7 years ago

garrettw commented 7 years ago

Among the cache storage engines, if a given $key does not exist, retrieve() returns different values depending on the storage engine. Some of them return true, some false, and some null.

Which return value should we standardize on? I noticed that many of the core PHP functions called by those classes return false on failure, so should we use that too?

gjerokrsteski commented 7 years ago

OK you are right. It is better to standardize it on NULL if there is a cache miss. Because a boolean value can be a value stored and expected from the cache.