本文整理汇总了PHP中Indexer::getDB方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::getDB方法的具体用法?PHP Indexer::getDB怎么用?PHP Indexer::getDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::getDB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: opendir
if (isset($_SERVER['SERVER_NAME'])) {
echo "<pre>";
}
///////////////////
$dir = opendir(WORKER_TMPDIR);
$deleted = 0;
while ($fn = readdir($dir)) {
if (pathinfo($fn, PATHINFO_EXTENSION) == 'dump') {
@unlink(WORKER_TMPDIR . '/' . $fn);
$deleted++;
}
}
printlog(1, "{$deleted} dump files deleted\n");
///////////////////
$gst = microtime(true);
$DB = Indexer::getDB();
$usersToProcess = Indexer::getUsersToProcess();
$total_count = $total_added_files = $total_added_dirs = $total_deleted_files = $total_deleted_dirs = 0;
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']);