Feed/Pubsubhubbub/Subscriber/Callback.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Feed_Pubsubhubbub
- Version
- $Id: Callback.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Feed_Pubsubhubbub_Subscriber_Callback
- Parent(s)
- \Zend_Feed_Pubsubhubbub_CallbackAbstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

array $_currentSubscriptionData = nullAfter verification, this is set to the verified subscription's data.
nullDetails- Type
- array

string $_feedUpdate = nullContains the content of any feeds sent as updates to the Callback URL
nullDetails- Type
- string

\Zend_Feed_Pubsubhubbub_HttpResponse|\Zend_Controller_Response_Http $_httpResponse = nullAn instance of a class handling Http Responses.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_httpResponseThis is implemented in Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend_Controller_Response_Http.
nullDetails

\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $_storage = nullAn instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_storagenullDetails

int $_subscriberCount = 1The number of Subscribers for which any updates are on behalf of.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_subscriberCount1Details- Type
- int
- Inherited_from
- \Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_subscriberCount

string $_subscriptionKey = nullHolds 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. using a route and the Zend_Controller_Action::_getParam() method.
nullDetails- Type
- string
Methods

__construct( $config = null) : voidConstructor; accepts an array or Zend_Config instance to preset options for the Subscriber without calling all supported setter methods in turn.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::__construct()| Name | Type | Description |
|---|---|---|
| $config |

_detectCallbackUrl() : voidAttempt to detect the callback URL (specifically the path forward)
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_detectCallbackUrl()
_detectVerifyTokenKey(null | array $httpGetData = null) : false | stringAttempt 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).
| Name | Type | Description |
|---|---|---|
| $httpGetData | null | array |
| Type | Description |
|---|---|
| false | string |

_getHeader(string $header) : voidRetrieve a Header value from either $_SERVER or Apache
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_getHeader()| Name | Type | Description |
|---|---|---|
| $header | string |

_getRawBody() : string | falseReturn the raw body of the request
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_getRawBody()| Type | Description |
|---|---|
| string | false | Raw body, or false if not present |

_hasValidVerifyToken(array $httpGetData = null, bool $checkValue = true) : boolCheck for a valid verify_token.
By default attempts to compare values with that sent from Hub, otherwise merely ascertains its existence.
| Name | Type | Description |
|---|---|---|
| $httpGetData | array | |
| $checkValue | bool |
| Type | Description |
|---|---|
| bool |

_parseQueryString() : array | voidBuild an array of Query String parameters.
This bypasses $_GET which munges parameter names and cannot accept multiple parameters with the same key.
| Type | Description |
|---|---|
| array | void |

getFeedUpdate() : stringGets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.
| Type | Description |
|---|---|
| string |

getHttpResponse() : \Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_HttpAn instance of a class handling Http Responses.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::getHttpResponse()This is implemented in Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend_Controller_Response_Http.
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http |

getStorage() : \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterfaceGets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::getStorage()| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface |

getSubscriberCount() : intGets the number of Subscribers for which any updates are on behalf of.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::getSubscriberCount()In other words, is this class serving one or more subscribers? How many?
| Type | Description |
|---|---|
| int |

handle(array $httpGetData = null, bool $sendResponseNow = false) : voidHandle 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.
| Name | Type | Description |
|---|---|---|
| $httpGetData | array | GET data if available and not in $_GET |
| $sendResponseNow | bool | Whether to send response now or when asked |

hasFeedUpdate() : boolCheck if any newly received feed (Atom/RSS) update was received
| Type | Description |
|---|---|
| bool |

isValidHubVerification(array $httpGetData) : boolChecks validity of the request simply by making a quick pass and confirming the presence of all REQUIRED parameters.
| Name | Type | Description |
|---|---|---|
| $httpGetData | array |
| Type | Description |
|---|---|
| bool |

sendResponse() : voidSend the response, including all headers.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::sendResponse()If you wish to handle this via Zend_Controller, use the getter methods to retrieve any data needed to be set on your HTTP Response object, or simply give this object the HTTP Response instance to work with for you!

setConfig( $config) : \Zend_Feed_Pubsubhubbub_CallbackAbstractProcess any injected configuration options
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::setConfig()| Name | Type | Description |
|---|---|---|
| $config |
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_CallbackAbstract |

setFeedUpdate(string $feed) : \Zend_Feed_Pubsubhubbub_Subscriber_CallbackSets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.
| Name | Type | Description |
|---|---|---|
| $feed | string |
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_Subscriber_Callback |

setHttpResponse(\Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http $httpResponse) : \Zend_Feed_Pubsubhubbub_CallbackAbstractAn instance of a class handling Http Responses.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::setHttpResponse()This is implemented in Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend_Controller_Response_Http.
| Name | Type | Description |
|---|---|---|
| $httpResponse | \Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http |
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_CallbackAbstract |

setStorage(\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage) : \Zend_Feed_Pubsubhubbub_CallbackAbstractSets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background save any verification tokens associated with a subscription or other.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::setStorage()| Name | Type | Description |
|---|---|---|
| $storage | \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface |
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_CallbackAbstract |

setSubscriberCount(string | int $count) : \Zend_Feed_Pubsubhubbub_CallbackAbstractSets the number of Subscribers for which any updates are on behalf of.
Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::setSubscriberCount()In other words, is this class serving one or more subscribers? How many? Defaults to 1 if left unchanged.
| Name | Type | Description |
|---|---|---|
| $count | string | int |
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_CallbackAbstract |

setSubscriptionKey(string $key) : \Zend_Feed_Pubsubhubbub_Subscriber_CallbackSet a subscription key to use for the current callback request manually.
Required if usePathParameter is enabled for the Subscriber.
| Name | Type | Description |
|---|---|---|
| $key | string |
| Type | Description |
|---|---|
| \Zend_Feed_Pubsubhubbub_Subscriber_Callback |