Zend Framework
1.12
|
Public Member Functions | |
__construct ($config=null) | |
Constructor; accepts an array or Zend_Config instance to preset options for the Subscriber without calling all supported setter methods in turn. | |
setConfig ($config) | |
Process any injected configuration options. | |
setTopicUrl ($url) | |
Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate. | |
getTopicUrl () | |
Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate. | |
setLeaseSeconds ($seconds) | |
Set the number of seconds for which any subscription will remain valid. | |
getLeaseSeconds () | |
Get the number of lease seconds on subscriptions. | |
setCallbackUrl ($url) | |
Set the callback URL to be used by Hub Servers when communicating with this Subscriber. | |
getCallbackUrl () | |
Get the callback URL to be used by Hub Servers when communicating with this Subscriber. | |
setPreferredVerificationMode ($mode) | |
Set preferred verification mode (sync or async). | |
getPreferredVerificationMode () | |
Get preferred verification mode (sync or async). | |
addHubUrl ($url) | |
Add a Hub Server URL supported by Publisher. | |
addHubUrls (array $urls) | |
Add an array of Hub Server URLs supported by Publisher. | |
removeHubUrl ($url) | |
Remove a Hub Server URL. | |
getHubUrls () | |
Return an array of unique Hub Server URLs currently available. | |
addAuthentication ($url, array $authentication) | |
Add authentication credentials for a given URL. | |
addAuthentications (array $authentications) | |
Add authentication credentials for hub URLs. | |
getAuthentications () | |
Get all hub URL authentication credentials. | |
usePathParameter ($bool=true) | |
Set flag indicating whether or not to use a path parameter. | |
setParameter ($name, $value=null) | |
Add an optional parameter to the (un)subscribe requests. | |
setParameters (array $parameters) | |
Add an optional parameter to the (un)subscribe requests. | |
removeParameter ($name) | |
Remove an optional parameter for the (un)subscribe requests. | |
getParameters () | |
Return an array of optional parameters for (un)subscribe requests. | |
setStorage (Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage) | |
Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other. | |
getStorage () | |
Gets an instance of Zend_Feed_Pubsubhubbub_Storage_StorageInterface used to background save any verification tokens associated with a subscription or other. | |
subscribeAll () | |
Subscribe to one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed) | |
unsubscribeAll () | |
Unsubscribe from one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed) | |
isSuccess () | |
Returns a boolean indicator of whether the notifications to Hub Servers were ALL successful. | |
getErrors () | |
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. | |
getAsyncHubs () | |
Return an array of Hub Server URLs who returned a response indicating operation in Asynchronous Verification Mode, i.e. | |
setTestStaticToken ($token) | |
Protected Member Functions | |
_doRequest ($mode) | |
Executes an (un)subscribe request. | |
_getHttpClient () | |
Get a basic prepared HTTP client for use. | |
_getRequestParameters ($hubUrl, $mode) | |
Return a list of standard protocol/optional parameters for addition to client's POST body that are specific to the current Hub Server URL. | |
_generateVerifyToken () | |
Simple helper to generate a verification token used in (un)subscribe requests to a Hub Server. | |
_generateSubscriptionKey (array $params, $hubUrl) | |
Simple helper to generate a verification token used in (un)subscribe requests to a Hub Server. | |
_urlEncode (array $params) | |
URL Encode an array of parameters. | |
_toByteValueOrderedString (array $params) | |
Order outgoing parameters. | |
Protected Attributes | |
$_hubUrls = array() | |
$_parameters = array() | |
$_topicUrl = '' | |
$_callbackUrl = '' | |
$_leaseSeconds = null | |
$_preferredVerificationMode = Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC | |
$_errors = array() | |
$_asyncHubs = array() | |
$_storage = null | |
$_authentications = array() | |
$_usePathParameter = false | |
$_testStaticToken = null | |
This is STRICTLY for testing purposes only... | |
__construct | ( | $config = null | ) |
Constructor; accepts an array or Zend_Config instance to preset options for the Subscriber without calling all supported setter methods in turn.
array | Zend_Config | $options | Options array or Zend_Config instance |
|
protected |
Executes an (un)subscribe request.
string | $mode |
At first I thought it was needed, but the backend storage will allow tracking async without any user interference. It's left here in case the user is interested in knowing what Hubs are using async verification modes so they may update Models and move these to asynchronous processes.
|
protected |
Simple helper to generate a verification token used in (un)subscribe requests to a Hub Server.
string | $hubUrl | The Hub Server URL for which this token will apply |
|
protected |
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.
string | $hubUrl | The Hub Server URL for which this token will apply |
|
protected |
Get a basic prepared HTTP client for use.
string | $mode | Must be "subscribe" or "unsubscribe" |
|
protected |
Return a list of standard protocol/optional parameters for addition to client's POST body that are specific to the current Hub Server URL.
string | $hubUrl | |
mode | $hubUrl |
Establish a persistent verify_token and attach key to callback URL's path/querystring
|
protected |
Order outgoing parameters.
array | $params |
|
protected |
URL Encode an array of parameters.
array | $params |
addAuthentication | ( | $url, | |
array | $authentication | ||
) |
Add authentication credentials for a given URL.
string | $url | |
array | $authentication |
addAuthentications | ( | array | $authentications | ) |
Add authentication credentials for hub URLs.
array | $authentications |
addHubUrl | ( | $url | ) |
Add a Hub Server URL supported by Publisher.
string | $url |
addHubUrls | ( | array | $urls | ) |
Add an array of Hub Server URLs supported by Publisher.
array | $urls |
getAsyncHubs | ( | ) |
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)
getAuthentications | ( | ) |
Get all hub URL authentication credentials.
getCallbackUrl | ( | ) |
Get the callback URL to be used by Hub Servers when communicating with this Subscriber.
getErrors | ( | ) |
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.
getHubUrls | ( | ) |
Return an array of unique Hub Server URLs currently available.
getLeaseSeconds | ( | ) |
Get the number of lease seconds on subscriptions.
getParameters | ( | ) |
Return an array of optional parameters for (un)subscribe requests.
getPreferredVerificationMode | ( | ) |
Get preferred verification mode (sync or async).
getStorage | ( | ) |
Gets an instance of Zend_Feed_Pubsubhubbub_Storage_StorageInterface used to background save any verification tokens associated with a subscription or other.
getTopicUrl | ( | ) |
Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate.
isSuccess | ( | ) |
Returns a boolean indicator of whether the notifications to Hub Servers were ALL successful.
If even one failed, FALSE is returned.
removeHubUrl | ( | $url | ) |
removeParameter | ( | $name | ) |
Remove an optional parameter for the (un)subscribe requests.
string | $name |
setCallbackUrl | ( | $url | ) |
Set the callback URL to be used by Hub Servers when communicating with this Subscriber.
string | $url |
setConfig | ( | $config | ) |
Process any injected configuration options.
array | Zend_Config | $options | Options array or Zend_Config instance |
setLeaseSeconds | ( | $seconds | ) |
Set the number of seconds for which any subscription will remain valid.
int | $seconds |
setParameter | ( | $name, | |
$value = null |
|||
) |
Add an optional parameter to the (un)subscribe requests.
string | $name | |
string | null | $value |
setParameters | ( | array | $parameters | ) |
Add an optional parameter to the (un)subscribe requests.
string | $name | |
string | null | $value |
setPreferredVerificationMode | ( | $mode | ) |
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.
Zend_Feed_Pubsubhubbub_Subscriber will always send both modes, whose order of occurance in the parameter list determines this preference.
string | $mode | Should be 'sync' or 'async' |
setStorage | ( | Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface | $storage | ) |
Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other.
Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface | $storage |
|
final |
setTopicUrl | ( | $url | ) |
Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe event will relate.
string | $url |
subscribeAll | ( | ) |
Subscribe to one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed)
unsubscribeAll | ( | ) |
Unsubscribe from one or more Hub Servers using the stored Hub URLs for the given Topic URL (RSS or Atom feed)
usePathParameter | ( | $bool = true | ) |
Set flag indicating whether or not to use a path parameter.
bool | $bool |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
This is STRICTLY for testing purposes only...
|
protected |
|
protected |