本文整理汇总了PHP中Indexer::delOldUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::delOldUsers方法的具体用法?PHP Indexer::delOldUsers怎么用?PHP Indexer::delOldUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::delOldUsers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printlog
printlog(1, "ADDED:{$added_files} files,{$added_dirs} dirs;DELETED:{$deleted_files} files,{$deleted_dirs} dirs-");
$total_added_files += $added_files;
$total_added_dirs += $added_dirs;
$total_deleted_files += $deleted_files;
$total_deleted_dirs += $deleted_dirs;
$total_count++;
$et = microtime(true);
printlog(1, round($et - $st, 2) . "s\n");
sleep(1);
//win+mysql 5.1: id=0 fixing
}
}
$get = microtime(true);
printlog(1, "========\n");
printlog(0, "{$total_count} users-ADDED {$total_added_files} files,{$total_added_dirs} dirs;DELETED:{$total_deleted_files} files,{$total_deleted_dirs} dirs-" . sprintf("%01.2f", $get - $gst) . "s\n");
if ($deleted_users = Indexer::delOldUsers()) {
printlog(0, "{$deleted_users} old(or empty) users deleted from db\n");
}
Indexer::freeXmlReader();
$dir = opendir(WORKER_TMPDIR);
$deleted = 0;
while ($fn = readdir($dir)) {
if (pathinfo($fn, PATHINFO_EXTENSION) == 'bz2') {
@unlink(WORKER_TMPDIR . '/' . $fn);
$deleted++;
}
}
printlog(1, "{$deleted} bz2 files deleted\n");
function printlog($debugLevel, $message)
{
$debug = defined('DEBUG') ? constant('DEBUG') : 0;