本文整理汇总了PHP中keepLock函数的典型用法代码示例。如果您正苦于以下问题:PHP keepLock函数的具体用法?PHP keepLock怎么用?PHP keepLock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了keepLock函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Sql_Affected_Rows
}
$affrows = Sql_Affected_Rows();
while ($userdata = Sql_fetch_row($userids)) {
if ($num_per_batch && $sent >= $num_per_batch) {
output($GLOBALS['I18N']->get('batch limit reached') . ": {$sent} ({$num_per_batch})");
$GLOBALS["wait"] = $batch_period;
return;
}
$userid = $userdata[0];
# id of the user
$some = 1;
set_time_limit(120);
# check if we have been "killed"
$alive = checkLock($send_process_id);
if ($alive) {
keepLock($send_process_id);
} else {
ProcessError($GLOBALS['I18N']->get('Process Killed by other process'));
}
# check if the message we are working on is still there and in process
$status = Sql_Fetch_Array_query("select id,status from {$tables['message']} where id = {$messageid}");
if (!$status['id']) {
ProcessError($GLOBALS['I18N']->get('Message I was working on has disappeared'));
} elseif ($status['status'] != 'inprocess') {
ProcessError($GLOBALS['I18N']->get('Sending of this message has been suspended'));
}
flush();
# check whether the user has already received the message
$um = Sql_query("select entered from {$tables['usermessage']} where userid = {$userdata['0']} and messageid = {$messageid}");
if (!Sql_Affected_Rows()) {
if ($script_stage < 4) {
示例2: Sql_Fetch_Row_Query
$email_req = Sql_Fetch_Row_Query(sprintf('select email from %s where id = %d',$tables["user"],$user[0]));
$unsubscribed_users .= $email_req[0] . " [$user[0]] ($cnt)\n";
}
} elseif ($bounce["bounce"] == "") {
$cnt = 0;
}
}*/
#$alive = 1;$removed = 0; DT 051105
$cnt = 0;
$alive = 1;
$removed = $msgokay = $unconfirmed = $unsubscribed = 0;
#while ($alive && !$removed && $bounce = Sql_Fetch_Array($msg_req)) { DT 051105
while ($alive && !$removed && !$msgokay && ($bounce = Sql_Fetch_Array($msg_req))) {
$alive = checkLock($process_id);
if ($alive) {
keepLock($process_id);
} else {
bounceProcessError("Process Killed by other process");
}
if (stripos($bounce['status'], 'duplicate') === false && stripos($bounce['comment'], 'duplicate') === false) {
if (sprintf('%d', $bounce["bounce"]) == $bounce["bounce"]) {
$cnt++;
if ($cnt >= $bounce_unsubscribe_threshold) {
if (!$unsubscribed) {
outputProcessBounce(sprintf('unsubscribing %d -> %d bounces', $user[0], $cnt));
$userurl = PageLink2("user&id={$user['0']}", $user[0]);
logEvent(s('User (url:%s) has consecutive bounces (%d) over threshold (%d), user marked unconfirmed', $userurl, $cnt, $bounce_unsubscribe_threshold));
$emailreq = Sql_Fetch_Row_Query("select email from {$tables["user"]} where id = {$user['0']}");
addUserHistory($emailreq[0], s('Auto Unconfirmed'), s('Subscriber auto unconfirmed for %d consecutive bounces', $cnt));
Sql_Query(sprintf('update %s set confirmed = 0 where id = %d', $tables["user"], $user[0]));
$email_req = Sql_Fetch_Row_Query(sprintf('select email from %s where id = %d', $tables["user"], $user[0]));