You are here

public static function PuSHSubscriber::instance in Feeds 6

Same name and namespace in other branches
  1. 7.2 libraries/PuSHSubscriber.inc \PuSHSubscriber::instance()
  2. 7 libraries/PuSHSubscriber.inc \PuSHSubscriber::instance()

Singleton.

PuSHSubscriber identifies a unique subscription by a domain and a numeric id. The numeric id is assumed to e unique in its domain.

Parameters

$domain: A string that identifies the domain in which $subscriber_id is unique.

$subscriber_id: A numeric subscriber id.

$subscription_class: The class to use for handling subscriptions. Class MUST implement PuSHSubscriberSubscriptionInterface

PuSHSubscriberEnvironmentInterface $env: Environmental object for messaging and logging.

File

libraries/PuSHSubscriber.inc, line 39
Pubsubhubbub subscriber library.

Class

PuSHSubscriber
PubSubHubbub subscriber.

Code

public static function instance($domain, $subscriber_id, $subscription_class, PuSHSubscriberEnvironmentInterface $env) {
  static $subscribers;
  if (!isset($subscriber[$domain][$subscriber_id])) {
    $subscriber = new PuSHSubscriber($domain, $subscriber_id, $subscription_class, $env);
  }
  return $subscriber;
}