equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Feed_Pubsubhubbub |
16 * @package Zend_Feed_Pubsubhubbub |
17 * @subpackage Callback |
17 * @subpackage Callback |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: CallbackAbstract.php 24842 2012-05-31 18:31:28Z rob $ |
20 * @version $Id$ |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @see Zend_Feed_Pubsubhubbub_CallbackInterface |
24 * @see Zend_Feed_Pubsubhubbub_CallbackInterface |
25 */ |
25 */ |
32 |
32 |
33 /** |
33 /** |
34 * @category Zend |
34 * @category Zend |
35 * @package Zend_Feed_Pubsubhubbub |
35 * @package Zend_Feed_Pubsubhubbub |
36 * @subpackage Callback |
36 * @subpackage Callback |
37 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
37 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
38 * @license http://framework.zend.com/license/new-bsd New BSD License |
38 * @license http://framework.zend.com/license/new-bsd New BSD License |
39 */ |
39 */ |
40 abstract class Zend_Feed_Pubsubhubbub_CallbackAbstract |
40 abstract class Zend_Feed_Pubsubhubbub_CallbackAbstract |
41 implements Zend_Feed_Pubsubhubbub_CallbackInterface |
41 implements Zend_Feed_Pubsubhubbub_CallbackInterface |
42 { |
42 { |
68 /** |
68 /** |
69 * Constructor; accepts an array or Zend_Config instance to preset |
69 * Constructor; accepts an array or Zend_Config instance to preset |
70 * options for the Subscriber without calling all supported setter |
70 * options for the Subscriber without calling all supported setter |
71 * methods in turn. |
71 * methods in turn. |
72 * |
72 * |
73 * @param array|Zend_Config $options Options array or Zend_Config instance |
73 * @param array|Zend_Config|null $config Options array or Zend_Config instance |
74 */ |
74 */ |
75 public function __construct($config = null) |
75 public function __construct($config = null) |
76 { |
76 { |
77 if ($config !== null) { |
77 if ($config !== null) { |
78 $this->setConfig($config); |
78 $this->setConfig($config); |
80 } |
80 } |
81 |
81 |
82 /** |
82 /** |
83 * Process any injected configuration options |
83 * Process any injected configuration options |
84 * |
84 * |
85 * @param array|Zend_Config $options Options array or Zend_Config instance |
85 * @param array|Zend_Config $config Options array or Zend_Config instance |
|
86 * @throws Zend_Feed_Pubsubhubbub_Exception |
86 * @return Zend_Feed_Pubsubhubbub_CallbackAbstract |
87 * @return Zend_Feed_Pubsubhubbub_CallbackAbstract |
87 */ |
88 */ |
88 public function setConfig($config) |
89 public function setConfig($config) |
89 { |
90 { |
90 if ($config instanceof Zend_Config) { |
91 if ($config instanceof Zend_Config) { |
130 /** |
131 /** |
131 * Gets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used |
132 * Gets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used |
132 * to background save any verification tokens associated with a subscription |
133 * to background save any verification tokens associated with a subscription |
133 * or other. |
134 * or other. |
134 * |
135 * |
|
136 * @throws Zend_Feed_Pubsubhubbub_Exception |
135 * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface |
137 * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface |
136 */ |
138 */ |
137 public function getStorage() |
139 public function getStorage() |
138 { |
140 { |
139 if ($this->_storage === null) { |
141 if ($this->_storage === null) { |
148 * An instance of a class handling Http Responses. This is implemented in |
150 * An instance of a class handling Http Responses. This is implemented in |
149 * Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with |
151 * Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with |
150 * (i.e. not inherited from) Zend_Controller_Response_Http. |
152 * (i.e. not inherited from) Zend_Controller_Response_Http. |
151 * |
153 * |
152 * @param Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http $httpResponse |
154 * @param Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http $httpResponse |
|
155 * @throws Zend_Feed_Pubsubhubbub_Exception |
153 * @return Zend_Feed_Pubsubhubbub_CallbackAbstract |
156 * @return Zend_Feed_Pubsubhubbub_CallbackAbstract |
154 */ |
157 */ |
155 public function setHttpResponse($httpResponse) |
158 public function setHttpResponse($httpResponse) |
156 { |
159 { |
157 if (!is_object($httpResponse) |
160 if (!is_object($httpResponse) |
186 * Sets the number of Subscribers for which any updates are on behalf of. |
189 * Sets the number of Subscribers for which any updates are on behalf of. |
187 * In other words, is this class serving one or more subscribers? How many? |
190 * In other words, is this class serving one or more subscribers? How many? |
188 * Defaults to 1 if left unchanged. |
191 * Defaults to 1 if left unchanged. |
189 * |
192 * |
190 * @param string|int $count |
193 * @param string|int $count |
|
194 * @throws Zend_Feed_Pubsubhubbub_Exception |
191 * @return Zend_Feed_Pubsubhubbub_CallbackAbstract |
195 * @return Zend_Feed_Pubsubhubbub_CallbackAbstract |
192 */ |
196 */ |
193 public function setSubscriberCount($count) |
197 public function setSubscriberCount($count) |
194 { |
198 { |
195 $count = intval($count); |
199 $count = intval($count); |
268 } |
272 } |
269 |
273 |
270 /** |
274 /** |
271 * Retrieve a Header value from either $_SERVER or Apache |
275 * Retrieve a Header value from either $_SERVER or Apache |
272 * |
276 * |
273 * @param string $header |
277 * @param string $header |
|
278 * @return bool |
274 */ |
279 */ |
275 protected function _getHeader($header) |
280 protected function _getHeader($header) |
276 { |
281 { |
277 $temp = strtoupper(str_replace('-', '_', $header)); |
282 $temp = strtoupper(str_replace('-', '_', $header)); |
278 if (!empty($_SERVER[$temp])) { |
283 if (!empty($_SERVER[$temp])) { |