Commit 66b50e5d authored by Sebastien Robin's avatar Sebastien Robin

removed the cache per site feature

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11021 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b5de7fac
...@@ -140,21 +140,20 @@ class CacheTool(BaseTool): ...@@ -140,21 +140,20 @@ class CacheTool(BaseTool):
security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheRoot') security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheRoot')
def getRamCacheRoot(self): def getRamCacheRoot(self):
""" Return RAM based cache root """ """ Return RAM based cache root """
erp5_site_id = self.getPortalObject().getId() return CachingMethod.factories
return CachingMethod.factories[erp5_site_id]
security.declareProtected(Permissions.ModifyPortalContent, 'updateCache') security.declareProtected(Permissions.ModifyPortalContent, 'updateCache')
def updateCache(self, REQUEST=None): def updateCache(self, REQUEST=None):
""" Clear and update cache structure """ """ Clear and update cache structure """
erp5_site_id = self.getPortalObject().getId() #erp5_site_id = self.getPortalObject().getId()
for cf in CachingMethod.factories[erp5_site_id]: for cf in CachingMethod.factories:
for cp in CachingMethod.factories[erp5_site_id][cf].getCachePluginList(): for cp in CachingMethod.factories[cf].getCachePluginList():
del cp del cp
CachingMethod.factories[erp5_site_id] = {} CachingMethod.factories = {}
## read configuration from ZODB ## read configuration from ZODB
for key,item in self.getCacheFactoryList().items(): for key,item in self.getCacheFactoryList().items():
if len(item['cache_plugins'])!=0: if len(item['cache_plugins'])!=0:
CachingMethod.factories[erp5_site_id][key] = CacheFactory(item['cache_plugins'], item['cache_params']) CachingMethod.factories[key] = CacheFactory(item['cache_plugins'], item['cache_params'])
if REQUEST: if REQUEST:
self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache updated.') self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache updated.')
......
...@@ -6,18 +6,19 @@ this_module = sys.modules[ __name__ ] ...@@ -6,18 +6,19 @@ this_module = sys.modules[ __name__ ]
product_path = package_home( globals() ) product_path = package_home( globals() )
this_module._dtmldir = os.path.join( product_path, 'dtml' ) this_module._dtmldir = os.path.join( product_path, 'dtml' )
from Products.ERP5Type.Utils import initializeProduct, updateGlobals from Products.ERP5Type.Utils import initializeProduct, updateGlobals
import CacheTool import CacheTool
#import CacheTool
object_classes = () object_classes = ()
portal_tools = () #(CacheTool.CacheTool,) portal_tools = ()
content_classes = () content_classes = ()
content_constructors = () content_constructors = ()
document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions) document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions)
portal_tools = ( CacheTool.CacheTool, ) portal_tools = ( CacheTool.CacheTool, )
def initialize( context ): def initialize( context ):
import Document import Document
initializeProduct(context, this_module, globals(), initializeProduct(context, this_module, globals(),
...@@ -27,3 +28,4 @@ def initialize( context ): ...@@ -27,3 +28,4 @@ def initialize( context ):
portal_tools = portal_tools, portal_tools = portal_tools,
content_constructors = content_constructors, content_constructors = content_constructors,
content_classes = content_classes) content_classes = content_classes)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment