public function getUpdateCounts()
 {
     global $wgUser;
     $wne = new WallNotificationsEveryone();
     $wne->processQueue($wgUser->getId());
     $wn = new WallNotifications();
     $this->getUpdateCountsInternal($wn);
     return true;
 }
Пример #2
0
<?php

/**
 * Maintenance script to clear the notification tables:
 *    - remove old notifications from database and user's cache (older that \WallHelper::$NOTIFICATION_EXPIRE_DAYS days)
 *    - remove queued notifications older than \WallHelper::$NOTIFICATION_EXPIRE_DAYS days
 *    - remove processed notifications older than \WallHelper::$NOTIFICATION_EXPIRE_DAYS days
 *
 * @author Evgeniy
 */
const RESULT_OK = 0;
const RESULT_READ_ONLY = 1;
ini_set('include_path', dirname(__FILE__) . '/../../../../maintenance/');
require_once 'commandLine.inc';
if (isset($options['help'])) {
    die("Usage: php maintenance.php [--only-cache] [--help]\n\t--only-cache\t\tclear users' cache only\n\t--help\t\t\tthis message\n\n");
}
if (wfReadOnly()) {
    echo 'Error: In read only mode.';
    exit(RESULT_READ_ONLY);
}
$onlyCache = isset($options['only-cache']);
$wallNotification = new WallNotificationsEveryone();
$wallNotification->clearQueue($onlyCache);
exit(RESULT_OK);
Пример #3
0
 public function notifyEveryone()
 {
     $rev = $this->getArticleComment()->mLastRevision;
     if (empty($rev)) {
         return true;
     }
     $notif = WallNotificationEntity::createFromRev($rev);
     /*
      * experimental notfieverone
      */
     $wne = new WallNotificationsEveryone();
     $wne->addNotificationToQueue($notif);
 }