本文整理匯總了PHP中backupbuddy_core::getNotifications方法的典型用法代碼示例。如果您正苦於以下問題:PHP backupbuddy_core::getNotifications方法的具體用法?PHP backupbuddy_core::getNotifications怎麽用?PHP backupbuddy_core::getNotifications使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backupbuddy_core
的用法示例。
在下文中一共展示了backupbuddy_core::getNotifications方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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.
示例2: _test_recent_sync_notifications
private static function _test_recent_sync_notifications()
{
$notifications = backupbuddy_core::getNotifications();
// Remove non-Stash Live notifications.
foreach ($notifications as $key => $notification) {
if ('live_error' != $notification['slug']) {
unset($notifications[$key]);
continue;
}
}
if (count($notifications) > 0) {
self::$_results['highlights'][] = '`' . count($notifications) . '` recent Stash Live Sync error notifications.';
}
// Limit to X number of most recent notifications.
self::$_results['recent_sync_notifications'] = array_slice($notifications, -1 * self::$_settings['max_notifications'], self::$_settings['max_notifications'], $preserve_key = false);
}
示例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;
// 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;
}
示例4: 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;
}
示例5: 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);
}
}