diff options
Diffstat (limited to '3rdparty/ZendFeed/PubSubHubbub')
14 files changed, 2542 insertions, 0 deletions
diff --git a/3rdparty/ZendFeed/PubSubHubbub/AbstractCallback.php b/3rdparty/ZendFeed/PubSubHubbub/AbstractCallback.php new file mode 100644 index 000000000..7645cb905 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/AbstractCallback.php @@ -0,0 +1,291 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub; + +use Traversable; +use Zend\Http\PhpEnvironment\Response as PhpResponse; +use Zend\Stdlib\ArrayUtils; + +abstract class AbstractCallback implements CallbackInterface +{ + /** + * An instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistenceInterface + * used to background save any verification tokens associated with a subscription + * or other. + * + * @var Model\SubscriptionPersistenceInterface + */ + protected $storage = null; + + /** + * 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. + * + * @var HttpResponse|PhpResponse + */ + protected $httpResponse = null; + + /** + * The number of Subscribers for which any updates are on behalf of. + * + * @var int + */ + protected $subscriberCount = 1; + + /** + * Constructor; accepts an array or Traversable object to preset + * options for the Subscriber without calling all supported setter + * methods in turn. + * + * @param array|Traversable $options Options array or Traversable object + */ + public function __construct($options = null) + { + if ($options !== null) { + $this->setOptions($options); + } + } + + /** + * Process any injected configuration options + * + * @param array|Traversable $options Options array or Traversable object + * @return AbstractCallback + * @throws Exception\InvalidArgumentException + */ + public function setOptions($options) + { + if ($options instanceof Traversable) { + $options = ArrayUtils::iteratorToArray($options); + } + + if (!is_array($options)) { + throw new Exception\InvalidArgumentException('Array or Traversable object' + . 'expected, got ' . gettype($options)); + } + + if (is_array($options)) { + $this->setOptions($options); + } + + if (array_key_exists('storage', $options)) { + $this->setStorage($options['storage']); + } + return $this; + } + + /** + * Send the response, including all headers. + * If you wish to handle this via Zend\Http, 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! + * + * @return void + */ + public function sendResponse() + { + $this->getHttpResponse()->send(); + } + + /** + * Sets an instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence used + * to background save any verification tokens associated with a subscription + * or other. + * + * @param Model\SubscriptionPersistenceInterface $storage + * @return AbstractCallback + */ + public function setStorage(Model\SubscriptionPersistenceInterface $storage) + { + $this->storage = $storage; + return $this; + } + + /** + * Gets an instance of Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence used + * to background save any verification tokens associated with a subscription + * or other. + * + * @return Model\SubscriptionPersistenceInterface + * @throws Exception\RuntimeException + */ + public function getStorage() + { + if ($this->storage === null) { + throw new Exception\RuntimeException('No storage object has been' + . ' set that subclasses Zend\Feed\Pubsubhubbub\Model\SubscriptionPersistence'); + } + return $this->storage; + } + + /** + * 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. + * + * @param HttpResponse|PhpResponse $httpResponse + * @return AbstractCallback + * @throws Exception\InvalidArgumentException + */ + public function setHttpResponse($httpResponse) + { + if (!$httpResponse instanceof HttpResponse && !$httpResponse instanceof PhpResponse) { + throw new Exception\InvalidArgumentException('HTTP Response object must' + . ' implement one of Zend\Feed\Pubsubhubbub\HttpResponse or' + . ' Zend\Http\PhpEnvironment\Response'); + } + $this->httpResponse = $httpResponse; + return $this; + } + + /** + * 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. + * + * @return HttpResponse|PhpResponse + */ + public function getHttpResponse() + { + if ($this->httpResponse === null) { + $this->httpResponse = new HttpResponse; + } + return $this->httpResponse; + } + + /** + * Sets the number of Subscribers for which any updates are on behalf of. + * In other words, is this class serving one or more subscribers? How many? + * Defaults to 1 if left unchanged. + * + * @param string|int $count + * @return AbstractCallback + * @throws Exception\InvalidArgumentException + */ + public function setSubscriberCount($count) + { + $count = intval($count); + if ($count <= 0) { + throw new Exception\InvalidArgumentException('Subscriber count must be' + . ' greater than zero'); + } + $this->subscriberCount = $count; + return $this; + } + + /** + * Gets the number of Subscribers for which any updates are on behalf of. + * In other words, is this class serving one or more subscribers? How many? + * + * @return int + */ + public function getSubscriberCount() + { + return $this->subscriberCount; + } + + /** + * Attempt to detect the callback URL (specifically the path forward) + * @return string + */ + protected function _detectCallbackUrl() + { + $callbackUrl = ''; + if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { + $callbackUrl = $_SERVER['HTTP_X_ORIGINAL_URL']; + } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { + $callbackUrl = $_SERVER['HTTP_X_REWRITE_URL']; + } elseif (isset($_SERVER['REQUEST_URI'])) { + $callbackUrl = $_SERVER['REQUEST_URI']; + $scheme = 'http'; + if ($_SERVER['HTTPS'] == 'on') { + $scheme = 'https'; + } + $schemeAndHttpHost = $scheme . '://' . $this->_getHttpHost(); + if (strpos($callbackUrl, $schemeAndHttpHost) === 0) { + $callbackUrl = substr($callbackUrl, strlen($schemeAndHttpHost)); + } + } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { + $callbackUrl= $_SERVER['ORIG_PATH_INFO']; + if (!empty($_SERVER['QUERY_STRING'])) { + $callbackUrl .= '?' . $_SERVER['QUERY_STRING']; + } + } + return $callbackUrl; + } + + /** + * Get the HTTP host + * + * @return string + */ + protected function _getHttpHost() + { + if (!empty($_SERVER['HTTP_HOST'])) { + return $_SERVER['HTTP_HOST']; + } + $scheme = 'http'; + if ($_SERVER['HTTPS'] == 'on') { + $scheme = 'https'; + } + $name = $_SERVER['SERVER_NAME']; + $port = $_SERVER['SERVER_PORT']; + if (($scheme == 'http' && $port == 80) + || ($scheme == 'https' && $port == 443) + ) { + return $name; + } + + return $name . ':' . $port; + } + + /** + * Retrieve a Header value from either $_SERVER or Apache + * + * @param string $header + * @return bool|string + */ + protected function _getHeader($header) + { + $temp = strtoupper(str_replace('-', '_', $header)); + if (!empty($_SERVER[$temp])) { + return $_SERVER[$temp]; + } + $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); + if (!empty($_SERVER[$temp])) { + return $_SERVER[$temp]; + } + if (function_exists('apache_request_headers')) { + $headers = apache_request_headers(); + if (!empty($headers[$header])) { + return $headers[$header]; + } + } + return false; + } + + /** + * Return the raw body of the request + * + * @return string|false Raw body, or false if not present + */ + protected function _getRawBody() + { + $body = file_get_contents('php://input'); + if (strlen(trim($body)) == 0 && isset($GLOBALS['HTTP_RAW_POST_DATA'])) { + $body = $GLOBALS['HTTP_RAW_POST_DATA']; + } + if (strlen(trim($body)) > 0) { + return $body; + } + return false; + } +} diff --git a/3rdparty/ZendFeed/PubSubHubbub/CallbackInterface.php b/3rdparty/ZendFeed/PubSubHubbub/CallbackInterface.php new file mode 100644 index 000000000..8873c3db4 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/CallbackInterface.php @@ -0,0 +1,51 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub; + +interface CallbackInterface +{ + /** + * 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. + * + * @param array $httpData GET/POST data if available and not in $_GET/POST + * @param bool $sendResponseNow Whether to send response now or when asked + */ + public function handle(array $httpData = null, $sendResponseNow = false); + + /** + * Send the response, including all headers. + * If you wish to handle this via Zend\Mvc\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! + * + * @return void + */ + public function sendResponse(); + + /** + * 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\Feed\Pubsubhubbub\AbstractCallback. + * + * @param HttpResponse|\Zend\Http\PhpEnvironment\Response $httpResponse + */ + public function setHttpResponse($httpResponse); + + /** + * 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\Feed\Pubsubhubbub\AbstractCallback. + * + * @return HttpResponse|\Zend\Http\PhpEnvironment\Response + */ + public function getHttpResponse(); +} diff --git a/3rdparty/ZendFeed/PubSubHubbub/Exception/ExceptionInterface.php b/3rdparty/ZendFeed/PubSubHubbub/Exception/ExceptionInterface.php new file mode 100644 index 000000000..845ae2cd3 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/Exception/ExceptionInterface.php @@ -0,0 +1,15 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub\Exception; + +use Zend\Feed\Exception\ExceptionInterface as Exception; + +interface ExceptionInterface extends Exception +{} diff --git a/3rdparty/ZendFeed/PubSubHubbub/Exception/InvalidArgumentException.php b/3rdparty/ZendFeed/PubSubHubbub/Exception/InvalidArgumentException.php new file mode 100644 index 000000000..23f8df104 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/Exception/InvalidArgumentException.php @@ -0,0 +1,17 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub\Exception; + +use Zend\Feed\Exception; + +class InvalidArgumentException + extends Exception\InvalidArgumentException + implements ExceptionInterface +{} diff --git a/3rdparty/ZendFeed/PubSubHubbub/Exception/RuntimeException.php b/3rdparty/ZendFeed/PubSubHubbub/Exception/RuntimeException.php new file mode 100644 index 000000000..209842bd6 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/Exception/RuntimeException.php @@ -0,0 +1,17 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub\Exception; + +use Zend\Feed\Exception; + +class RuntimeException + extends Exception\RuntimeException + implements ExceptionInterface +{} diff --git a/3rdparty/ZendFeed/PubSubHubbub/HttpResponse.php b/3rdparty/ZendFeed/PubSubHubbub/HttpResponse.php new file mode 100644 index 000000000..0c4c74172 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/HttpResponse.php @@ -0,0 +1,211 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub; + +class HttpResponse +{ + /** + * The body of any response to the current callback request + * + * @var string + */ + protected $content = ''; + + /** + * Array of headers. Each header is an array with keys 'name' and 'value' + * + * @var array + */ + protected $headers = array(); + + /** + * HTTP response code to use in headers + * + * @var int + */ + protected $statusCode = 200; + + /** + * Send the response, including all headers + * + * @return void + */ + public function send() + { + $this->sendHeaders(); + echo $this->getContent(); + } + + /** + * Send all headers + * + * Sends any headers specified. If an {@link setHttpResponseCode() HTTP response code} + * has been specified, it is sent with the first header. + * + * @return void + */ + public function sendHeaders() + { + if (count($this->headers) || (200 != $this->statusCode)) { + $this->canSendHeaders(true); + } elseif (200 == $this->statusCode) { + return; + } + $httpCodeSent = false; + foreach ($this->headers as $header) { + if (!$httpCodeSent && $this->statusCode) { + header($header['name'] . ': ' . $header['value'], $header['replace'], $this->statusCode); + $httpCodeSent = true; + } else { + header($header['name'] . ': ' . $header['value'], $header['replace']); + } + } + if (!$httpCodeSent) { + header('HTTP/1.1 ' . $this->statusCode); + } + } + + /** + * Set a header + * + * If $replace is true, replaces any headers already defined with that + * $name. + * + * @param string $name + * @param string $value + * @param bool $replace + * @return \Zend\Feed\PubSubHubbub\HttpResponse + */ + public function setHeader($name, $value, $replace = false) + { + $name = $this->_normalizeHeader($name); + $value = (string) $value; + if ($replace) { + foreach ($this->headers as $key => $header) { + if ($name == $header['name']) { + unset($this->headers[$key]); + } + } + } + $this->headers[] = array( + 'name' => $name, + 'value' => $value, + 'replace' => $replace, + ); + + return $this; + } + + /** + * Check if a specific Header is set and return its value + * + * @param string $name + * @return string|null + */ + public function getHeader($name) + { + $name = $this->_normalizeHeader($name); + foreach ($this->headers as $header) { + if ($header['name'] == $name) { + return $header['value']; + } + } + } + + /** + * Return array of headers; see {@link $headers} for format + * + * @return array + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Can we send headers? + * + * @param bool $throw Whether or not to throw an exception if headers have been sent; defaults to false + * @return HttpResponse + * @throws Exception\RuntimeException + */ + public function canSendHeaders($throw = false) + { + $ok = headers_sent($file, $line); + if ($ok && $throw) { + throw new Exception\RuntimeException('Cannot send headers; headers already sent in ' . $file . ', line ' . $line); + } + return !$ok; + } + + /** + * Set HTTP response code to use with headers + * + * @param int $code + * @return HttpResponse + * @throws Exception\InvalidArgumentException + */ + public function setStatusCode($code) + { + if (!is_int($code) || (100 > $code) || (599 < $code)) { + throw new Exception\InvalidArgumentException('Invalid HTTP response' + . ' code:' . $code); + } + $this->statusCode = $code; + return $this; + } + + /** + * Retrieve HTTP response code + * + * @return int + */ + public function getStatusCode() + { + return $this->statusCode; + } + + /** + * Set body content + * + * @param string $content + * @return \Zend\Feed\PubSubHubbub\HttpResponse + */ + public function setContent($content) + { + $this->content = (string) $content; + $this->setHeader('content-length', strlen($content)); + return $this; + } + + /** + * Return the body content + * + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Normalizes a header name to X-Capitalized-Names + * + * @param string $name + * @return string + */ + protected function _normalizeHeader($name) + { + $filtered = str_replace(array('-', '_'), ' ', (string) $name); + $filtered = ucwords(strtolower($filtered)); + $filtered = str_replace(' ', '-', $filtered); + return $filtered; + } +} diff --git a/3rdparty/ZendFeed/PubSubHubbub/Model/AbstractModel.php b/3rdparty/ZendFeed/PubSubHubbub/Model/AbstractModel.php new file mode 100644 index 000000000..92e688133 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/Model/AbstractModel.php @@ -0,0 +1,39 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub\Model; + +use Zend\Db\TableGateway\TableGateway; +use Zend\Db\TableGateway\TableGatewayInterface; + +class AbstractModel +{ + /** + * Zend\Db\TableGateway\TableGatewayInterface instance to host database methods + * + * @var TableGatewayInterface + */ + protected $db = null; + + /** + * Constructor + * + * @param null|TableGatewayInterface $tableGateway + */ + public function __construct(TableGatewayInterface $tableGateway = null) + { + if ($tableGateway === null) { + $parts = explode('\\', get_class($this)); + $table = strtolower(array_pop($parts)); + $this->db = new TableGateway($table, null); + } else { + $this->db = $tableGateway; + } + } +} diff --git a/3rdparty/ZendFeed/PubSubHubbub/Model/Subscription.php b/3rdparty/ZendFeed/PubSubHubbub/Model/Subscription.php new file mode 100644 index 000000000..9571106a4 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/Model/Subscription.php @@ -0,0 +1,142 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub\Model; + +use DateInterval; +use DateTime; +use Zend\Feed\PubSubHubbub; + +class Subscription extends AbstractModel implements SubscriptionPersistenceInterface +{ + /** + * Common DateTime object to assist with unit testing + * + * @var DateTime + */ + protected $now; + + /** + * Save subscription to RDMBS + * + * @param array $data + * @return bool + * @throws PubSubHubbub\Exception\InvalidArgumentException + */ + public function setSubscription(array $data) + { + if (!isset($data['id'])) { + throw new PubSubHubbub\Exception\InvalidArgumentException( + 'ID must be set before attempting a save' + ); + } + $result = $this->db->select(array('id' => $data['id'])); + if ($result && (0 < count($result))) { + $data['created_time'] = $result->current()->created_time; + $now = $this->getNow(); + if (array_key_exists('lease_seconds', $data) + && $data['lease_seconds'] + ) { + $data['expiration_time'] = $now->add(new DateInterval('PT' . $data['lease_seconds'] . 'S')) + ->format('Y-m-d H:i:s'); + } + $this->db->update( + $data, + array('id' => $data['id']) + ); + return false; + } + + $this->db->insert($data); + return true; + } + + /** + * Get subscription by ID/key + * + * @param string $key + * @return array + * @throws PubSubHubbub\Exception\InvalidArgumentException + */ + public function getSubscription($key) + { + if (empty($key) || !is_string($key)) { + throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"' + .' of "' . $key . '" must be a non-empty string'); + } + $result = $this->db->select(array('id' => $key)); + if (count($result)) { + return $result->current()->getArrayCopy(); + } + return false; + } + + /** + * Determine if a subscription matching the key exists + * + * @param string $key + * @return bool + * @throws PubSubHubbub\Exception\InvalidArgumentException + */ + public function hasSubscription($key) + { + if (empty($key) || !is_string($key)) { + throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"' + .' of "' . $key . '" must be a non-empty string'); + } + $result = $this->db->select(array('id' => $key)); + if (count($result)) { + return true; + } + return false; + } + + /** + * Delete a subscription + * + * @param string $key + * @return bool + */ + public function deleteSubscription($key) + { + $result = $this->db->select(array('id' => $key)); + if (count($result)) { + $this->db->delete( + array('id' => $key) + ); + return true; + } + return false; + } + + /** + * Get a new DateTime or the one injected for testing + * + * @return DateTime + */ + public function getNow() + { + if (null === $this->now) { + return new DateTime(); + } + return $this->now; + } + + /** + * Set a DateTime instance for assisting with unit testing + * + * @param DateTime $now + * @return Subscription + */ + public function setNow(DateTime $now) + { + $this->now = $now; + return $this; + } +} diff --git a/3rdparty/ZendFeed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php b/3rdparty/ZendFeed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php new file mode 100644 index 000000000..77b2e71f9 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/Model/SubscriptionPersistenceInterface.php @@ -0,0 +1,47 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub\Model; + +interface SubscriptionPersistenceInterface +{ + + /** + * Save subscription to RDMBS + * + * @param array $data The key must be stored here as a $data['id'] entry + * @return bool + */ + public function setSubscription(array $data); + + /** + * Get subscription by ID/key + * + * @param string $key + * @return array + */ + public function getSubscription($key); + + /** + * Determine if a subscription matching the key exists + * + * @param string $key + * @return bool + */ + public function hasSubscription($key); + + /** + * Delete a subscription + * + * @param string $key + * @return bool + */ + public function deleteSubscription($key); + +} diff --git a/3rdparty/ZendFeed/PubSubHubbub/PubSubHubbub.php b/3rdparty/ZendFeed/PubSubHubbub/PubSubHubbub.php new file mode 100644 index 000000000..585be54d1 --- /dev/null +++ b/3rdparty/ZendFeed/PubSubHubbub/PubSubHubbub.php @@ -0,0 +1,147 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Feed\PubSubHubbub; + +use Zend\Escaper\Escaper; +use Zend\Feed\Reader; +use Zend\Http; + +class PubSubHubbub +{ + /** + * Verification Modes + */ + const VERIFICATION_MODE_SYNC = 'sync'; + const VERIFICATION_MODE_ASYNC = 'async'; + + /** + * Subscription States + */ + const SUBSCRIPTION_VERIFIED = 'verified'; + const SUBSCRIPTION_NOTVERIFIED = 'not_verified'; + const SUBSCRIPTION_TODELETE = 'to_delete'; + + /** + * @var Escaper + */ + protected static $escaper; + + /** + * Singleton instance if required of the HTT |