import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Entry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -34,6 +34,11 @@ require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php';
*/
require_once 'Zend/Date.php';
/**
* @see Zend_Uri
*/
require_once 'Zend/Uri.php';
/**
* @category Zend
* @package Zend_Feed_Reader
@ -43,7 +48,7 @@ require_once 'Zend/Date.php';
class Zend_Feed_Reader_Extension_Atom_Entry
extends Zend_Feed_Reader_Extension_EntryAbstract
{
/**
/**
* Get the specified author
*
* @param int $index
@ -264,6 +269,34 @@ class Zend_Feed_Reader_Extension_Atom_Entry
return $this->_data['id'];
}
/**
* Get the base URI of the feed (if set).
*
* @return string|null
*/
public function getBaseUrl()
{
if (array_key_exists('baseUrl', $this->_data)) {
return $this->_data['baseUrl'];
}
$baseUrl = $this->_xpath->evaluate('string('
. $this->getXpathPrefix() . '/@xml:base[1]'
. ')');
if (!$baseUrl) {
$baseUrl = $this->_xpath->evaluate('string(//@xml:base[1])');
}
if (!$baseUrl) {
$baseUrl = null;
}
$this->_data['baseUrl'] = $baseUrl;
return $this->_data['baseUrl'];
}
/**
* Get a specific link
*
@ -303,7 +336,7 @@ class Zend_Feed_Reader_Extension_Atom_Entry
if ($list->length) {
foreach ($list as $link) {
$links[] = $link->value;
$links[] = $this->_absolutiseUri($link->value);
}
}
@ -392,6 +425,7 @@ class Zend_Feed_Reader_Extension_Atom_Entry
if ($list->length) {
$link = $list->item(0)->value;
$link = $this->_absolutiseUri($link);
}
$this->_data['commentlink'] = $link;
@ -418,6 +452,7 @@ class Zend_Feed_Reader_Extension_Atom_Entry
if ($list->length) {
$link = $list->item(0)->value;
$link = $this->_absolutiseUri($link);
}
$this->_data['commentfeedlink'] = $link;
@ -425,6 +460,23 @@ class Zend_Feed_Reader_Extension_Atom_Entry
return $this->_data['commentfeedlink'];
}
/**
* Attempt to absolutise the URI, i.e. if a relative URI apply the
* xml:base value as a prefix to turn into an absolute URI.
*/
protected function _absolutiseUri($link)
{
if (!Zend_Uri::check($link)) {
if (!is_null($this->getBaseUrl())) {
$link = $this->getBaseUrl() . $link;
if (!Zend_Uri::check($link)) {
$link = null;
}
}
}
return $link;
}
/**
* Get an author entry
*

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Feed.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Feed.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -29,13 +29,18 @@ require_once 'Zend/Feed/Reader/Extension/FeedAbstract.php';
*/
require_once 'Zend/Date.php';
/**
* @see Zend_Uri
*/
require_once 'Zend/Uri.php';
/**
* @category Zend
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_Atom_Feed
class Zend_Feed_Reader_Extension_Atom_Feed
extends Zend_Feed_Reader_Extension_FeedAbstract
{
/**
@ -240,7 +245,7 @@ class Zend_Feed_Reader_Extension_Atom_Feed
return $this->_data['generator'];
}
/**
/**
* Get the feed ID
*
* @return string|null
@ -294,6 +299,27 @@ class Zend_Feed_Reader_Extension_Atom_Feed
return $this->_data['language'];
}
/**
* Get the base URI of the feed (if set).
*
* @return string|null
*/
public function getBaseUrl()
{
if (array_key_exists('baseUrl', $this->_data)) {
return $this->_data['baseUrl'];
}
$baseUrl = $this->_xpath->evaluate('string(//@xml:base[1])');
if (!$baseUrl) {
$baseUrl = null;
}
$this->_data['baseUrl'] = $baseUrl;
return $this->_data['baseUrl'];
}
/**
* Get a link to the source website
*
@ -305,10 +331,16 @@ class Zend_Feed_Reader_Extension_Atom_Feed
return $this->_data['link'];
}
$link = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:link/@href)');
$link = null;
if (!$link) {
$link = null;
$list = $this->_xpath->query(
$this->getXpathPrefix() . '/atom:link[@rel="alternate"]/@href' . '|' .
$this->getXpathPrefix() . '/atom:link[not(@rel)]/@href'
);
if ($list->length) {
$link = $list->item(0)->nodeValue;
$link = $this->_absolutiseUri($link);
}
$this->_data['link'] = $link;
@ -329,9 +361,7 @@ class Zend_Feed_Reader_Extension_Atom_Feed
$link = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:link[@rel="self"]/@href)');
if (!$link) {
$link = null;
}
$link = $this->_absolutiseUri($link);
$this->_data['feedlink'] = $link;
@ -360,7 +390,7 @@ class Zend_Feed_Reader_Extension_Atom_Feed
return $this->_data['title'];
}
/**
/**
* Get an author entry in RSS format
*
* @param DOMElement $element
@ -399,12 +429,29 @@ class Zend_Feed_Reader_Extension_Atom_Feed
return null;
}
/**
* Attempt to absolutise the URI, i.e. if a relative URI apply the
* xml:base value as a prefix to turn into an absolute URI.
*/
protected function _absolutiseUri($link)
{
if (!Zend_Uri::check($link)) {
if (!is_null($this->getBaseUrl())) {
$link = $this->getBaseUrl() . $link;
if (!Zend_Uri::check($link)) {
$link = null;
}
}
}
return $link;
}
/**
* Register the default namespaces for the current feed format
*/
protected function _registerNamespaces()
{
if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
|| $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03
) {
return; // pre-registered at Feed level

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Entry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -35,13 +35,13 @@ require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_Content_Entry
class Zend_Feed_Reader_Extension_Content_Entry
extends Zend_Feed_Reader_Extension_EntryAbstract
{
public function getContent()
{
if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
&& $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090
) {
$content = $this->_xpath->evaluate('string('.$this->getXpathPrefix().'/content:encoded)');

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Feed.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Feed.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -30,7 +30,7 @@ require_once 'Zend/Feed/Reader/Extension/FeedAbstract.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_CreativeCommons_Feed
class Zend_Feed_Reader_Extension_CreativeCommons_Feed
extends Zend_Feed_Reader_Extension_FeedAbstract
{
/**

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 16711 2009-07-14 16:10:54Z matthew $
* @version $Id: Entry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -40,7 +40,7 @@ require_once 'Zend/Date.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_DublinCore_Entry
class Zend_Feed_Reader_Extension_DublinCore_Entry
extends Zend_Feed_Reader_Extension_EntryAbstract
{
/**
@ -87,7 +87,7 @@ class Zend_Feed_Reader_Extension_DublinCore_Entry
if ($list->length) {
foreach ($list as $author) {
if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20
if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20
&& preg_match("/\(([^\)]+)\)/", $author->nodeValue, $matches, PREG_OFFSET_CAPTURE)
) {
$authors[] = $matches[1][0];

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Feed.php 16711 2009-07-14 16:10:54Z matthew $
* @version $Id: Feed.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -35,10 +35,10 @@ require_once 'Zend/Date.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_DublinCore_Feed
class Zend_Feed_Reader_Extension_DublinCore_Feed
extends Zend_Feed_Reader_Extension_FeedAbstract
{
/**
/**
* Get a single author
*
* @param int $index

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: EntryAbstract.php 16711 2009-07-14 16:10:54Z matthew $
* @version $Id: EntryAbstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -89,11 +89,11 @@ abstract class Zend_Feed_Reader_Extension_EntryAbstract
$this->_data['type'] = Zend_Feed_Reader::detectType($feed);
}
// set the XPath query prefix for the entry being queried
if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_10
if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_10
|| $this->getType() == Zend_Feed_Reader::TYPE_RSS_090
) {
$this->setXpathPrefix('//rss:item[' . ($this->_entryKey+1) . ']');
} elseif ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
} elseif ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
|| $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03
) {
$this->setXpathPrefix('//atom:entry[' . ($this->_entryKey+1) . ']');
@ -123,7 +123,7 @@ abstract class Zend_Feed_Reader_Extension_EntryAbstract
return $assumed;
}
/**
/**
* Get the entry type
*
* @return string
@ -178,8 +178,8 @@ abstract class Zend_Feed_Reader_Extension_EntryAbstract
/**
* Set the XPath prefix
*
* @param string $prefix
*
* @param string $prefix
* @return Zend_Feed_Reader_Extension_EntryAbstract
*/
public function setXpathPrefix($prefix)
@ -190,7 +190,7 @@ abstract class Zend_Feed_Reader_Extension_EntryAbstract
/**
* Register XML namespaces
*
*
* @return void
*/
protected abstract function _registerNamespaces();

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FeedAbstract.php 16711 2009-07-14 16:10:54Z matthew $
* @version $Id: FeedAbstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -43,7 +43,7 @@ require_once 'Zend/Feed/Reader/Entry/Rss.php';
*/
abstract class Zend_Feed_Reader_Extension_FeedAbstract
{
/**
/**
* Parsed feed data
*
* @var array
@ -141,8 +141,8 @@ abstract class Zend_Feed_Reader_Extension_FeedAbstract
/**
* Get the XPath prefix
*
* @return string
*
* @return string
*/
public function getXpathPrefix()
{

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Entry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -35,7 +35,7 @@ require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_Slash_Entry
class Zend_Feed_Reader_Extension_Slash_Entry
extends Zend_Feed_Reader_Extension_EntryAbstract
{
/**

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Feed.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Feed.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -32,7 +32,7 @@ require_once 'Zend/Date.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_Syndication_Feed
class Zend_Feed_Reader_Extension_Syndication_Feed
extends Zend_Feed_Reader_Extension_FeedAbstract
{
/**
@ -57,7 +57,7 @@ class Zend_Feed_Reader_Extension_Syndication_Feed
case 'yearly':
return $period;
default:
throw new Zend_Feed_Exception("Feed specified invalid update period: '$period'."
throw new Zend_Feed_Exception("Feed specified invalid update period: '$period'."
. " Must be one of hourly, daily, weekly or yearly"
);
}
@ -100,13 +100,13 @@ class Zend_Feed_Reader_Extension_Syndication_Feed
switch ($period)
{
//intentional fall through
case 'yearly':
case 'yearly':
$ticks *= 52; //TODO: fix generalisation, how?
case 'weekly':
case 'weekly':
$ticks *= 7;
case 'daily':
case 'daily':
$ticks *= 24;
case 'hourly':
case 'hourly':
$ticks *= 3600;
break;
default: //Never arrive here, exception thrown in getPeriod()

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Entry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -30,12 +30,12 @@ require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_Thread_Entry
class Zend_Feed_Reader_Extension_Thread_Entry
extends Zend_Feed_Reader_Extension_EntryAbstract
{
/**
* Get the "in-reply-to" value
*
*
* @return string
*/
public function getInReplyTo()

View File

@ -16,7 +16,7 @@
* @package Zend_Feed_Reader
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Entry.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -35,7 +35,7 @@ require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php';
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Feed_Reader_Extension_WellFormedWeb_Entry
class Zend_Feed_Reader_Extension_WellFormedWeb_Entry
extends Zend_Feed_Reader_Extension_EntryAbstract
{
/**