public function isEnabled() { $servers = PhabricatorNotificationServerRef::getEnabledAdminServers(); if (!$servers) { return false; } return PhabricatorApplication::isClassInstalled('PhabricatorNotificationsApplication'); }
public static function tryToPostMessage(array $data) { $servers = PhabricatorNotificationServerRef::getEnabledAdminServers(); shuffle($servers); foreach ($servers as $server) { try { $server->postMessage($data); return; } catch (Exception $ex) { // Just ignore any issues here. } } }