Zend\Feed\PubSubHubbub\Subscriber\Callback
Synopsis
class Callback
extends AbstractCallback
{
- // members
- protected string $feedUpdate;
- protected string $subscriptionKey;
- protected array $currentSubscriptionData;
- // Inherited members from AbstractCallback
- protected SubscriptionPersistenceInterface $storage;
- protected HttpResponse|PhpResponse $httpResponse;
- protected integer $subscriberCount;
- // methods
- public Callback setSubscriptionKey()
- public void handle()
- public bool isValidHubVerification()
- public Callback setFeedUpdate()
- public bool hasFeedUpdate()
- public string getFeedUpdate()
- protected bool _hasValidVerifyToken()
- protected false|string _detectVerifyTokenKey()
- protected array|void _parseQueryString()
- // Inherited methods from AbstractCallback
- public void __construct()
- public AbstractCallback setOptions()
- public void sendResponse()
- public AbstractCallback setStorage()
- public SubscriptionPersistenceInterface getStorage()
- public AbstractCallback setHttpResponse()
- public HttpResponse|PhpResponse getHttpResponse()
- public AbstractCallback setSubscriberCount()
- public int getSubscriberCount()
- protected string _detectCallbackUrl()
- protected string _getHttpHost()
- protected bool|string _getHeader()
- protected string|false _getRawBody()
Hierarchy
Members
protected
- $currentSubscriptionData
—
array
After verification, this is set to the verified subscription's data. - $feedUpdate
—
string
Contains the content of any feeds sent as updates to the Callback URL - $httpResponse
—
Zend\Feed\PubSubHubbub\HttpResponse|PhpResponse
An instance of a class handling Http Responses. This is implemented in Zend\Feed\Pubsubhubbub\HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend\Controller\Response\Http. - $storage
—
Zend\Feed\PubSubHubbub\Model\SubscriptionPersistenceInterface
An instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistenceInterface used to background save any verification tokens associated with a subscription or other. - $subscriberCount
—
int
The number of Subscribers for which any updates are on behalf of. - $subscriptionKey
—
string
Holds a manually set subscription key (i.e. identifies a unique subscription) which is typical when it is not passed in the query string but is part of the Callback URL path, requiring manual retrieval e.g.
Methods
protected
- _detectVerifyTokenKey() — 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).
- _hasValidVerifyToken() — Check for a valid verify_token. By default attempts to compare values with that sent from Hub, otherwise merely ascertains its existence.
- _parseQueryString() — Build an array of Query String parameters.
public
- getFeedUpdate() — Gets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.
- handle() — 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.
- hasFeedUpdate() — Check if any newly received feed (Atom/RSS) update was received
- isValidHubVerification() — Checks validity of the request simply by making a quick pass and confirming the presence of all REQUIRED parameters.
- setFeedUpdate() — Sets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.
- setSubscriptionKey() — Set a subscription key to use for the current callback request manually.
Inherited from Zend\Feed\PubSubHubbub\AbstractCallback
protected
- _detectCallbackUrl() — Attempt to detect the callback URL (specifically the path forward)
- _getHeader() — Retrieve a Header value from either $_SERVER or Apache
- _getHttpHost() — Get the HTTP host
- _getRawBody() — Return the raw body of the request
public
- getHttpResponse() — An instance of a class handling Http Responses. This is implemented in Zend\Feed\Pubsubhubbub\HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend\Controller\Response\Http.
- getStorage() — Gets an instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence used to background save any verification tokens associated with a subscription or other.
- getSubscriberCount() — Gets the number of Subscribers for which any updates are on behalf of.
- sendResponse() — Send the response, including all headers.
- setHttpResponse() — An instance of a class handling Http Responses. This is implemented in Zend\Feed\Pubsubhubbub\HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend\Controller\Response\Http.
- setOptions() — Process any injected configuration options
- setStorage() — Sets an instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence used to background save any verification tokens associated with a subscription or other.
- setSubscriberCount() — Sets the number of Subscribers for which any updates are on behalf of.