ezsystems/ezpublish — pull request #353 by schroeder (2012-06-14 20:45:19+00:00)
Title: Add name parameter to cache-block template function

This pull request contains the functionality to give cache-blocks a name and expire the cache blocks by its name.

A new parameter "name" is intruduced to the cache-block function. The parameter is not mandotory, if its not given the cache block will work as now. So this functionality is backwards compatible.

If a name is given the cache files will be stored into a structure simliar to now. But as new subfolder the name is added. So that a cache block file is stored into
"var/cache/template-block/[subtree/]/*".

A newly intruduced script "./bin/php/ezexpiretemplateblock.php" is able to expire all cache files of a certain cache-block or a certain file of a specific node.

The template name and code line will not used for the cache keys if a cache block name is given. So template changes will not directly expire a cache block. If there are template changes inside a cache block function an explicit cache expiration action is needed.

This pull request is an alternative to https://github.com/ezsystems/ezpublish/pull/292.
The advantage of this pull request is, that it will keep the backwards compability and adds the possibility to use the script or the API function to expire a certain cache block by a custom name.