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' into acceptHandling
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Http/Header/AbstractAccept.php
	library/Zend/Http/Header/AcceptEncoding.php
	library/Zend/Http/Header/AcceptLanguage.php
	tests/Zend/Http/Header/AcceptCharsetTest.php
	tests/Zend/Http/Header/AcceptEncodingTest.php
	tests/Zend/Http/Header/AcceptLanguageTest.php
	tests/Zend/Http/Header/AcceptTest.php
  • Loading branch information
Freeaqingme committed Jul 14, 2012
6 parents 415d9bf + 4190868 + 3a6b7ad + 8e745f6 + bab7086 + c5a5d19 commit b468bc1
Show file tree
Hide file tree
Showing 79 changed files with 924 additions and 906 deletions.
20 changes: 10 additions & 10 deletions src/PubSubHubbub/Model/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class Subscription extends AbstractModel implements SubscriptionPersistenceInter
{
/**
* Common DateTime object to assist with unit testing
*
*
* @var DateTime
*/
protected $now;

/**
* Save subscription to RDMBS
*
Expand All @@ -46,7 +46,7 @@ public function setSubscription(array $data)
if ($result && (0 < count($result))) {
$data['created_time'] = $result->current()->created_time;
$now = $this->getNow();
if (array_key_exists('lease_seconds', $data)
if (array_key_exists('lease_seconds', $data)
&& $data['lease_seconds']
) {
$data['expiration_time'] = $now->add(new DateInterval('PT' . $data['lease_seconds'] . 'S'))
Expand All @@ -62,11 +62,11 @@ public function setSubscription(array $data)
$this->_db->insert($data);
return true;
}

/**
* Get subscription by ID/key
*
* @param string $key
*
* @param string $key
* @return array
* @throws PubSubHubbub\Exception\InvalidArgumentException
*/
Expand All @@ -85,8 +85,8 @@ public function getSubscription($key)

/**
* Determine if a subscription matching the key exists
*
* @param string $key
*
* @param string $key
* @return bool
* @throws PubSubHubbub\Exception\InvalidArgumentException
*/
Expand Down Expand Up @@ -123,7 +123,7 @@ public function deleteSubscription($key)

/**
* Get a new DateTime or the one injected for testing
*
*
* @return DateTime
*/
public function getNow()
Expand All @@ -136,7 +136,7 @@ public function getNow()

/**
* Set a DateTime instance for assisting with unit testing
*
*
* @param DateTime $now
* @return Subscription
*/
Expand Down
16 changes: 8 additions & 8 deletions src/PubSubHubbub/Model/SubscriptionPersistenceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@
*/
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
*
* @param string $key
* @return array
*/
public function getSubscription($key);

/**
* Determine if a subscription matching the key exists
*
* @param string $key
*
* @param string $key
* @return bool
*/
public function hasSubscription($key);

/**
* Delete a subscription
*
* @param string $key
* @return bool
*/
public function deleteSubscription($key);

}
2 changes: 1 addition & 1 deletion src/PubSubHubbub/PubSubHubbub.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PubSubHubbub
*/
const VERIFICATION_MODE_SYNC = 'sync';
const VERIFICATION_MODE_ASYNC = 'async';

/**
* Subscription States
*/
Expand Down
30 changes: 15 additions & 15 deletions src/PubSubHubbub/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Subscriber
* @var array
*/
protected $_authentications = array();

/**
* Tells the Subscriber to append any subscription identifier to the path
* of the base Callback URL. E.g. an identifier "subkey1" would be added
Expand Down Expand Up @@ -381,12 +381,12 @@ public function getHubUrls()
$this->_hubUrls = array_unique($this->_hubUrls);
return $this->_hubUrls;
}

/**
* Add authentication credentials for a given URL
*
* @param string $url
* @param array $authentication
*
* @param string $url
* @param array $authentication
* @return Subscriber
* @throws Exception\InvalidArgumentException
*/
Expand All @@ -400,11 +400,11 @@ public function addAuthentication($url, array $authentication)
$this->_authentications[$url] = $authentication;
return $this;
}

/**
* Add authentication credentials for hub URLs
*
* @param array $authentications
*
* @param array $authentications
* @return Subscriber
*/
public function addAuthentications(array $authentications)
Expand All @@ -414,21 +414,21 @@ public function addAuthentications(array $authentications)
}
return $this;
}

/**
* Get all hub URL authentication credentials
*
*
* @return array
*/
public function getAuthentications()
{
return $this->_authentications;
}

/**
* Set flag indicating whether or not to use a path parameter
*
* @param bool $bool
*
* @param bool $bool
* @return Subscriber
*/
public function usePathParameter($bool = true)
Expand Down Expand Up @@ -524,7 +524,7 @@ public function setStorage(Model\SubscriptionPersistenceInterface $storage)
}

/**
* Gets an instance of Zend\Feed\Pubsubhubbub\Storage\StoragePersistence used
* Gets an instance of Zend\Feed\Pubsubhubbub\Storage\StoragePersistence used
* to background save any verification tokens associated with a subscription
* or other.
*
Expand Down Expand Up @@ -727,7 +727,7 @@ protected function _getRequestParameters($hubUrl, $mode)
foreach ($optParams as $name => $value) {
$params[$name] = $value;
}

// store subscription to storage
$now = new DateTime();
$expires = null;
Expand Down
10 changes: 5 additions & 5 deletions src/PubSubHubbub/Subscriber/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Callback extends PubSubHubbub\AbstractCallback
* @var string
*/
protected $_feedUpdate = 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
Expand All @@ -35,14 +35,14 @@ class Callback extends PubSubHubbub\AbstractCallback
* @var string
*/
protected $_subscriptionKey = null;

/**
* After verification, this is set to the verified subscription's data.
*
* @var array
*/
protected $_currentSubscriptionData = null;

/**
* Set a subscription key to use for the current callback request manually.
* Required if usePathParameter is enabled for the Subscriber.
Expand Down Expand Up @@ -129,9 +129,9 @@ public function isValidHubVerification(array $httpGetData)
return false;
}
$required = array(
'hub_mode',
'hub_mode',
'hub_topic',
'hub_challenge',
'hub_challenge',
'hub_verify_token',
);
foreach ($required as $key) {
Expand Down
2 changes: 1 addition & 1 deletion src/Reader/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
class Collection extends \ArrayObject
{



}
2 changes: 1 addition & 1 deletion src/Reader/Collection/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ abstract class AbstractCollection extends \ArrayObject
*
* @return array
*/
public abstract function getValues();
abstract public function getValues();

}
3 changes: 2 additions & 1 deletion src/Reader/Collection/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class Author extends AbstractCollection
*
* @return array
*/
public function getValues() {
public function getValues()
{
$authors = array();
foreach ($this->getIterator() as $element) {
$authors[] = $element['name'];
Expand Down
3 changes: 2 additions & 1 deletion src/Reader/Collection/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class Category extends AbstractCollection
*
* @return array
*/
public function getValues() {
public function getValues()
{
$categories = array();
foreach ($this->getIterator() as $element) {
if (isset($element['label']) && !empty($element['label'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Reader/Collection/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
class Collection extends \ArrayObject
{



}
4 changes: 2 additions & 2 deletions src/Reader/Entry/AbstractEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public function __construct(DOMElement $entry, $entryKey, $type = null)
$this->_domDocument = $entry->ownerDocument;
if ($type !== null) {
$this->_data['type'] = $type;
} else if ($this->_domDocument !== null) {
} elseif ($this->_domDocument !== null) {
$this->_data['type'] = Reader\Reader::detectType($this->_domDocument);
} else {
$this->_data['type'] = Reader\Reader::TYPE_ANY;
$this->_data['type'] = Reader\Reader::TYPE_ANY;
}
$this->_loadExtensions();
}
Expand Down
10 changes: 5 additions & 5 deletions src/Reader/Entry/Atom.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(DOMElement $entry, $entryKey, $type = null)

$threadClass = Reader\Reader::getPluginLoader()->getClassName('Thread\\Entry');
$this->_extensions['Thread\\Entry'] = new $threadClass($entry, $entryKey, $type);

$threadClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Entry');
$this->_extensions['DublinCore\\Entry'] = new $threadClass($entry, $entryKey, $type);
}
Expand Down Expand Up @@ -317,7 +317,7 @@ public function getCommentFeedLink()

return $this->_data['commentfeedlink'];
}

/**
* Get category data as a Reader\Reader_Collection_Category object
*
Expand All @@ -330,7 +330,7 @@ public function getCategories()
}

$categoryCollection = $this->getExtension('Atom')->getCategories();

if (count($categoryCollection) == 0) {
$categoryCollection = $this->getExtension('DublinCore')->getCategories();
}
Expand All @@ -339,7 +339,7 @@ public function getCategories()

return $this->_data['categories'];
}

/**
* Get source feed metadata from the entry
*
Expand All @@ -355,7 +355,7 @@ public function getSource()

$this->_data['source'] = $source;

return $this->_data['source'];
return $this->_data['source'];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Reader/Entry/EntryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function getCommentLink();
* @return string
*/
public function getCommentFeedLink();

/**
* Get all categories
*
Expand Down
Loading

0 comments on commit b468bc1

Please sign in to comment.