[xoops-cvslog 5017] CVS update: xoops2jp/html/modules/stdCache/blocks

Back to archive index

Minahito minah****@users*****
2006年 10月 14日 (土) 13:53:06 JST


Index: xoops2jp/html/modules/stdCache/blocks/cacheclear.php
diff -u xoops2jp/html/modules/stdCache/blocks/cacheclear.php:1.1.2.1.2.1 xoops2jp/html/modules/stdCache/blocks/cacheclear.php:1.1.2.1.2.2
--- xoops2jp/html/modules/stdCache/blocks/cacheclear.php:1.1.2.1.2.1	Sat Oct  7 15:39:57 2006
+++ xoops2jp/html/modules/stdCache/blocks/cacheclear.php	Sat Oct 14 13:53:05 2006
@@ -1,5 +1,33 @@
 <?php
 
+if (!defined('XOOPS_ROOT_PATH')) exit();
+
+class Stdcache_CacheclearBlock extends Legacy_BlockProcedure
+{
+	function execute()
+	{
+		$root =& XCube_Root::getSingleton();
+	
+		if (!$root->mController->isEnableCacheFeature()) {
+			return false;
+		}
+		
+		if($handler = opendir(XOOPS_CACHE_PATH)) {
+			while(($file = readdir($handler)) !== false) {
+				if(preg_match("/\w+\.cache\.html$/", $file, $matches)) {
+					@unlink(XOOPS_CACHE_PATH . "/" . $matches[0]);
+				}
+			}
+			closedir($handler);
+		}
+	}
+	
+	function isDisplay()
+	{
+		return false;
+	}
+}
+
 function Stdcache_cacheclear_show()
 {
 	$root =& XCube_Root::getSingleton();


xoops-cvslog メーリングリストの案内
Back to archive index