Alpha4615 / phpMyCache

A PHP library that caches mySQL SELECT queries to the file system
GNU General Public License v2.0
1 stars 1 forks source link

Accept a strtotime() string as an expiry #3

Closed Alpha4615 closed 10 years ago

Alpha4615 commented 10 years ago

It may be useful for a developer to specify what time of day a cached data set should expire. For example, "yesterday's most popular items" might expire at midnight. If the developer could specify this, the library could internally convert that into the final expiry duration.

The expiry argument in queryCache() should accept an integer or a string that's parsable by strtotime().

Alpha4615 commented 10 years ago

Additionally the option defaultExpiry will need this support so the validation will have to be modified to allow the string data type, but only if strtotime() of that value does not return false.