/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

$curdir = getcwd();
if (preg_match("/(.*)cache.php$/", $_SERVER['SCRIPT_FILENAME'], $m)) @chdir($m[1]);
require("../adei.php");


try {
    $flags = REQUEST::NEED_ITEMINFO|REQUEST::NEED_INFO|CACHE::TABLE_INFO|CACHE::NEED_REQUESTS|CACHE::FIND_BROKEN|REQUEST::LIST_WILDCARDED;

    $cache = new CACHEDB();
    $list = $cache->GetCacheList($flags);

    foreach ($list as $id => &$info) {
        if ($info['req']) continue;
        if ($info['disconnected']) continue;
        if ($info['db_server'] == 'logs') continue;

	echo translate("Dropping %s", $info['postfix']);
	if (preg_match("/^__md5_(.*)$/", $info['postfix'], $m)) {
	    echo " (" . $info['db_server'] . "__" . $info['db_name'] . "__" . $info['db_group'] . ")";
        }
        echo ": ";
        $cache->Drop($info['postfix']);
	echo "done\n";
    }
} catch (ADEIException $ae) {
    throw $ae;
}

?>