本文整理汇总了PHP中Indexer::updateIndexedDocumentCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::updateIndexedDocumentCount方法的具体用法?PHP Indexer::updateIndexedDocumentCount怎么用?PHP Indexer::updateIndexedDocumentCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::updateIndexedDocumentCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
Windows Vista always returns false if we try and check the host and port
so for windows we use the win32 service status checks.
*/
// Check if the calling function requires a return value
$sGiveOutput = isset($argv[1]) && $argv[1] == 'output' ? true : false;
// Check indexed document count
// If the number of indexed documents is greater than the set amount, restart open office
// this clears open office's memory usage
$resetPoint = 50;
// todo: put in config
$count = Indexer::getIndexedDocumentCount();
$restartOO = false;
if ($count > $resetPoint) {
$restartOO = true;
// reset the count
Indexer::updateIndexedDocumentCount(0);
$default->log->debug('Check Open Office Task: Restarting open office.');
}
// First we check the host:port to see if open office is running
$sCheckOO = SearchHelper::checkOpenOfficeAvailablity();
if (empty($sCheckOO) && !$restartOO) {
// If the check returns empty then it is available on that port so we exit
if ($sGiveOutput) {
echo 1;
}
exit;
}
// Open office appears not to be running or requires a restart
if (OS_WINDOWS) {
$OOService = 'ktopenoffice';
$default->log->debug('Check Open Office Task: ' . get_current_user());
示例2: incrementCount
private static function incrementCount()
{
// Get count from system settings
$count = Indexer::getIndexedDocumentCount();
$count = (int) $count + 1;
Indexer::updateIndexedDocumentCount($count);
}