Feed/Pubsubhubbub/Subscriber/Callback.php

Show: inherited
Table of Contents

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

Package: Zend\Feed\Pubsubhubbub

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

Propertyprotectedarray $_currentSubscriptionData = null

After verification, this is set to the verified subscription's data.

Default valuenullDetails
Type
array
Propertyprotectedstring $_feedUpdate = null

Contains the content of any feeds sent as updates to the Callback URL

Default valuenullDetails
Type
string
Propertyprotected\Zend_Feed_Pubsubhubbub_HttpResponse|\Zend_Controller_Response_Http $_httpResponse = null
inherited

An instance of a class handling Http Responses.

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_httpResponse

This is implemented in Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with (i.e. not inherited from) Zend_Controller_Response_Http.

Default valuenullDetails
Type
\Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http
Inherited_from
\Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_httpResponse  
Propertyprotected\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $_storage = null
inherited

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::$$_storage
Propertyprotectedint $_subscriberCount = 1
inherited

The number of Subscribers for which any updates are on behalf of.

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_subscriberCount
Default value1Details
Type
int
Inherited_from
\Zend_Feed_Pubsubhubbub_CallbackAbstract::$$_subscriberCount  
Propertyprotectedstring $_subscriptionKey = null

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. using a route and the Zend_Controller_Action::_getParam() method.

Default valuenullDetails
Type
string

Methods

methodpublic__construct( $config = null) : void
inherited

Constructor; 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()
Parameters
Name Type Description
$config
methodprotected_detectCallbackUrl() : void
inherited

Attempt to detect the callback URL (specifically the path forward)

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_detectCallbackUrl()
methodprotected_detectVerifyTokenKey(null | array $httpGetData = null) : false | string

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).

Parameters
Name Type Description
$httpGetData null | array
Returns
Type Description
false | string
methodprotected_getHeader(string $header) : void
inherited

Retrieve a Header value from either $_SERVER or Apache

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_getHeader()
Parameters
Name Type Description
$header string
methodprotected_getHttpHost() : string
inherited

Get the HTTP host

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_getHttpHost()
Returns
Type Description
string
methodprotected_getRawBody() : string | false
inherited

Return the raw body of the request

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::_getRawBody()
Returns
Type Description
string | false Raw body, or false if not present
methodprotected_hasValidVerifyToken(array $httpGetData = null, bool $checkValue = true) : bool

Check for a valid verify_token.

By default attempts to compare values with that sent from Hub, otherwise merely ascertains its existence.

Parameters
Name Type Description
$httpGetData array
$checkValue bool
Returns
Type Description
bool
methodprotected_parseQueryString() : array | void

Build an array of Query String parameters.

This bypasses $_GET which munges parameter names and cannot accept multiple parameters with the same key.

Returns
Type Description
array | void
methodpublicgetFeedUpdate() : string

Gets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.

Returns
Type Description
string
methodpublicgetHttpResponse() : \Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http
inherited

An 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.

Returns
Type Description
\Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http
methodpublicgetStorage() : \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface
inherited

Gets 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()
methodpublicgetSubscriberCount() : int
inherited

Gets 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?

Returns
Type Description
int
methodpublichandle(array $httpGetData = null, bool $sendResponseNow = false) : void

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.

Parameters
Name Type Description
$httpGetData array

GET data if available and not in $_GET

$sendResponseNow bool

Whether to send response now or when asked

methodpublichasFeedUpdate() : bool

Check if any newly received feed (Atom/RSS) update was received

Returns
Type Description
bool
methodpublicisValidHubVerification(array $httpGetData) : bool

Checks validity of the request simply by making a quick pass and confirming the presence of all REQUIRED parameters.

Parameters
Name Type Description
$httpGetData array
Returns
Type Description
bool
methodpublicsendResponse() : void
inherited

Send 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!

methodpublicsetConfig( $config) : \Zend_Feed_Pubsubhubbub_CallbackAbstract
inherited

Process any injected configuration options

Inherited from: \Zend_Feed_Pubsubhubbub_CallbackAbstract::setConfig()
Parameters
Name Type Description
$config
Returns
Type Description
\Zend_Feed_Pubsubhubbub_CallbackAbstract
methodpublicsetFeedUpdate(string $feed) : \Zend_Feed_Pubsubhubbub_Subscriber_Callback

Sets a newly received feed (Atom/RSS) sent by a Hub as an update to a Topic we've subscribed to.

Parameters
Name Type Description
$feed string
Returns
Type Description
\Zend_Feed_Pubsubhubbub_Subscriber_Callback
methodpublicsetHttpResponse(\Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http $httpResponse) : \Zend_Feed_Pubsubhubbub_CallbackAbstract
inherited

An 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.

Parameters
Name Type Description
$httpResponse \Zend_Feed_Pubsubhubbub_HttpResponse | \Zend_Controller_Response_Http
Returns
Type Description
\Zend_Feed_Pubsubhubbub_CallbackAbstract
methodpublicsetStorage(\Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage) : \Zend_Feed_Pubsubhubbub_CallbackAbstract
inherited

Sets 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()
Parameters
Name Type Description
$storage \Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface
Returns
Type Description
\Zend_Feed_Pubsubhubbub_CallbackAbstract
methodpublicsetSubscriberCount(string | int $count) : \Zend_Feed_Pubsubhubbub_CallbackAbstract
inherited

Sets 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.

Parameters
Name Type Description
$count string | int
Returns
Type Description
\Zend_Feed_Pubsubhubbub_CallbackAbstract
methodpublicsetSubscriptionKey(string $key) : \Zend_Feed_Pubsubhubbub_Subscriber_Callback

Set a subscription key to use for the current callback request manually.

Required if usePathParameter is enabled for the Subscriber.

Parameters
Name Type Description
$key string
Returns
Type Description
\Zend_Feed_Pubsubhubbub_Subscriber_Callback
Documentation was generated by phpDocumentor 2.0.0a8.