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