本文整理汇总了PHP中Indexer::processUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::processUser方法的具体用法?PHP Indexer::processUser怎么用?PHP Indexer::processUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::processUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (is_array($usersToProcess) && count($usersToProcess)) {
foreach ($usersToProcess as $user) {
//$user = $usersToProcess[1];
if (CONSOLE_OUT_CHARSET) {
printlog(1, @iconv('utf-8', CONSOLE_OUT_CHARSET, $user['nick']));
} else {
printlog(1, $user['nick']);
}
printlog(1, "(" . $user['files'] . "," . $user['dirs'] . ")-");
$st = microtime(true);
if (!file_exists(WORKER_TMPDIR . '/' . $user['filename'])) {
printlog(1, "list not exists, skipping\n");
Indexer::skipUser($user['id']);
continue;
}
list($added_files, $added_dirs, $deleted_files, $deleted_dirs) = Indexer::processUser($user['id'], 'compress.bzip2://' . WORKER_TMPDIR . '/' . $user['filename'], $user['files'], $user['dirs']);
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");