[P2-php-svn] [792] expack:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 17日 (日) 19:34:34 JST


Revision: 792
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=792
Author:   rsk
Date:     2010-01-17 19:34:34 +0900 (Sun, 17 Jan 2010)

Log Message:
-----------
expack:
- MatomeCacheList::trim()のバグを修正。

Modified Paths:
--------------
    p2ex/trunk/lib/MatomeCacheList.php


-------------- next part --------------
Modified: p2ex/trunk/lib/MatomeCacheList.php
===================================================================
--- p2ex/trunk/lib/MatomeCacheList.php	2010-01-17 09:12:42 UTC (rev 791)
+++ p2ex/trunk/lib/MatomeCacheList.php	2010-01-17 10:34:34 UTC (rev 792)
@@ -107,7 +107,9 @@
 
         // $length‚ªƒ[ƒ‚̏ꍇ‚Í‘SŒíœ
         if ($length == 0) {
-            return self::clear($prefix);
+            MatomeCacheDataStore::clear($prefix);
+            MatomeCacheMetaDataStore::clear($prefix);
+            return true;
         }
 
         // XVŽž‡‚Ƀ\[ƒg‚µ‚Ä$length+1”Ԗڂ̃ŒƒR[ƒh‚ðŽæ“¾
@@ -118,6 +120,7 @@
             return 0;
         }
 
+        $key = key($result);
         $mtime = current($result)->mtime;
         $query = 'DELETE FROM $__table WHERE '
                . P2KeyValueStore::C_KEY_BEGINS
@@ -135,6 +138,16 @@
 
         // ƒƒ^ƒf[ƒ^‚àíœ
         $kvs = MatomeCacheMetaDataStore::getKVS();
+        /*
+         * ƒƒ^ƒf[ƒ^‚Ì•û‚ªˆêu’x‚ê‚Ä‘}“ü‚³‚ê‚邽‚߁A‚²‚­‹H‚Ƀf[ƒ^‚Ìmtime‚Æ
+         * ƒƒ^ƒf[ƒ^‚Ìmtime‚ªˆÙ‚È‚é‰Â”\«‚ª‚ ‚éB‚±‚Ì‚Æ‚«ƒf[ƒ^‚Ìmtime‚ð
+         * ‚»‚Ì‚Ü‚ÜŽg‚¤‚ÆgetList()‚ÌŒ‹‰Ê‚Ƀf[ƒ^‚ª‘¶Ý‚µ‚È‚¢ƒŒƒR[ƒh‚ª
+         * ŠÜ‚Ü‚ê‚邱‚Æ‚É‚È‚é‚̂ŁA‚»‚ê‚ð–h‚®‚½‚߂Ƀf[ƒ^‚Æ“¯ˆêƒL[‚Ì
+         * ƒƒ^ƒf[ƒ^‚Ìmtime‚ðŽæ“¾‚·‚éB
+         */
+        if ($record = $kvs->getRaw($key)) {
+            $mtime = $record->mtime;
+        }
         $stmt = $kvs->prepare($query);
         $kvs->bindValueForPrefixSearch($stmt, $prefix);
         $stmt->bindValue(':mtime', $mtime, PDO::PARAM_INT);



P2-php-svn メーリングリストの案内
Back to archive index