The caching API required an intermediate function to route the cache build by taking the $cache_key
and $host
parameters. (example: hook_cache_build()
) This is no longer necessary. The requirement now is to set from the theme's .info (.pinfo for plug-ins) a 'cache handlers' key to tell Hexagon where the cache should be built.
Here's what's set in Hexagon:
cache handlers[files] = includes/build_files.inc
cache handlers[plugins] = includes/build_plugins.inc
cache handlers[settings] = includes/build_settings.inc
The key [within the square brackets] is the $cache_key
and the value to the right is the path to the file that handles the build relative to the host theme or plug-in. It will only be included when needed and the function HOOK_build_$cache_key()
will be called with the returned data being cached.
When calling the function, the $host
in hex_cache($cache_key, $host)
is no longer necessary. The cache info can be retrieved simply by calling hex_cache('foo')->data
.
All functions related to the cache API has also been moved to 'HexagonBase/includes/caching.inc'.
There also exists a new function to get the state of whether the cache has been cleared or not (hex_cache_was_cleared()
returns a boolean).
Comment | File | Size | Author |
---|---|---|---|
#1 | patch_commit_bc86d398f920.patch | 10.88 KB | dvessel |
Comments
Comment #1
dvessel CreditAttribution: dvessel commented