本文整理匯總了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;
}