本文整理汇总了PHP中Indexer::clearoutDeletedFromProcessor方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::clearoutDeletedFromProcessor方法的具体用法?PHP Indexer::clearoutDeletedFromProcessor怎么用?PHP Indexer::clearoutDeletedFromProcessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::clearoutDeletedFromProcessor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDocumentProcessingQueue
/**
* Get the queue of documents for processing
*
*/
public function getDocumentProcessingQueue($max = null)
{
global $default;
$max = empty($max) ? 20 : $max;
// Cleanup the queue
Indexer::clearoutDeletedFromProcessor();
$date = date('Y-m-d H:i:s');
// identify the indexers that must run
// mysql specific limit!
$sql = "SELECT\n \t\t\tpq.document_id, mt.filetypes, mt.mimetypes\n\t\t\t\tFROM\n\t\t\t\t\tprocess_queue pq\n\t\t\t\t\tINNER JOIN documents d ON pq.document_id=d.id\n\t\t\t\t\tINNER JOIN document_metadata_version dmv ON d.metadata_version_id=dmv.id\n\t\t\t\t\tINNER JOIN document_content_version dcv ON dmv.content_version_id=dcv.id\n\t\t\t\t\tINNER JOIN mime_types mt ON dcv.mime_id=mt.id\n \t\t\t\tWHERE\n \t\t\t\t\t(pq.date_processed IS NULL or pq.date_processed < date_sub('{$date}', interval 1 day)) AND dmv.status_id=1\n\t\t\t\tORDER BY date_added\n \t\t\t\t\tLIMIT {$max}";
$result = DBUtil::getResultArray($sql);
if (PEAR::isError($result)) {
$default->log->error('Processing queue: stopping - db error: ' . $result->getMessage());
return;
}
// bail if no work to do
if (count($result) == 0) {
$default->log->debug('Processing queue: stopping - no work to be done');
return;
}
return $result;
}