本文整理汇总了PHP中backupbuddy_core::replaceNotifications方法的典型用法代码示例。如果您正苦于以下问题:PHP backupbuddy_core::replaceNotifications方法的具体用法?PHP backupbuddy_core::replaceNotifications怎么用?PHP backupbuddy_core::replaceNotifications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backupbuddy_core
的用法示例。
在下文中一共展示了backupbuddy_core::replaceNotifications方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
// End foreach.
unset($item);
unset($item_name);
}
// End foreach.
unset($event);
unset($hook_name);
}
// End if is_numeric.
}
// End foreach.
unset($cron_item);
unset($time);
// Cleanup any old notifications.
$notifications = backupbuddy_core::getNotifications();
// Load notifications.
$updateNotifications = false;
$maxTimeDiff = pb_backupbuddy::$options['max_notifications_age_days'] * 24 * 60 * 60;
foreach ($notifications as $i => $notification) {
if (time() - $notification['time'] > $maxTimeDiff) {
unset($notifications[$i]);
$updateNotifications = true;
}
}
if (true === $updateNotifications) {
pb_backupbuddy::status('details', 'Periodic cleanup: Replacing notifications.');
backupbuddy_core::replaceNotifications($notifications);
}
@clearstatcache();
// Clears file info stat cache.
pb_backupbuddy::status('message', 'Finished cleanup procedure.');
示例2: backupbuddy_sync_add_notices
function backupbuddy_sync_add_notices($arguments, $urgent = false)
{
require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
$notifications = backupbuddy_core::getNotifications();
foreach ($notifications as &$notification) {
// Skip if in the inapplicable mode.
if (false === $urgent && true === $notification['urgent']) {
// If NOT seeking urgents, skip urgents.
continue;
}
if (true === $urgent && false === $notification['urgent']) {
// If seeking urgents, skip non-urgents.
continue;
}
if (true === $notification['syncSent']) {
// Only send once.
continue;
}
$notification['syncSent'] = true;
// Compile data.
//$data = array();
$data = $notification['data'];
/*
if ( ! empty( $arguments['verbose'] ) ) { // The verbose argument can be checked for in order to provide additional information that may not always be necessary.
$data = $notification['data'];
}
*/
// Send notice.
if (false === $urgent) {
ithemes_sync_add_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $data);
} elseif (true === $urgent) {
ithemes_sync_send_urgent_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $data);
}
}
backupbuddy_core::replaceNotifications($notifications);
// Save with syncSent updates for all notifications.
return true;
}
示例3: backupbuddy_sync_add_notices
function backupbuddy_sync_add_notices($arguments, $urgent = false)
{
require_once pb_backupbuddy::plugin_path() . '/classes/core.php';
$notifications = backupbuddy_core::getNotifications();
foreach ($notifications as &$notification) {
// Skip if in the inapplicable mode.
if (false === $urgent && true === $notification['urgent']) {
// If NOT seeking urgents, skip urgents.
continue;
}
if (true === $urgent && false === $notification['urgent']) {
// If seeking urgents, skip non-urgents.
continue;
}
if (true === $notification['syncSent']) {
// Only send once.
continue;
}
$notification['syncSent'] = true;
$notification['data']['datestamp'] = date('Y-m-d', $notification['time']);
// Added v6.3.3.10.
// Send notice.
if (false === $urgent) {
ithemes_sync_add_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $notification['data']);
} elseif (true === $urgent) {
ithemes_sync_send_urgent_notice('backupbuddy', $notification['slug'], $notification['title'], $notification['message'], $notification['data']);
}
}
backupbuddy_core::replaceNotifications($notifications);
// Save with syncSent updates for all notifications.
return true;
}
示例4: trim_old_notifications
public static function trim_old_notifications()
{
$notifications = backupbuddy_core::getNotifications();
// Load notifications.
$updateNotifications = false;
$maxTimeDiff = pb_backupbuddy::$options['max_notifications_age_days'] * 24 * 60 * 60;
foreach ($notifications as $i => $notification) {
if (time() - $notification['time'] > $maxTimeDiff) {
unset($notifications[$i]);
$updateNotifications = true;
}
}
if (true === $updateNotifications) {
pb_backupbuddy::status('details', 'Periodic cleanup: Replacing notifications.');
backupbuddy_core::replaceNotifications($notifications);
}
}