function xstart() { $Directory = "/home/artica-postfix/squid/StatsApplicance/BEREKLEY"; if (!is_dir($Directory)) { return; } if (!($handle = opendir($Directory))) { return; } while (false !== ($fileZ = readdir($handle))) { if ($fileZ == ".") { continue; } if ($fileZ == "..") { continue; } $path = "{$Directory}/{$fileZ}"; $lockfile = "{$Directory}/{$fileZ}.LCK"; events("parse_stats(): Scanning {$path}"); $t1 = microtime_float(); if (preg_match("#^(.+?)-UserAuthDB\\.db#", $fileZ, $re)) { if (is_file($lockfile)) { continue; } @file_put_contents($lockfile, time()); parse_userauthdb($path, $re[1], true); events("{$fileZ} " . microtime_ms($t1)); @unlink($path); @unlink($lockfile); continue; } if (preg_match("#^(.+?)-[0-9]+_QUOTASIZE\\.db#", $fileZ, $re)) { if (is_file($lockfile)) { continue; } @file_put_contents($lockfile, time()); ParseDB_FILE($path, $re[1], true); events("{$fileZ} " . microtime_ms($t1)); @unlink($lockfile); @unlink($path); continue; } } }
function parse_stats() { if (!is_dir("/usr/share/artica-postfix/ressources/conf/upload/BEREKLEY")) { return; } if (!($handle = opendir("/usr/share/artica-postfix/ressources/conf/upload/BEREKLEY"))) { return; } while (false !== ($fileZ = readdir($handle))) { if ($fileZ == ".") { continue; } if ($fileZ == "..") { continue; } if ($GLOBALS["VERBOSE"]) { echo "Scanning upload/BEREKLEY/{$fileZ}\n"; } $path = "/usr/share/artica-postfix/ressources/conf/upload/BEREKLEY/{$fileZ}"; if (preg_match("#^(.+?)-UserAuthDB\\.db#", $fileZ, $re)) { parse_userauthdb($path, $re[1]); @unlink($path); continue; } if (preg_match("#^(.+?)-[0-9]+_size\\.db#", $fileZ, $re)) { parse_size_cache($path, $re[1]); @unlink($path); continue; } if (preg_match("#^(.+?)-[0-9]+_QUOTASIZE\\.db#", $fileZ, $re)) { ParseDB_FILE($path, $re[1]); @unlink($path); continue; } } }