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 git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
  • Loading branch information
sgehrig committed Jul 29, 2011
Show file tree
Hide file tree
Showing 17 changed files with 229 additions and 289 deletions.
11 changes: 3 additions & 8 deletions src/PubSubHubbub/PubSubHubbub.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@
* @namespace
*/
namespace Zend\Feed\PubSubHubbub;
use Zend\Feed\Reader;
use Zend\Http;

use Zend\Feed\Reader,
Zend\Http;

/**
* @uses \Zend\Http\Client
* @uses \Zend\Feed\AbstractFeed
* @uses \Zend\Feed\PubSubHubbub\Exception
* @uses \Zend\Feed\Reader\Reader
* @uses \Zend\Uri\Uri
* @uses \Zend\Version
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down
12 changes: 4 additions & 8 deletions src/PubSubHubbub/Publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@
* @namespace
*/
namespace Zend\Feed\PubSubHubbub;

use Zend\Uri;

/**
* @uses \Zend\Feed\PubSubHubbub\PubSubHubbub
* @uses \Zend\Feed\PubSubHubbub\Exception
* @uses \Zend\Http\Client
* @uses \Zend\Uri\Uri
* @uses \Zend\Version
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -118,7 +114,7 @@ public function setConfig($config)
*/
public function addHubUrl($url)
{
if (empty($url) || !is_string($url) || !\Zend\Uri\Url::validate($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
.' of "' . $url . '" must be a non-empty string and a valid'
.'URL');
Expand Down Expand Up @@ -176,7 +172,7 @@ public function getHubUrls()
*/
public function addUpdatedTopicUrl($url)
{
if (empty($url) || !is_string($url) || !\Zend\Uri\Url::validate($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
.' of "' . $url . '" must be a non-empty string and a valid'
.'URL');
Expand Down Expand Up @@ -235,7 +231,7 @@ public function getUpdatedTopicUrls()
*/
public function notifyHub($url)
{
if (empty($url) || !is_string($url) || !Uri\Url::validate($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
.' of "' . $url . '" must be a non-empty string and a valid'
.'URL');
Expand Down
21 changes: 7 additions & 14 deletions src/PubSubHubbub/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@
*/
namespace Zend\Feed\PubSubHubbub;

use Zend\Uri;
use Zend\Date;
use Zend\Date,
Zend\Uri;

/**
* @uses \Zend\Date\Date
* @uses \Zend\Feed\PubSubHubbub\PubSubHubbub
* @uses \Zend\Feed\PubSubHubbub\Exception
* @uses \Zend\Http\Client
* @uses \Zend\Uri\Uri
* @uses \Zend\Version
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -90,8 +84,7 @@ class Subscriber
*
* @var string
*/
protected $_preferredVerificationMode
= PubSubHubbub::VERIFICATION_MODE_SYNC;
protected $_preferredVerificationMode = PubSubHubbub::VERIFICATION_MODE_SYNC;

/**
* An array of any errors including keys for 'response', 'hubUrl'.
Expand Down Expand Up @@ -213,7 +206,7 @@ public function setConfig($config)
*/
public function setTopicUrl($url)
{
if (empty($url) || !is_string($url) || !\Zend\Uri\Url::validate($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
.' of "' . $url . '" must be a non-empty string and a valid'
.' URL');
Expand Down Expand Up @@ -273,7 +266,7 @@ public function getLeaseSeconds()
*/
public function setCallbackUrl($url)
{
if (empty($url) || !is_string($url) || !\Zend\Uri\Url::validate($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
. ' of "' . $url . '" must be a non-empty string and a valid'
. ' URL');
Expand Down Expand Up @@ -340,7 +333,7 @@ public function getPreferredVerificationMode()
*/
public function addHubUrl($url)
{
if (empty($url) || !is_string($url) || !\Zend\Uri\Url::validate($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
. ' of "' . $url . '" must be a non-empty string and a valid'
. ' URL');
Expand Down Expand Up @@ -399,7 +392,7 @@ public function getHubUrls()
*/
public function addAuthentication($url, array $authentication)
{
if (empty($url) || !is_string($url) || !URI\Zend\Uri\Uri::check($url)) {
if (empty($url) || !is_string($url) || !Uri\UriFactory::factory($url)->isValid()) {
throw new Exception('Invalid parameter "url"'
. ' of "' . $url . '" must be a non-empty string and a valid'
. ' URL');
Expand Down
10 changes: 4 additions & 6 deletions src/PubSubHubbub/Subscriber/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
* @namespace
*/
namespace Zend\Feed\PubSubHubbub\Subscriber;
use Zend\Feed\PubSubHubbub;

use Zend\Feed\PubSubHubbub,
Zend\Uri;

/**
* @uses \Zend\Feed\PubSubHubbub\PubSubHubbub
* @uses \Zend\Feed\PubSubHubbub\AbstractCallback
* @uses \Zend\Feed\Reader\Reader
* @uses \Zend\Uri\Uri
* @category Zend
* @package Zend_Feed_Pubsubhubbub
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -167,7 +165,7 @@ public function isValidHubVerification(array $httpGetData)
) {
return false;
}
if (!\Zend\Uri\Url::validate($httpGetData['hub_topic'])) {
if (!Uri\UriFactory::factory($httpGetData['hub_topic'])->isValid()) {
return false;
}

Expand Down
37 changes: 16 additions & 21 deletions src/Reader/Extension/Atom/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,20 @@
*/

/**
* @namespace
*/
* @namespace
*/
namespace Zend\Feed\Reader\Extension\Atom;
use Zend\Feed\Reader;
use Zend\Date;
use Zend\Feed\Reader\Collection;
use Zend\Feed\Reader\Extension;
use Zend\URI;

use DOMDocument,
DOMElement,
stdClass,
Zend\Date,
Zend\Feed\Reader,
Zend\Feed\Reader\Collection,
Zend\Feed\Reader\Extension,
Zend\Uri;

/**
* @uses DOMDocument
* @uses stdClass
* @uses \Zend\Date\Date
* @uses \Zend\Feed\Reader\Reader
* @uses \Zend\Feed\Reader\Feed\Atom\Source
* @uses \Zend\Feed\Reader\Collection\Author
* @uses \Zend\Feed\Reader\Collection\Category
* @uses \Zend\Feed\Reader\Extension\EntryAbstract
* @uses \Zend\Uri\Uri
* @category Zend
* @package Reader\Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -134,7 +129,7 @@ public function getContent()
$xhtml = $this->getXpath()->query(
$this->getXpathPrefix() . '/atom:content/xhtml:div'
)->item(0);
$d = new \DOMDocument('1.0', $this->getEncoding());
$d = new DOMDocument('1.0', $this->getEncoding());
$xhtmls = $d->importNode($xhtml, true);
$d->appendChild($xhtmls);
$content = $this->_collectXhtml(
Expand Down Expand Up @@ -267,7 +262,7 @@ public function getEnclosure()
$nodeList = $this->getXpath()->query($this->getXpathPrefix() . '/atom:link[@rel="enclosure"]');

if ($nodeList->length > 0) {
$enclosure = new \stdClass();
$enclosure = new stdClass();
$enclosure->url = $nodeList->item(0)->getAttribute('href');
$enclosure->length = $nodeList->item(0)->getAttribute('length');
$enclosure->type = $nodeList->item(0)->getAttribute('type');
Expand Down Expand Up @@ -567,10 +562,10 @@ public function getSource()
*/
protected function _absolutiseUri($link)
{
if (!\Zend\Uri\Url::validate($link)) {
if (!Uri\UriFactory::factory($link)->isValid()) {
if (!is_null($this->getBaseUrl())) {
$link = $this->getBaseUrl() . $link;
if (!\Zend\Uri\Url::validate($link)) {
if (!Uri\UriFactory::factory($link)->isValid()) {
$link = null;
}
}
Expand All @@ -584,7 +579,7 @@ protected function _absolutiseUri($link)
* @param DOMElement $element
* @return string
*/
protected function _getAuthor(\DOMElement $element)
protected function _getAuthor(DOMElement $element)
{
$author = array();

Expand Down
21 changes: 8 additions & 13 deletions src/Reader/Extension/Atom/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,14 @@
* @namespace
*/
namespace Zend\Feed\Reader\Extension\Atom;
use Zend\Feed\Reader;
use Zend\Date;
use Zend\Feed\Reader\Collection;
use Zend\Feed\Reader\Extension;
use Zend\URI;

use Zend\Date,
Zend\Feed\Reader,
Zend\Feed\Reader\Collection,
Zend\Feed\Reader\Extension,
Zend\Uri;

/**
* @uses \Zend\Date\Date
* @uses \Zend\Feed\Reader\Reader
* @uses \Zend\Feed\Reader\Collection\Author
* @uses \Zend\Feed\Reader\Collection\Category
* @uses \Zend\Feed\Reader\Extension\FeedAbstract
* @uses \Zend\Uri\Uri
* @category Zend
* @package Reader\Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -508,10 +503,10 @@ protected function _getAuthor(\DOMElement $element)
*/
protected function _absolutiseUri($link)
{
if (!\Zend\Uri\Url::validate($link)) {
if (!Uri\UriFactory::factory($link)->isValid()) {
if (!is_null($this->getBaseUrl())) {
$link = $this->getBaseUrl() . $link;
if (!\Zend\Uri\Url::validate($link)) {
if (!Uri\UriFactory::factory($link)->isValid()) {
$link = null;
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/Reader/FeedSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
* @namespace
*/
namespace Zend\Feed\Reader;
use Zend\Uri;

use ArrayObject,
Zend\Uri;

/**
* @uses \Zend\Feed\Reader\Reader
* @uses \Zend\Uri\Uri
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class FeedSet extends \ArrayObject
class FeedSet extends ArrayObject
{

public $rss = null;
Expand Down Expand Up @@ -84,16 +84,16 @@ public function addLinks(\DOMNodeList $links, $uri)
*/
protected function _absolutiseUri($link, $uri = null)
{
if (!Uri\Url::validate($link)) {
if (!Uri\UriFactory::factory($link)->isValid()) {
if ($uri !== null) {
$uri = new Uri\Url($uri);
$uri = Uri\UriFactory::factory($uri);

if ($link[0] !== '/') {
$link = $uri->getPath() . '/' . $link;
}

$link = $uri->getScheme() . '://' . $uri->getHost() . '/' . $this->_canonicalizePath($link);
if (!URI\URL::validate($link)) {
if (!Uri\UriFactory::factory($link)->isValid()) {
$link = null;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Reader/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Reader
/**
* Cache instance
*
* @var \Zend\Cache\Core
* @var \Zend\Cache\Frontend\Core
*/
protected static $_cache = null;

Expand Down Expand Up @@ -111,7 +111,7 @@ class Reader
/**
* Get the Feed cache
*
* @return \Zend\Cache\Core
* @return \Zend\Cache\Frontend\Core
*/
public static function getCache()
{
Expand All @@ -121,10 +121,10 @@ public static function getCache()
/**
* Set the feed cache
*
* @param \Zend\Cache\Core $cache
* @param \Zend\Cache\Frontend\Core $cache
* @return void
*/
public static function setCache(\Zend\Cache\Core $cache)
public static function setCache(\Zend\Cache\Frontend\Core $cache)
{
self::$_cache = $cache;
}
Expand Down
Loading

0 comments on commit 601b75a

Please sign in to comment.