Minahito
minah****@users*****
2006年 10月 17日 (火) 00:35:31 JST
Index: xoops2jp/html/modules/legacy/kernel/Legacy_BlockProcedure.class.php diff -u xoops2jp/html/modules/legacy/kernel/Legacy_BlockProcedure.class.php:1.1.2.2 xoops2jp/html/modules/legacy/kernel/Legacy_BlockProcedure.class.php:1.1.2.3 --- xoops2jp/html/modules/legacy/kernel/Legacy_BlockProcedure.class.php:1.1.2.2 Tue Oct 17 00:11:29 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_BlockProcedure.class.php Tue Oct 17 00:35:31 2006 @@ -86,7 +86,7 @@ * Gets a value indicating whether the block can be cached. * @return bool */ - function enableCache() + function isEnableCache() { } Index: xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php diff -u xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php:1.1.2.4 xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php:1.1.2.5 --- xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php:1.1.2.4 Tue Oct 17 00:11:47 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_Module.class.php Tue Oct 17 00:35:31 2006 @@ -170,7 +170,7 @@ * configurations to use the cache system. * @return bool */ - function hasCacheConfig() + function isEnableCache() { if (xoops_getenv('REQUEST_METHOD') == 'POST') { return false; Index: xoops2jp/html/modules/legacy/kernel/Legacy_CacheInformation.class.php diff -u xoops2jp/html/modules/legacy/kernel/Legacy_CacheInformation.class.php:1.1.2.2 xoops2jp/html/modules/legacy/kernel/Legacy_CacheInformation.class.php:1.1.2.3 --- xoops2jp/html/modules/legacy/kernel/Legacy_CacheInformation.class.php:1.1.2.2 Tue Oct 17 00:11:41 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_CacheInformation.class.php Tue Oct 17 00:35:31 2006 @@ -116,6 +116,18 @@ */ var $mURL = null; + /** + * @var XCube_Delegate + */ + var $mGetCacheFilePath = null; + + function Legacy_ModuleCacheInformation() + { + parent::Legacy_AbstractCacheInformation(); + $this->mGetCacheFilePath =& new XCube_Delegate(); + $this->mGetCacheFilePath->register('Legacy_ModuleCacheInformation.getCacheFilePath'); + } + /** * Sets a module object. * @param XoopsModule $module @@ -140,7 +152,7 @@ function getCacheFilePath() { $filepath = null; -// $this->mGetModuleCacheFilePath->call(new XCube_Ref($filepath), $cacheInfo); + $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this); if (!$filepath) { $id = md5(XOOPS_SALT . $this->mURL . "(" . implode("_", $this->mIdentityArr) . ")" . implode("_", $this->mGroupArr)); @@ -162,6 +174,18 @@ var $mBlock = null; /** + * @var XCube_Delegate + */ + var $mGetCacheFilePath = null; + + function Legacy_BlockCacheInformation() + { + parent::Legacy_AbstractCacheInformation(); + $this->mGetCacheFilePath =& new XCube_Delegate(); + $this->mGetCacheFilePath->register('Legacy_BlockCachInformation.getCacheFilePath'); + } + + /** * Sets a block object. * * @param Legacy_AbstractBlockProcedure $blockProcedure @@ -185,7 +209,7 @@ function getCacheFilePath() { $filepath = null; -// $this->mGetBlockCacheFilePath->call(new XCube_Ref($filepath), $cacheInfo); + $this->mGetCacheFilePath->call(new XCube_Ref($filepath), $this); if (!$filepath) { $id = md5(XOOPS_SALT . $this->mBlock->get('bid') . "(" . implode("_", $this->mIdentityArr) . ")" . implode("_", $this->mGroupArr)); Index: xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php diff -u xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.4 xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.5 --- xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php:1.1.2.4 Tue Oct 17 00:11:58 2006 +++ xoops2jp/html/modules/legacy/kernel/Legacy_Controller.class.php Tue Oct 17 00:35:31 2006 @@ -281,7 +281,9 @@ // $usedCacheFlag = false; - if ($this->isEnableCacheFeature()) { + $cacheInfo = null; + + if ($this->isEnableCacheFeature() && $blockProcedure->isEnableCache()) { // // Reset the block cache information structure, and initialize. // @@ -326,7 +328,7 @@ 'weight'=>$blockProcedure->getWeight() ); - if ($this->isEnableCacheFeature() && $blockProcedure->getCacheTime() > 0 && $cacheInfo->isEnableCache()) { + if ($this->isEnableCacheFeature() && $blockProcedure->isEnableCache() && is_object($cacheInfo) && $cacheInfo->isEnableCache()) { $this->cacheRenderTarget($cacheInfo->getCacheFilePath(), $renderBuffer); } } @@ -692,7 +694,7 @@ $this->mSetModuleCachePolicy->call($cacheInfo); - if ($this->mRoot->mContext->mModule->hasCacheConfig()) { + if ($this->mRoot->mContext->mModule->isEnableCache()) { // // Checks whether the cache file exists. // @@ -761,7 +763,7 @@ // // Cache Control // - if ($this->isEnableCacheFeature() && $this->mRoot->mContext->mModule->hasCacheConfig()) { + if ($this->isEnableCacheFeature() && $this->mRoot->mContext->mModule->isEnableCache()) { if ($this->mRoot->mContext->mModule->mCacheInfo->isEnableCache()) { $this->cacheRenderTarget($this->mRoot->mContext->mModule->mCacheInfo->getCacheFilePath(), $renderTarget); }