simplepie/simplepie — pull request #329 by rapid2k1 (2013-11-03 20:14:09+00:00)
Title: Fix for Issue #327 - Purges MySql cache contents older than a configu

I have added a new option to the MySql cache backend. Configured through set_cache_location():
cache_purge_time=seconds. It defaults to 2592000 (30 days). Everything older (not updated for 30 days) will be deleted before each call to save(), that is, when storing/updating content from the cache.

$feed->set_cache_location('mysql://user:pass@localhost:3306/table?prefix=sp_&cache_purge_time=2592000');

The following sql code will be run before any update.

~~~
DELETE i, cd
FROM `sp_cache_data` cd, `sp_items` i
WHERE cd.id = i.feed_id AND cd.mtime < (unix_timestamp() - cache_purge_time
~~~