本文整理汇总了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();