ZF-4801: Allow Zend_Paginator to cache its data throught a Zend_Cache_Core instance

Description

It could be very usefull to provide a way for Zend_Paginator to cache its data.

When Zend_Paginator reads actual data, it stores them into a sort of cache : $_pageItems, but those data does not persist throught HTTP requests as they are just stored in an object property. If Zend_Paginator could be given a Zend_Cache_Core instance, it could use it to store data in a 'real' cache, making seeking throught the pages easier and quicker. Also, this would prevent the final user from inventing such a system.

Comments

This is a planned future enhancement.

If I can find time, I can provide a usefull patch, stay tuned

Patch for Zend_Paginator and tests is attached; waiting for Zend approval

Added the feature at r13439

I think using spl_object_hash to generate the cache id is a bad idea : it depends on the internal object handle and handler table pointer. I encounter cache collision when I have multiple paginator objects.

Reported at ZF-6746, on it