package Default

 Methods

Constructor; accepts an array or Traversable instance to preset options for the Subscriber without calling all supported setter methods in turn.

__construct(array|\Traversable $options = null

Parameters

$options

array\Traversable

Add authentication credentials for a given URL

addAuthentication(string $url, array $authentication) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$url

string

$authentication

array

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Add authentication credentials for hub URLs

addAuthentications(array $authentications) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$authentications

array

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Add a Hub Server URL supported by Publisher

addHubUrl(string $url) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$url

string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Add an array of Hub Server URLs supported by Publisher

addHubUrls(array $urls) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$urls

array

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Return an array of Hub Server URLs who returned a response indicating operation in Asynchronous Verification Mode, i.e. they will not confirm any (un)subscription immediately but at a later time (Hubs may be doing this as a batch process when load balancing)

getAsyncHubs() : array

Returns

array

Get all hub URL authentication credentials

getAuthentications() : array

Returns

array

Get the callback URL to be used by Hub Servers when communicating with this Subscriber

getCallbackUrl() : string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\RuntimeException

Returns

string

Return an array of errors met from any failures, including keys: 'response' => the Zend\Http\Response object from the failure 'hubUrl' => the URL of the Hub Server whose notification failed

getErrors() : array

Returns

array

Return an array of unique Hub Server URLs currently available

getHubUrls() : array

Returns

array

Get the number of lease seconds on subscriptions

getLeaseSeconds() : integer

Returns

integer

Return an array of optional parameters for (un)subscribe requests

getParameters() : array

Returns

array

Get preferred verification mode (sync or async).

getPreferredVerificationMode() : string

Returns

string

Gets an instance of Zend\Feed\Pubsubhubbub\Storage\StoragePersistence used to background save any verification tokens associated with a subscription or other.

getStorage() : \Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface

Exceptions

\Zend\Feed\PubSubHubbub\Exception\RuntimeException

Returns

\Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface

Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate

getTopicUrl() : string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\RuntimeException

Returns

string

Returns a boolean indicator of whether the notifications to Hub Servers were ALL successful. If even one failed, FALSE is returned.

isSuccess() : boolean

Returns

boolean

Remove a Hub Server URL

removeHubUrl(string $url) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$url

string

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Remove an optional parameter for the (un)subscribe requests

removeParameter(string $name) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$name

string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Set the callback URL to be used by Hub Servers when communicating with this Subscriber

setCallbackUrl(string $url) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$url

string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Set the number of seconds for which any subscription will remain valid

setLeaseSeconds(integer $seconds) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$seconds

integer

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Process any injected configuration options

setOptions(array|\Traversable $options) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$options

array\Traversable

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Add an optional parameter to the (un)subscribe requests

setParameter(string $name, string|null $value = null) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$name

string

$value

stringnull

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Add an optional parameter to the (un)subscribe requests

setParameters(array $parameters) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$parameters

array

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Set preferred verification mode (sync or async). By default, this Subscriber prefers synchronous verification, but does support asynchronous if that's the Hub Server's utilised mode.

setPreferredVerificationMode(string $mode) : \Zend\Feed\PubSubHubbub\Subscriber

Zend\Feed\Pubsubhubbub\Subscriber will always send both modes, whose order of occurrence in the parameter list determines this preference.

Parameters

$mode

string

Should be 'sync' or 'async'

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Sets an instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence used to background save any verification tokens associated with a subscription or other.

setStorage(\Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface $storage) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$storage

\Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface

Returns

\Zend\Feed\PubSubHubbub\Subscriber

setTestStaticToken()

setTestStaticToken($token) 

Parameters

$token

Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate

setTopicUrl(string $url) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$url

string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Subscribe to one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed)

subscribeAll() : void

Unsubscribe from one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed)

unsubscribeAll() : void

Set flag indicating whether or not to use a path parameter

usePathParameter(boolean $bool = true) : \Zend\Feed\PubSubHubbub\Subscriber

Parameters

$bool

boolean

Returns

\Zend\Feed\PubSubHubbub\Subscriber

Executes an (un)subscribe request

_doRequest(string $mode) : void

Parameters

$mode

string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\RuntimeException

Simple helper to generate a verification token used in (un)subscribe requests to a Hub Server.

_generateSubscriptionKey(array $params, string $hubUrl) : string

Parameters

$params

array

$hubUrl

string

The Hub Server URL for which this token will apply

Returns

string

Simple helper to generate a verification token used in (un)subscribe requests to a Hub Server. Follows no particular method, which means it might be improved/changed in future.

_generateVerifyToken() : string

Returns

string

Get a basic prepared HTTP client for use

_getHttpClient() : \Zend\Http\Client

Returns

\Zend\Http\Client

Return a list of standard protocol/optional parameters for addition to client's POST body that are specific to the current Hub Server URL

_getRequestParameters(string $hubUrl, string $mode) : string

Parameters

$hubUrl

string

$mode

string

Exceptions

\Zend\Feed\PubSubHubbub\Exception\InvalidArgumentException

Returns

string

Order outgoing parameters

_toByteValueOrderedString(array $params) : array

Parameters

$params

array

Returns

array

URL Encode an array of parameters

_urlEncode(array $params) : array

Parameters

$params

array

Returns

array

 Properties

 

An array of Hub Server URLs for Hubs operating at this time in asynchronous verification mode.

$asyncHubs : array

Default

array()
 

An array of authentication credentials for HTTP Basic Authentication if required by specific Hubs. The array is indexed by Hub Endpoint URI and the value is a simple array of the username and password to apply.

$authentications : array

Default

array()
 

The URL Hub Servers must use when communicating with this Subscriber

$callbackUrl : string

Default

''
 

An array of any errors including keys for 'response', 'hubUrl'.

$errors : array

Default

array()

The response is the actual Zend\Http\Response object.

 

An array of URLs for all Hub Servers to subscribe/unsubscribe.

$hubUrls : array

Default

array()
 

The number of seconds for which the subscriber would like to have the subscription active. Defaults to null, i.e. not sent, to setup a permanent subscription if possible.

$leaseSeconds : integer

Default

null
 

An array of optional parameters to be included in any (un)subscribe requests.

$parameters : array

Default

array()
 

The preferred verification mode (sync or async). By default, this Subscriber prefers synchronous verification, but is considered desirable to support asynchronous verification if possible.

$preferredVerificationMode : string

Default

\Zend\Feed\PubSubHubbub\PubSubHubbub::VERIFICATION_MODE_SYNC

Zend\Feed\Pubsubhubbub\Subscriber will always send both modes, whose order of occurrence in the parameter list determines this preference.

 

An instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence used to background save any verification tokens associated with a subscription or other.

$storage : \Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface

Default

null
 

This is STRICTLY for testing purposes only.

$testStaticToken 

Default

null

..

 

The URL of the topic (Rss or Atom feed) which is the subject of our current intent to subscribe to/unsubscribe from updates from the currently configured Hub Servers.

$topicUrl : string

Default

''
 

Tells the Subscriber to append any subscription identifier to the path of the base Callback URL. E.g. an identifier "subkey1" would be added to the callback URL "http://www.example.com/callback" to create a subscription specific Callback URL of "http://www.example.com/callback/subkey1".

$usePathParameter : string

Default

false

This is required for all Hubs using the Pubsubhubbub 0.1 Specification. It should be manually intercepted and passed to the Callback class using Zend\Feed\Pubsubhubbub\Subscriber\Callback::setSubscriptionKey(). Will require a route in the form "callback/:subkey" to allow the parameter be retrieved from an action using the Zend\Controller\Action::\getParam() method.