Added CMS_HOOK_CACHE, and admin cache.

Prepared evolution of feed module, by allowing json object to list feeds locations.
   The associated key will be used to identify the location, and have category filter by location.
This commit is contained in:
2015-10-12 19:03:12 +02:00
parent 8cdf9ba973
commit 50146985de
6 changed files with 207 additions and 10 deletions

View File

@@ -0,0 +1,31 @@
note
description: "[
Hook providing cache related management facilities.
]"
date: "$Date: 2014-11-19 20:00:19 +0100 (mer., 19 nov. 2014) $"
revision: "$Revision: 96123 $"
deferred class
CMS_HOOK_CACHE
inherit
CMS_HOOK
feature -- Hook
clear_cache (a_cache_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_response: CMS_RESPONSE)
-- Clear caches identified by `a_cache_id_list',
-- or clear all caches if `a_cache_id_list' is Void.
deferred
end
cache_identifiers: detachable ITERABLE [like {CMS_BLOCK}.name]
-- Optional list of cache id, if any.
do
-- To redefine if needed.
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end

View File

@@ -104,7 +104,6 @@ feature -- Hook: menu_alter
end
end
feature -- Hook: form_alter
subscribe_to_form_alter_hook (h: CMS_HOOK_FORM_ALTER)
@@ -177,6 +176,29 @@ feature -- Hook: block
end
end
feature -- Hook: cache
subscribe_to_cache_hook (h: CMS_HOOK_CACHE)
-- Add `h' as subscriber of cache hooks CMS_HOOK_CACHE,
-- and response `a_response'.
do
subscribe_to_hook (h, {CMS_HOOK_CACHE})
end
invoke_clear_cache (a_cache_id_list: detachable ITERABLE [READABLE_STRING_GENERAL]; a_response: CMS_RESPONSE)
-- Invoke cache hook for identifiers `a_cache_id_list'.
do
if attached subscribers ({CMS_HOOK_CACHE}) as lst then
across
lst as c
loop
if attached {CMS_HOOK_CACHE} c.item as h then
h.clear_cache (a_cache_id_list, a_response)
end
end
end
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"