本文整理匯總了PHP中files::deleteOldProcessingJobs方法的典型用法代碼示例。如果您正苦於以下問題:PHP files::deleteOldProcessingJobs方法的具體用法?PHP files::deleteOldProcessingJobs怎麽用?PHP files::deleteOldProcessingJobs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類files
的用法示例。
在下文中一共展示了files::deleteOldProcessingJobs方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ini_set
ini_set('memory_limit', -1);
set_time_limit(0);
require "../header.php";
if (!isCLI()) {
print "Must be run from the command line.";
exit;
}
// Turn off EngineAPI template engine
$engine->obCallback = FALSE;
$count = 0;
while (TRUE) {
$sql = sprintf("SELECT * FROM `objectProcessing` WHERE `state`='1' LIMIT 1");
$sqlResult = mfcs::$engine->openDB->query($sql);
if (!$sqlResult['result']) {
errorHandle::newError(__METHOD__ . "() - : " . $sqlResult['error'], errorHandle::DEBUG);
// we break here, instead of continue so that we don't get stuck in an infinate loop.
break;
}
if ($sqlResult['numrows'] == "0") {
break;
}
$row = mysql_fetch_array($sqlResult['result'], MYSQL_ASSOC);
files::process($row['objectID'], $row['fieldName']);
// safety. we don't have any projects that are more than 50000 items currently
// @TODO pull this dynamically from the system. get a best guess max processing
if ($count++ > 50000) {
break;
}
}
files::deleteOldProcessingJobs();
files::errorOldProcessingJobs();