Zend Framework
1.12
|
Public Member Functions | |
setSubscriptionKey ($key) | |
Set a subscription key to use for the current callback request manually. | |
handle (array $httpGetData=null, $sendResponseNow=false) | |
Handle any callback from a Hub Server responding to a subscription or unsubscription request. | |
isValidHubVerification (array $httpGetData) | |
Checks validity of the request simply by making a quick pass and confirming the presence of all REQUIRED parameters. | |
setFeedUpdate ($feed) | |
Sets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to. | |
hasFeedUpdate () | |
Check if any newly received feed (Atom/RSS) update was received. | |
getFeedUpdate () | |
Gets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to. | |
![]() | |
__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. | |
sendResponse () | |
Send the response, including all headers. | |
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_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other. | |
setHttpResponse ($httpResponse) | |
An instance of a class handling Http Responses. | |
getHttpResponse () | |
An instance of a class handling Http Responses. | |
setSubscriberCount ($count) | |
Sets the number of Subscribers for which any updates are on behalf of. | |
getSubscriberCount () | |
Gets the number of Subscribers for which any updates are on behalf of. | |
Protected Member Functions | |
_hasValidVerifyToken (array $httpGetData=null, $checkValue=true) | |
Check for a valid verify_token. | |
_detectVerifyTokenKey (array $httpGetData=null) | |
Attempt to detect the verification token key. | |
_parseQueryString () | |
Build an array of Query String parameters. | |
![]() | |
_detectCallbackUrl () | |
Attempt to detect the callback URL (specifically the path forward) | |
_getHttpHost () | |
Get the HTTP host. | |
_getHeader ($header) | |
Retrieve a Header value from either $_SERVER or Apache. | |
_getRawBody () | |
Return the raw body of the request. | |
Protected Attributes | |
$_feedUpdate = null | |
$_subscriptionKey = null | |
$_currentSubscriptionData = null | |
![]() | |
$_storage = null | |
$_httpResponse = null | |
$_subscriberCount = 1 | |
|
protected |
Attempt to detect the verification token key.
This would be passed in the Callback URL (which we are handling with this class!) as a URI path part (the last part by convention).
null | array | $httpGetData |
Available when sub keys encoding in Callback URL path
Available only if allowed by PuSH 0.2 Hubs
Available (possibly) if corrupted in transit and not part of $_GET
|
protected |
Check for a valid verify_token.
By default attempts to compare values with that sent from Hub, otherwise merely ascertains its existence.
array | $httpGetData | |
bool | $checkValue |
|
protected |
Build an array of Query String parameters.
This bypasses $_GET which munges parameter names and cannot accept multiple parameters with the same key.
getFeedUpdate | ( | ) |
Gets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.
handle | ( | array | $httpGetData = null , |
$sendResponseNow = false |
|||
) |
Handle any callback from a Hub Server responding to a subscription or unsubscription request.
This should be the Hub Server confirming the the request prior to taking action on it.
array | $httpGetData | GET data if available and not in $_GET |
bool | $sendResponseNow | Whether to send response now or when asked |
Handle any feed updates (sorry for the mess :P)
This DOES NOT attempt to process a feed update. Feed updates SHOULD be validated/processed by an asynchronous process so as to avoid holding up responses to the Hub.
Handle any (un)subscribe confirmation requests
Hey, C'mon! We tried everything else!
Implements Zend_Feed_Pubsubhubbub_CallbackInterface.
hasFeedUpdate | ( | ) |
Check if any newly received feed (Atom/RSS) update was received.
isValidHubVerification | ( | array | $httpGetData | ) |
Checks validity of the request simply by making a quick pass and confirming the presence of all REQUIRED parameters.
array | $httpGetData |
As per the specification, the hub.verify_token is OPTIONAL. This implementation of Pubsubhubbub considers it REQUIRED and will always send a hub.verify_token parameter to be echoed back by the Hub Server. Therefore, its absence is considered invalid.
Attempt to retrieve any Verification Token Key attached to Callback URL's path by our Subscriber implementation
setFeedUpdate | ( | $feed | ) |
Sets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.
string | $feed |
setSubscriptionKey | ( | $key | ) |
Set a subscription key to use for the current callback request manually.
Required if usePathParameter is enabled for the Subscriber.
string | $key |
|
protected |
|
protected |
|
protected |