[求助]求救APC高手~~~APC取出全部的缓存的条目,有什么办法?
假如不清楚缓存的条目都有哪些key,还有办法取出全部的缓存条目吗?
求救APC高手~~~
[解决办法]
用迭代器 + 正则得到所有缓存条目,默认应该是active的而不是delete的.
<?phpfor($i=0;$i<10;$i++){ ${'test'.$i} = "test{$i}"; apc_store("pos_{$i}",${'test'.$i});}$results = new APCIterator('user', '/^.*$/');while( !!($rs = $results->current()) ){ echo "key:{$rs['key']} -> value:{$rs['value']}<br/>"; $results->next();} /**我这边测试的结果key:pos_0 -> value:test0key:pos_1 -> value:test1key:pos_2 -> value:test2key:pos_3 -> value:test3key:pos_4 -> value:test4key:pos_5 -> value:test5key:pos_6 -> value:test6key:pos_7 -> value:test7key:pos_8 -> value:test8key:pos_9 -> value:test9*/ ?>