Feed/Pubsubhubbub/Subscriber.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Feed_Pubsubhubbub
- Version
- $Id$
\Zend_Feed_Pubsubhubbub_Subscriber
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
array $_asyncHubs = array()
array()
Details- Type
- array
array $_authentications = array()
array()
Details- Type
- array
string $_callbackUrl = ''
''
Details- Type
- string
array $_errors = array()
array()
Details- Type
- array
array $_hubUrls = array()
array()
Details- Type
- array
int $_leaseSeconds = null
null
Details- Type
- int
array $_parameters = array()
array()
Details- Type
- array
string $_preferredVerificationMode = \Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC
\Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC
Details- Type
- string
\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $_storage = null
null
Details$_testStaticToken = null
null
Details- Type
- n/a
string $_topicUrl = ''
''
Details- Type
- string
string $_usePathParameter = false
false
Details- Type
- string
Methods
__construct( $config = null) : void
Constructor; accepts an array or Zend_Config instance to preset options for the Subscriber without calling all supported setter methods in turn.
Name | Type | Description |
---|---|---|
$config |
_doRequest(string $mode) : void
Executes an (un)subscribe request
Name | Type | Description |
---|---|---|
$mode | string |
_generateSubscriptionKey( $params, string $hubUrl) : string
Simple helper to generate a verification token used in (un)subscribe requests to a Hub Server.
Name | Type | Description |
---|---|---|
$params | ||
$hubUrl | string | The Hub Server URL for which this token will apply |
Type | Description |
---|---|
string |
_generateVerifyToken() : 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.
Type | Description |
---|---|
string |
_getHttpClient() : \Zend_Http_Client
Get a basic prepared HTTP client for use
Type | Description |
---|---|
\Zend_Http_Client |
_getRequestParameters(string | \mode $hubUrl, $mode) : string
Return a list of standard protocol/optional parameters for addition to client's POST body that are specific to the current Hub Server URL
Name | Type | Description |
---|---|---|
$hubUrl | string | \mode | |
$mode |
Type | Description |
---|---|
string |
_toByteValueOrderedString(array $params) : array
Order outgoing parameters
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |
_urlEncode(array $params) : array
URL Encode an array of parameters
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
array |
addAuthentication(string $url, array $authentication) : \Zend_Feed_Pubsubhubbub_Subscriber
Add authentication credentials for a given URL
Name | Type | Description |
---|---|---|
$url | string | |
$authentication | array |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
addAuthentications(array $authentications) : \Zend_Feed_Pubsubhubbub_Subscriber
Add authentication credentials for hub URLs
Name | Type | Description |
---|---|---|
$authentications | array |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
addHubUrl(string $url) : \Zend_Feed_Pubsubhubbub_Subscriber
Add a Hub Server URL supported by Publisher
Name | Type | Description |
---|---|---|
$url | string |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
addHubUrls(array $urls) : \Zend_Feed_Pubsubhubbub_Subscriber
Add an array of Hub Server URLs supported by Publisher
Name | Type | Description |
---|---|---|
$urls | array |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
getAsyncHubs() : array
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)
Type | Description |
---|---|
array |
getCallbackUrl() : string
Get the callback URL to be used by Hub Servers when communicating with this Subscriber
Type | Description |
---|---|
string |
getErrors() : array
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
Type | Description |
---|---|
array |
getHubUrls() : array
Return an array of unique Hub Server URLs currently available
Type | Description |
---|---|
array |
getParameters() : array
Return an array of optional parameters for (un)subscribe requests
Type | Description |
---|---|
array |
getPreferredVerificationMode() : string
Get preferred verification mode (sync or async).
Type | Description |
---|---|
string |
getStorage() : \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface
Gets an instance of Zend_Feed_Pubsubhubbub_Storage_StorageInterface used to background save any verification tokens associated with a subscription or other.
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface |
getTopicUrl() : string
Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate
Type | Description |
---|---|
string |
isSuccess() : bool
Returns a boolean indicator of whether the notifications to Hub Servers were ALL successful. If even one failed, FALSE is returned.
Type | Description |
---|---|
bool |
removeHubUrl(string $url) : \Zend_Feed_Pubsubhubbub_Subscriber
Remove a Hub Server URL
Name | Type | Description |
---|---|---|
$url | string |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
removeParameter(string $name) : \Zend_Feed_Pubsubhubbub_Subscriber
Remove an optional parameter for the (un)subscribe requests
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setCallbackUrl(string $url) : \Zend_Feed_Pubsubhubbub_Subscriber
Set the callback URL to be used by Hub Servers when communicating with this Subscriber
Name | Type | Description |
---|---|---|
$url | string |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setConfig( $config) : \Zend_Feed_Pubsubhubbub_Subscriber
Process any injected configuration options
Name | Type | Description |
---|---|---|
$config |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setLeaseSeconds(int $seconds) : \Zend_Feed_Pubsubhubbub_Subscriber
Set the number of seconds for which any subscription will remain valid
Name | Type | Description |
---|---|---|
$seconds | int |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setParameter(string $name, string | null $value = null) : \Zend_Feed_Pubsubhubbub_Subscriber
Add an optional parameter to the (un)subscribe requests
Name | Type | Description |
---|---|---|
$name | string | |
$value | string | null |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setParameters( $parameters) : \Zend_Feed_Pubsubhubbub_Subscriber
Add an optional parameter to the (un)subscribe requests
Name | Type | Description |
---|---|---|
$parameters |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setPreferredVerificationMode(string $mode) : \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.
Name | Type | Description |
---|---|---|
$mode | string | Should be 'sync' or 'async' |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setStorage(\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage) : \Zend_Feed_Pubsubhubbub_Subscriber
Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other.
Name | Type | Description |
---|---|---|
$storage | \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
setTopicUrl(string $url) : \Zend_Feed_Pubsubhubbub_Subscriber
Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate
Name | Type | Description |
---|---|---|
$url | string |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |
subscribeAll() : void
Subscribe to one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed)
unsubscribeAll() : void
Unsubscribe from one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed)
usePathParameter(bool $bool = true) : \Zend_Feed_Pubsubhubbub_Subscriber
Set flag indicating whether or not to use a path parameter
Name | Type | Description |
---|---|---|
$bool | bool |
Type | Description |
---|---|
\Zend_Feed_Pubsubhubbub_Subscriber |