本文整理匯總了PHP中DataProvider::set_cache方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataProvider::set_cache方法的具體用法?PHP DataProvider::set_cache怎麽用?PHP DataProvider::set_cache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataProvider
的用法示例。
在下文中一共展示了DataProvider::set_cache方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: while
array_push($arrTo, $e->email);
}
try {
$flag = true;
while ($flag) {
$rand = mt_rand(0, $lenSecSenders - 1);
$sender = $secSenders[$rand];
if ($sender == null) {
$mail->send(ADMIN_EMAIL, 'SMTP Error!!!', 'No email sender', $emailGlobal);
$flag = false;
} else {
if ($mail->send($arrTo, 'JobBid.vn - Danh Sách Công Việc Bán Thời Gian Mới!!!', $content, $sender) == false) {
unset($secSenders[$rand]);
$secSenders = array_values($secSenders);
$lenSecSenders--;
$conn->set_cache('secSenders', $secSenders);
$msgError = 'Email ' . $sender['email'] . ' cannot send!';
$mail->send(ADMIN_EMAIL, 'SMTP Error!!!', $msgError, $emailGlobal);
} else {
$flag = false;
echo 'Send Mail Success';
}
}
}
} catch (Exception $e) {
echo 'Send Mail Error';
}
} else {
echo 'No Email To Send';
}
$conn->close();
示例2: while
$flag = true;
while ($flag) {
$sender = $sender1;
if ($e->isprior != 1) {
$sender = $sender2;
}
if ($sender == null) {
$mail->send(ADMIN_EMAIL, 'SMTP Error!!!', 'No email sender', $emailGlobal);
$flag = false;
} else {
if ($mail->send($e->to, $e->subject, $e->content, $sender) == false) {
if ($e->isprior != 1) {
unset($secSenders[$rand]);
$secSenders = array_values($secSenders);
$lenSecSenders--;
$conn->set_cache('secSenders', $secSenders);
} else {
unset($priSenders[$rand]);
$priSenders = array_values($priSenders);
$lenPriSenders--;
$conn->set_cache('priSenders', $priSenders);
}
$rand = mt_rand(0, $lenPriSenders - 1);
$sender1 = $priSenders[$rand];
$rand = mt_rand(0, $lenSecSenders - 1);
$sender2 = $secSenders[$rand];
$msgError = 'Email ' . $sender['email'] . ' cannot send!';
$mail->send(ADMIN_EMAIL, 'SMTP Error!!!', $msgError, $emailGlobal);
} else {
$flag = false;
echo 'Send mail to <b>' . $e->to . '</b><br/>';