Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/zendframework/zf2 into zf…
Browse files Browse the repository at this point in the history
…-3371
  • Loading branch information
Show file tree
Hide file tree
Showing 94 changed files with 80 additions and 386 deletions.
1 change: 0 additions & 1 deletion src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Exception;
Expand Down
5 changes: 0 additions & 5 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Exception;

/**
* @category Zend
* @package Zend_Feed
*/
interface ExceptionInterface
{}
1 change: 0 additions & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Exception;
Expand Down
1 change: 0 additions & 1 deletion src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Exception;
Expand Down
6 changes: 0 additions & 6 deletions src/PubSubHubbub/AbstractCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub;
Expand All @@ -14,11 +13,6 @@
use Zend\Http\PhpEnvironment\Response as PhpResponse;
use Zend\Stdlib\ArrayUtils;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Callback
*/
abstract class AbstractCallback implements CallbackInterface
{
/**
Expand Down
6 changes: 0 additions & 6 deletions src/PubSubHubbub/CallbackInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Callback
*/
interface CallbackInterface
{
/**
Expand Down
1 change: 0 additions & 1 deletion src/PubSubHubbub/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Exception;
Expand Down
1 change: 0 additions & 1 deletion src/PubSubHubbub/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Exception;
Expand Down
1 change: 0 additions & 1 deletion src/PubSubHubbub/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Exception;
Expand Down
5 changes: 0 additions & 5 deletions src/PubSubHubbub/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
*/
class HttpResponse
{
/**
Expand Down
5 changes: 0 additions & 5 deletions src/PubSubHubbub/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Model;

use Zend\Db\TableGateway\TableGateway;
use Zend\Db\TableGateway\TableGatewayInterface;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
*/
class AbstractModel
{
/**
Expand Down
6 changes: 0 additions & 6 deletions src/PubSubHubbub/Model/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Model;
Expand All @@ -14,11 +13,6 @@
use DateTime;
use Zend\Feed\PubSubHubbub;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Entity
*/
class Subscription extends AbstractModel implements SubscriptionPersistenceInterface
{
/**
Expand Down
6 changes: 0 additions & 6 deletions src/PubSubHubbub/Model/SubscriptionPersistenceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Model;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @subpackage Entity
*/
interface SubscriptionPersistenceInterface
{

Expand Down
5 changes: 0 additions & 5 deletions src/PubSubHubbub/PubSubHubbub.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub;
Expand All @@ -14,10 +13,6 @@
use Zend\Feed\Reader;
use Zend\Http;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
*/
class PubSubHubbub
{
/**
Expand Down
5 changes: 0 additions & 5 deletions src/PubSubHubbub/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub;
Expand All @@ -16,10 +15,6 @@
use Zend\Uri;
use Zend\Version\Version;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
*/
class Publisher
{
/**
Expand Down
7 changes: 1 addition & 6 deletions src/PubSubHubbub/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub;
Expand All @@ -18,10 +17,6 @@
use Zend\Uri;
use Zend\Version\Version;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
*/
class Subscriber
{
/**
Expand Down Expand Up @@ -744,7 +739,7 @@ protected function _getRequestParameters($hubUrl, $mode)
'verify_token' => hash('sha256', $params['hub.verify_token']),
'secret' => null,
'expiration_time' => $expires,
'subscription_state' => PubSubHubbub::SUBSCRIPTION_NOTVERIFIED,
'subscription_state' => ($mode == 'unsubscribe')? PubSubHubbub::SUBSCRIPTION_TODELETE : PubSubHubbub::SUBSCRIPTION_NOTVERIFIED,
);
$this->getStorage()->setSubscription($data);

Expand Down
31 changes: 21 additions & 10 deletions src/PubSubHubbub/Subscriber/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\PubSubHubbub\Subscriber;

use Zend\Feed\PubSubHubbub;
use Zend\Feed\PubSubHubbub\Exception;
use Zend\Uri;

/**
* @category Zend
* @package Zend_Feed_Pubsubhubbub
*/
class Callback extends PubSubHubbub\AbstractCallback
{
/**
Expand Down Expand Up @@ -93,19 +89,34 @@ public function handle(array $httpGetData = null, $sendResponseNow = false)
* Handle any (un)subscribe confirmation requests
*/
} elseif ($this->isValidHubVerification($httpGetData)) {
$data = $this->currentSubscriptionData;
$this->getHttpResponse()->setContent($httpGetData['hub_challenge']);
$data['subscription_state'] = PubSubHubbub\PubSubHubbub::SUBSCRIPTION_VERIFIED;
if (isset($httpGetData['hub_lease_seconds'])) {
$data['lease_seconds'] = $httpGetData['hub_lease_seconds'];

switch (strtolower($httpGetData['hub_mode'])) {
case 'subscribe':
$data = $this->currentSubscriptionData;
$data['subscription_state'] = PubSubHubbub\PubSubHubbub::SUBSCRIPTION_VERIFIED;
if (isset($httpGetData['hub_lease_seconds'])) {
$data['lease_seconds'] = $httpGetData['hub_lease_seconds'];
}
$this->getStorage()->setSubscription($data);
break;
case 'unsubscribe':
$verifyTokenKey = $this->_detectVerifyTokenKey($httpGetData);
$this->getStorage()->deleteSubscription($verifyTokenKey);
break;
default:
throw new Exception\RuntimeException(sprintf(
'Invalid hub_mode ("%s") provided',
$httpGetData['hub_mode']
));
}
$this->getStorage()->setSubscription($data);
/**
* Hey, C'mon! We tried everything else!
*/
} else {
$this->getHttpResponse()->setStatusCode(404);
}

if ($sendResponseNow) {
$this->sendResponse();
}
Expand Down
5 changes: 0 additions & 5 deletions src/Reader/AbstractEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Reader;
Expand All @@ -14,10 +13,6 @@
use DOMElement;
use DOMXPath;

/**
* @category Zend
* @package Zend_Feed_Reader
*/
abstract class AbstractEntry
{
/**
Expand Down
5 changes: 0 additions & 5 deletions src/Reader/AbstractFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Reader;
Expand All @@ -14,10 +13,6 @@
use DOMElement;
use DOMXPath;

/**
* @category Zend
* @package Zend_Feed_Reader
*/
abstract class AbstractFeed implements Feed\FeedInterface
{
/**
Expand Down
5 changes: 0 additions & 5 deletions src/Reader/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Reader;

/**
* @category Zend
* @package Zend_Feed_Reader
*/
class Collection extends \ArrayObject
{

Expand Down
5 changes: 0 additions & 5 deletions src/Reader/Collection/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Reader\Collection;

/**
* @category Zend
* @package Zend_Feed_Reader
*/
abstract class AbstractCollection extends \ArrayObject
{

Expand Down
6 changes: 0 additions & 6 deletions src/Reader/Collection/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Feed
*/

namespace Zend\Feed\Reader\Collection;

/**
* @category Zend
* @package Zend_Feed_Reader
*/
class Author extends AbstractCollection
{

Expand All @@ -31,5 +26,4 @@ public function getValues()
}
return array_unique($authors);
}

}
Loading

0 comments on commit 3d18a84

Please sign in to comment.