Permalink
Browse files

More registry fixes.

Add Parse_Date, change Source to using the registry, and fix up a lot of occurrances of Misc::*()
  • Loading branch information...
1 parent 0b911ec commit 6e876906a96e2c6fe265a29b92ff73480794c099 @rmccue rmccue committed Jan 16, 2012
Showing with 83 additions and 76 deletions.
  1. +42 −42 SimplePie/Item.php
  2. +9 −9 SimplePie/Locator.php
  3. +2 −1 SimplePie/Registry.php
  4. +3 −3 SimplePie/Sanitize.php
  5. +27 −21 SimplePie/Source.php
View
84 SimplePie/Item.php
@@ -334,7 +334,7 @@ public function get_categories()
if (!empty($categories))
{
- return SimplePie_Misc::array_unique($categories);
+ return $this->registry->call('Misc', 'array_unique', array($categories));
}
else
{
@@ -418,7 +418,7 @@ public function get_contributors()
if (!empty($contributors))
{
- return SimplePie_Misc::array_unique($contributors);
+ return $this->registry->call('Misc', 'array_unique', array($contributors));
}
else
{
@@ -492,7 +492,7 @@ public function get_authors()
if (!empty($authors))
{
- return SimplePie_Misc::array_unique($authors);
+ return $this->registry->call('Misc', 'array_unique', array($authors));
}
elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
{
@@ -512,7 +512,7 @@ public function get_copyright()
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
{
@@ -567,7 +567,7 @@ public function get_date($date_format = 'j F Y, g:i a')
if (!empty($this->data['date']['raw']))
{
- $parser = SimplePie_Parse_Date::get();
+ $parser = $this->registry->call('Parse_Date', 'get');
$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
}
else
@@ -607,7 +607,7 @@ public function get_updated_date($date_format = 'j F Y, g:i a')
if (!empty($this->data['updated']['raw']))
{
- $parser = SimplePie_Parse_Date::get();
+ $parser = $this->registry->call('Parse_Date', 'get');
$this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']);
}
else
@@ -750,7 +750,7 @@ public function get_links($rel = 'alternate')
$keys = array_keys($this->data['links']);
foreach ($keys as $key)
{
- if (SimplePie_Misc::is_isegment_nz_nc($key))
+ if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
{
if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
{
@@ -896,7 +896,7 @@ public function get_enclosures()
}
if (is_array($captions_parent))
{
- $captions_parent = array_values(SimplePie_Misc::array_unique($captions_parent));
+ $captions_parent = array_values($this->registry->call('Misc', 'array_unique', array($captions_parent)));
}
// CATEGORIES
@@ -971,7 +971,7 @@ public function get_enclosures()
}
if (is_array($categories_parent))
{
- $categories_parent = array_values(SimplePie_Misc::array_unique($categories_parent));
+ $categories_parent = array_values($this->registry('Misc', 'array_unique', array($categories_parent)));
}
// COPYRIGHT
@@ -1059,7 +1059,7 @@ public function get_enclosures()
}
if (is_array($credits_parent))
{
- $credits_parent = array_values(SimplePie_Misc::array_unique($credits_parent));
+ $credits_parent = array_values($this->registry('Misc', 'array_unique', array($credits_parent)));
}
// DESCRIPTION
@@ -1151,7 +1151,7 @@ public function get_enclosures()
}
if (is_array($hashes_parent))
{
- $hashes_parent = array_values(SimplePie_Misc::array_unique($hashes_parent));
+ $hashes_parent = array_values($this->registry('Misc', 'array_unique', array($hashes_parent)));
}
// KEYWORDS
@@ -1205,7 +1205,7 @@ public function get_enclosures()
}
if (is_array($keywords_parent))
{
- $keywords_parent = array_values(SimplePie_Misc::array_unique($keywords_parent));
+ $keywords_parent = array_values($this->registry('Misc', 'array_unique', array($keywords_parent)));
}
// PLAYER
@@ -1295,7 +1295,7 @@ public function get_enclosures()
}
if (is_array($ratings_parent))
{
- $ratings_parent = array_values(SimplePie_Misc::array_unique($ratings_parent));
+ $ratings_parent = array_values($this->registry('Misc', 'array_unique', array($ratings_parent)));
}
// RESTRICTIONS
@@ -1373,7 +1373,7 @@ public function get_enclosures()
}
if (is_array($restrictions_parent))
{
- $restrictions_parent = array_values(SimplePie_Misc::array_unique($restrictions_parent));
+ $restrictions_parent = array_values($this->registry('Misc', 'array_unique', array($restrictions_parent)));
}
// THUMBNAILS
@@ -1578,7 +1578,7 @@ public function get_enclosures()
}
if (is_array($captions))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = array_values($this->registry('Misc', 'array_unique', array($captions)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
@@ -1614,7 +1614,7 @@ public function get_enclosures()
}
if (is_array($captions))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = array_values($this->registry('Misc', 'array_unique', array($captions)));
}
}
else
@@ -1677,15 +1677,15 @@ public function get_enclosures()
}
if (is_array($categories) && is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));
+ $categories = array_values($this->registry('Misc', 'array_unique', array(array_merge($categories, $categories_parent))));
}
elseif (is_array($categories))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories));
+ $categories = array_values($this->registry('Misc', 'array_unique', array($categories)));
}
elseif (is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories_parent));
+ $categories = array_values($this->registry('Misc', 'array_unique', array($categories_parent)));
}
// COPYRIGHTS
@@ -1750,7 +1750,7 @@ public function get_enclosures()
}
if (is_array($credits))
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $credits = array_values($this->registry('Misc', 'array_unique', array($credits)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
@@ -1780,7 +1780,7 @@ public function get_enclosures()
}
if (is_array($credits))
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $credits = array_values($this->registry('Misc', 'array_unique', array($credits)));
}
}
else
@@ -1825,7 +1825,7 @@ public function get_enclosures()
}
if (is_array($hashes))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $hashes = array_values($this->registry('Misc', 'array_unique', array($hashes)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
@@ -1850,7 +1850,7 @@ public function get_enclosures()
}
if (is_array($hashes))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $hashes = array_values($this->registry('Misc', 'array_unique', array($hashes)));
}
}
else
@@ -1872,7 +1872,7 @@ public function get_enclosures()
}
if (is_array($keywords))
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $keywords = array_values($this->registry('Misc', 'array_unique', array($keywords)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
@@ -1888,7 +1888,7 @@ public function get_enclosures()
}
if (is_array($keywords))
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $keywords = array_values($this->registry('Misc', 'array_unique', array($keywords)));
}
}
else
@@ -1933,7 +1933,7 @@ public function get_enclosures()
}
if (is_array($ratings))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $ratings = array_values($this->registry('Misc', 'array_unique', array($ratings)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
@@ -1958,7 +1958,7 @@ public function get_enclosures()
}
if (is_array($ratings))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $ratings = array_values($this->registry('Misc', 'array_unique', array($ratings)));
}
}
else
@@ -1990,7 +1990,7 @@ public function get_enclosures()
}
if (is_array($restrictions))
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $restrictions = array_values($this->registry('Misc', 'array_unique', array($restrictions)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
@@ -2016,7 +2016,7 @@ public function get_enclosures()
}
if (is_array($restrictions))
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $restrictions = array_values($this->registry('Misc', 'array_unique', array($restrictions)));
}
}
else
@@ -2033,7 +2033,7 @@ public function get_enclosures()
}
if (is_array($thumbnails))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $thumbnails = array_values($this->registry('Misc', 'array_unique', array($thumbnails)));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
@@ -2044,7 +2044,7 @@ public function get_enclosures()
}
if (is_array($thumbnails))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $thumbnails = array_values($this->registry('Misc', 'array_unique', array($thumbnails)));
}
}
else
@@ -2202,7 +2202,7 @@ public function get_enclosures()
}
if (is_array($captions))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = array_values($this->registry('Misc', 'array_unique', array($captions)));
}
}
else
@@ -2239,15 +2239,15 @@ public function get_enclosures()
}
if (is_array($categories) && is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));
+ $categories = array_values($this->registry('Misc', 'array_unique', array(array_merge($categories, $categories_parent))));
}
elseif (is_array($categories))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories));
+ $categories = array_values($this->registry('Misc', 'array_unique', array($categories)));
}
elseif (is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories_parent));
+ $categories = array_values($this->registry('Misc', 'array_unique', array($categories_parent)));
}
else
{
@@ -2302,7 +2302,7 @@ public function get_enclosures()
}
if (is_array($credits))
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $credits = array_values($this->registry('Misc', 'array_unique', array($credits)));
}
}
else
@@ -2343,7 +2343,7 @@ public function get_enclosures()
}
if (is_array($hashes))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $hashes = array_values($this->registry('Misc', 'array_unique', array($hashes)));
}
}
else
@@ -2365,7 +2365,7 @@ public function get_enclosures()
}
if (is_array($keywords))
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $keywords = array_values($this->registry('Misc', 'array_unique', array($keywords)));
}
}
else
@@ -2406,7 +2406,7 @@ public function get_enclosures()
}
if (is_array($ratings))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $ratings = array_values($this->registry('Misc', 'array_unique', array($ratings)));
}
}
else
@@ -2438,7 +2438,7 @@ public function get_enclosures()
}
if (is_array($restrictions))
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $restrictions = array_values($this->registry('Misc', 'array_unique', array($restrictions)));
}
}
else
@@ -2455,7 +2455,7 @@ public function get_enclosures()
}
if (is_array($thumbnails))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $thumbnails = array_values($this->registry('Misc', 'array_unique', array($thumbnails)));
}
}
else
@@ -2589,7 +2589,7 @@ public function get_enclosures()
$this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
}
- $this->data['enclosures'] = array_values(SimplePie_Misc::array_unique($this->data['enclosures']));
+ $this->data['enclosures'] = array_values($this->registry('Misc', 'array_unique', array($this->data['enclosures'])));
}
if (!empty($this->data['enclosures']))
{
View
18 SimplePie/Locator.php
@@ -169,7 +169,7 @@ public function get_base()
{
if ($element->hasAttribute('href'))
{
- $this->base = SimplePie_Misc::absolutize_url(trim($element->getAttribute('href')), $this->http_base);
+ $this->base = $this->registry->call('Misc', 'absolutize_url', array(trim($element->getAttribute('href')), $this->http_base));
$this->base_location = $element->getLineNo();
break;
}
@@ -205,18 +205,18 @@ protected function search_elements_by_tag($name, &$done, $feeds)
}
if ($link->hasAttribute('href') && $link->hasAttribute('rel'))
{
- $rel = array_unique(SimplePie_Misc::space_seperated_tokens(strtolower($link->getAttribute('rel'))));
+ $rel = array_unique($this->registry->call('Misc', 'space_seperated_tokens', array(strtolower($link->getAttribute('rel')))));
if ($this->base_location < $link->getLineNo())
{
- $href = SimplePie_Misc::absolutize_url(trim($link->getAttribute('href')), $this->base);
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));
}
else
{
- $href = SimplePie_Misc::absolutize_url(trim($link->getAttribute('href')), $this->http_base);
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));
}
- if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower(SimplePie_Misc::parse_mime($link->getAttribute('type'))), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))
+ if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href]))
{
$this->checked_feeds++;
$headers = array(
@@ -243,19 +243,19 @@ public function get_links()
if ($link->hasAttribute('href'))
{
$href = trim($link->getAttribute('href'));
- $parsed = SimplePie_Misc::parse_url($href);
+ $parsed = $this->registry->call('Misc', 'parse_url', array($href));
if ($parsed['scheme'] === '' || preg_match('/^(http(s)|feed)?$/i', $parsed['scheme']))
{
if ($this->base_location < $link->getLineNo())
{
- $href = SimplePie_Misc::absolutize_url(trim($link->getAttribute('href')), $this->base);
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base));
}
else
{
- $href = SimplePie_Misc::absolutize_url(trim($link->getAttribute('href')), $this->http_base);
+ $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base));
}
- $current = SimplePie_Misc::parse_url($this->file->url);
+ $current = $this->registry->call('Misc', 'parse_url', array($this->file->url));
if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority'])
{
View
3 SimplePie/Registry.php
@@ -76,7 +76,8 @@ class SimplePie_Registry
'Content_Type_Sniffer' => 'SimplePie_Content_Type_Sniffer',
'Source' => 'SimplePie_Source',
'Misc' => 'SimplePie_Misc',
- 'XML_Declaration_Parser' => 'SimplePie_XML_Declaration_Parser'
+ 'XML_Declaration_Parser' => 'SimplePie_XML_Declaration_Parser',
+ 'Parse_Date' => 'SimplePie_Parse_Date',
);
/**
View
6 SimplePie/Sanitize.php
@@ -344,7 +344,7 @@ public function sanitize($data, $type, $base = '')
if ($type & SIMPLEPIE_CONSTRUCT_IRI)
{
- $data = SimplePie_Misc::absolutize_url($data, $base);
+ $data = $this->registry->call('Misc', 'absolutize_url', array($data, $base));
}
if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI))
@@ -354,7 +354,7 @@ public function sanitize($data, $type, $base = '')
if ($this->output_encoding !== 'UTF-8')
{
- $data = SimplePie_Misc::change_encoding($data, 'UTF-8', $this->output_encoding);
+ $data = $this->registry->call('Misc', 'change_encoding', array($data, 'UTF-8', $this->output_encoding));
}
}
return $data;
@@ -399,7 +399,7 @@ public function replace_urls(&$document, $tag, $attributes)
{
if ($element->hasAttribute($attribute))
{
- $value = SimplePie_Misc::absolutize_url($element->getAttribute($attribute), $this->base);
+ $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base));
$element->setAttribute($attribute, $value);
}
}
View
48 SimplePie/Source.php
@@ -55,13 +55,19 @@ class SimplePie_Source
{
var $item;
var $data = array();
+ protected $registry;
public function __construct($item, $data)
{
$this->item = $item;
$this->data = $data;
}
+ public function set_registry(&$registry)
+ {
+ $this->registry = &$registry;
+ }
+
public function __toString()
{
return md5(serialize($this->data));
@@ -98,11 +104,11 @@ public function get_title()
{
if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
{
@@ -164,7 +170,7 @@ public function get_categories()
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories[] = new $this->item->feed->category_class($term, $scheme, $label);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
{
@@ -179,20 +185,20 @@ public function get_categories()
{
$scheme = null;
}
- $categories[] = new $this->item->feed->category_class($term, $scheme, null);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, null));
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
{
- $categories[] = new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)
{
- $categories[] = new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
if (!empty($categories))
{
- return SimplePie_Misc::array_unique($categories);
+ return $this->registry->call('Misc', 'array_unique', array($categories));
}
else
{
@@ -235,7 +241,7 @@ public function get_authors()
}
if ($name !== null || $email !== null || $uri !== null)
{
- $authors[] = new $this->item->feed->author_class($name, $uri, $email);
+ $authors[] = $this->registry->create('Author', array($name, $uri, $email));
}
}
if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
@@ -257,25 +263,25 @@ public function get_authors()
}
if ($name !== null || $email !== null || $url !== null)
{
- $authors[] = new $this->item->feed->author_class($name, $url, $email);
+ $authors[] = $this->registry->create('Author', array($name, $url, $email));
}
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
{
- $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
{
- $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
{
- $authors[] = new $this->item->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
if (!empty($authors))
{
- return SimplePie_Misc::array_unique($authors);
+ return $this->registry->call('Misc', 'array_unique', array($authors));
}
else
{
@@ -318,7 +324,7 @@ public function get_contributors()
}
if ($name !== null || $email !== null || $uri !== null)
{
- $contributors[] = new $this->item->feed->author_class($name, $uri, $email);
+ $contributors[] = $this->registry->create('Author', array($name, $uri, $email));
}
}
foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
@@ -340,13 +346,13 @@ public function get_contributors()
}
if ($name !== null || $email !== null || $url !== null)
{
- $contributors[] = new $this->item->feed->author_class($name, $url, $email);
+ $contributors[] = $this->registry->create('Author', array($name, $url, $email));
}
}
if (!empty($contributors))
{
- return SimplePie_Misc::array_unique($contributors);
+ return $this->registry->call('Misc', 'array_unique', array($contributors));
}
else
{
@@ -419,7 +425,7 @@ public function get_links($rel = 'alternate')
$keys = array_keys($this->data['links']);
foreach ($keys as $key)
{
- if (SimplePie_Misc::is_isegment_nz_nc($key))
+ if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
{
if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
{
@@ -453,11 +459,11 @@ public function get_description()
{
if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
{
@@ -497,11 +503,11 @@ public function get_copyright()
{
if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright'))
{

0 comments on commit 6e87690

Please sign in to comment.