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; } // XVÉ\[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[^ÌûªêuxêÄ}ü³êé½ß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);