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):
security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheRoot')
def getRamCacheRoot(self):
""" Return RAM based cache root """
erp5_site_id = self.getPortalObject().getId()
return CachingMethod.factories[erp5_site_id]
return CachingMethod.factories
security.declareProtected(Permissions.ModifyPortalContent, 'updateCache')
def updateCache(self, REQUEST=None):
""" Clear and update cache structure """
erp5_site_id = self.getPortalObject().getId()
for cf in CachingMethod.factories[erp5_site_id]:
for cp in CachingMethod.factories[erp5_site_id][cf].getCachePluginList():
#erp5_site_id = self.getPortalObject().getId()
for cf in CachingMethod.factories:
for cp in CachingMethod.factories[cf].getCachePluginList():
del cp
CachingMethod.factories[erp5_site_id] = {}
CachingMethod.factories = {}
## read configuration from ZODB
for key,item in self.getCacheFactoryList().items():
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:
self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache updated.')
......
......@@ -6,18 +6,19 @@ this_module = sys.modules[ __name__ ]
product_path = package_home( globals() )
this_module._dtmldir = os.path.join( product_path, 'dtml' )
from Products.ERP5Type.Utils import initializeProduct, updateGlobals
import CacheTool
#import CacheTool
object_classes = ()
portal_tools = () #(CacheTool.CacheTool,)
portal_tools = ()
content_classes = ()
content_constructors = ()
document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions)
portal_tools = ( CacheTool.CacheTool, )
def initialize( context ):
import Document
initializeProduct(context, this_module, globals(),
......@@ -27,3 +28,4 @@ def initialize( context ):
portal_tools = portal_tools,
content_constructors = content_constructors,
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