117 return md5(serialize($this->data));
125 if ((version_compare(PHP_VERSION,
'5.3',
'<') || !gc_enabled()) && !ini_get(
'zend.ze1_compatibility_mode'))
147 if (isset($this->data[
'child'][$namespace][$tag]))
149 return $this->data[
'child'][$namespace][$tag];
167 return $this->feed->get_base($element);
182 return $this->feed->sanitize(
$data, $type, $base);
245 elseif (($return = $this->
get_title()) !== null)
256 return md5(serialize($this->data));
270 if (!isset($this->data[
'title']))
274 $this->data[
'title'] = $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
278 $this->data[
'title'] = $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_03_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
302 $this->data[
'title'] = null;
305 return $this->data[
'title'];
327 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
331 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_03_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
362 elseif (!$description_only)
390 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_content_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
394 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_03_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
400 elseif (!$content_only)
420 if (isset($categories[$key]))
422 return $categories[$key];
440 $categories = array();
447 if (isset($category[
'attribs'][
''][
'term']))
451 if (isset($category[
'attribs'][
''][
'scheme']))
455 if (isset($category[
'attribs'][
''][
'label']))
459 $categories[] = $this->registry->create(
'Category', array($term, $scheme, $label));
466 if (isset($category[
'attribs'][
''][
'domain']))
474 $categories[] = $this->registry->create(
'Category', array($term, $scheme, null));
485 if (!empty($categories))
487 return array_unique($categories);
505 if (isset($authors[$key]))
507 return $authors[$key];
525 if (isset($contributors[$key]))
527 return $contributors[$key];
545 $contributors = array();
555 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0][
'data']))
557 $uri = $this->
sanitize($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0][
'data'],
SIMPLEPIE_CONSTRUCT_IRI, $this->
get_base($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0]));
559 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'email'][0][
'data']))
563 if ($name !== null || $email !== null || $uri !== null)
565 $contributors[] = $this->registry->create(
'Author', array($name, $uri, $email));
577 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data']))
579 $url = $this->
sanitize($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data'],
SIMPLEPIE_CONSTRUCT_IRI, $this->
get_base($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0]));
581 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'email'][0][
'data']))
585 if ($name !== null || $email !== null || $url !== null)
587 $contributors[] = $this->registry->create(
'Author', array($name, $url, $email));
591 if (!empty($contributors))
593 return array_unique($contributors);
621 if (isset($author[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0][
'data']))
625 if (isset($author[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'email'][0][
'data']))
629 if ($name !== null || $email !== null || $uri !== null)
631 $authors[] = $this->registry->create(
'Author', array($name, $uri, $email));
643 if (isset($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data']))
645 $url = $this->
sanitize($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data'],
SIMPLEPIE_CONSTRUCT_IRI, $this->
get_base($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0]));
647 if (isset($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'email'][0][
'data']))
651 if ($name !== null || $email !== null || $url !== null)
653 $authors[] = $this->registry->create(
'Author', array($name, $url, $email));
673 if (!empty($authors))
675 return array_unique($authors);
677 elseif (($source = $this->
get_source()) && ($authors = $source->get_authors()))
681 elseif ($authors = $this->feed->get_authors())
703 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
733 public function get_date($date_format =
'j F Y, g:i a')
735 if (!isset($this->data[
'date']))
739 $this->data[
'date'][
'raw'] = $return[0][
'data'];
743 $this->data[
'date'][
'raw'] = $return[0][
'data'];
747 $this->data[
'date'][
'raw'] = $return[0][
'data'];
751 $this->data[
'date'][
'raw'] = $return[0][
'data'];
755 $this->data[
'date'][
'raw'] = $return[0][
'data'];
759 $this->data[
'date'][
'raw'] = $return[0][
'data'];
763 $this->data[
'date'][
'raw'] = $return[0][
'data'];
767 $this->data[
'date'][
'raw'] = $return[0][
'data'];
770 if (!empty($this->data[
'date'][
'raw']))
772 $parser = $this->registry->call(
'Parse_Date',
'get');
773 $this->data[
'date'][
'parsed'] = $parser->parse($this->data[
'date'][
'raw']);
777 $this->data[
'date'] = null;
780 if ($this->data[
'date'])
782 $date_format = (string) $date_format;
783 switch ($date_format)
789 return $this->data[
'date'][
'parsed'];
792 return date($date_format, $this->data[
'date'][
'parsed']);
814 if (!isset($this->data[
'updated']))
818 $this->data[
'updated'][
'raw'] = $return[0][
'data'];
821 if (!empty($this->data[
'updated'][
'raw']))
823 $parser = $this->registry->call(
'Parse_Date',
'get');
824 $this->data[
'updated'][
'parsed'] = $parser->parse($this->data[
'date'][
'raw']);
828 $this->data[
'updated'] = null;
831 if ($this->data[
'updated'])
833 $date_format = (string) $date_format;
834 switch ($date_format)
840 return $this->data[
'updated'][
'parsed'];
843 return date($date_format, $this->data[
'updated'][
'parsed']);
871 elseif (($date = $this->
get_date(
'U')) !== null && $date !==
false)
873 return strftime($date_format, $date);
896 return gmdate($date_format, $date);
914 return gmdate($date_format, $date);
935 elseif ($enclosure !== null)
937 return $enclosure->get_link();
953 public function get_link($key = 0, $rel =
'alternate')
956 if ($links[$key] !== null)
977 if (!isset($this->data[
'links']))
979 $this->data[
'links'] = array();
982 if (isset($link[
'attribs'][
''][
'href']))
984 $link_rel = (isset($link[
'attribs'][
''][
'rel'])) ? $link[
'attribs'][
''][
'rel'] :
'alternate';
991 if (isset($link[
'attribs'][
''][
'href']))
993 $link_rel = (isset($link[
'attribs'][
''][
'rel'])) ? $link[
'attribs'][
''][
'rel'] :
'alternate';
1011 if (!isset($links[0][
'attribs'][
''][
'isPermaLink']) || strtolower(trim($links[0][
'attribs'][
''][
'isPermaLink'])) ===
'true')
1017 $keys = array_keys($this->data[
'links']);
1018 foreach ($keys as $key)
1020 if ($this->registry->call(
'Misc',
'is_isegment_nz_nc', array($key)))
1034 $this->data[
'links'][substr($key, 41)] =& $this->data[
'links'][$key];
1036 $this->data[
'links'][$key] = array_unique($this->data[
'links'][$key]);
1039 if (isset($this->data[
'links'][$rel]))
1041 return $this->data[
'links'][$rel];
1062 if (isset($enclosures[$key]))
1064 return $enclosures[$key];
1088 if (!isset($this->data[
'enclosures']))
1090 $this->data[
'enclosures'] = array();
1093 $captions_parent = null;
1094 $categories_parent = null;
1095 $copyrights_parent = null;
1096 $credits_parent = null;
1097 $description_parent = null;
1098 $duration_parent = null;
1099 $hashes_parent = null;
1100 $keywords_parent = null;
1101 $player_parent = null;
1102 $ratings_parent = null;
1103 $restrictions_parent = null;
1104 $thumbnails_parent = null;
1105 $title_parent = null;
1113 foreach ($captions as $caption)
1115 $caption_type = null;
1116 $caption_lang = null;
1117 $caption_startTime = null;
1118 $caption_endTime = null;
1119 $caption_text = null;
1120 if (isset($caption[
'attribs'][
''][
'type']))
1124 if (isset($caption[
'attribs'][
''][
'lang']))
1128 if (isset($caption[
'attribs'][
''][
'start']))
1132 if (isset($caption[
'attribs'][
''][
'end']))
1136 if (isset($caption[
'data']))
1140 $captions_parent[] = $this->registry->create(
'Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
1145 foreach ($captions as $caption)
1147 $caption_type = null;
1148 $caption_lang = null;
1149 $caption_startTime = null;
1150 $caption_endTime = null;
1151 $caption_text = null;
1152 if (isset($caption[
'attribs'][
''][
'type']))
1156 if (isset($caption[
'attribs'][
''][
'lang']))
1160 if (isset($caption[
'attribs'][
''][
'start']))
1164 if (isset($caption[
'attribs'][
''][
'end']))
1168 if (isset($caption[
'data']))
1172 $captions_parent[] = $this->registry->create(
'Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
1175 if (is_array($captions_parent))
1177 $captions_parent = array_values(array_unique($captions_parent));
1186 if (isset($category[
'data']))
1190 if (isset($category[
'attribs'][
''][
'scheme']))
1196 $scheme =
'http://search.yahoo.com/mrss/category_schema';
1198 if (isset($category[
'attribs'][
''][
'label']))
1202 $categories_parent[] = $this->registry->create(
'Category', array($term, $scheme, $label));
1209 if (isset($category[
'data']))
1213 if (isset($category[
'attribs'][
''][
'scheme']))
1219 $scheme =
'http://search.yahoo.com/mrss/category_schema';
1221 if (isset($category[
'attribs'][
''][
'label']))
1225 $categories_parent[] = $this->registry->create(
'Category', array($term, $scheme, $label));
1230 $scheme =
'http://www.itunes.com/dtds/podcast-1.0.dtd';
1232 if (isset($category[
'attribs'][
''][
'text']))
1236 $categories_parent[] = $this->registry->create(
'Category', array($term, $scheme, $label));
1240 foreach ((array) $category[
'child'][SIMPLEPIE_NAMESPACE_ITUNES][
'category'] as $subcategory)
1242 if (isset($subcategory[
'attribs'][
''][
'text']))
1246 $categories_parent[] = $this->registry->create(
'Category', array($term, $scheme, $label));
1250 if (is_array($categories_parent))
1252 $categories_parent = array_values(array_unique($categories_parent));
1258 $copyright_url = null;
1259 $copyright_label = null;
1260 if (isset($copyright[0][
'attribs'][
''][
'url']))
1264 if (isset($copyright[0][
'data']))
1268 $copyrights_parent = $this->registry->create(
'Copyright', array($copyright_url, $copyright_label));
1272 $copyright_url = null;
1273 $copyright_label = null;
1274 if (isset($copyright[0][
'attribs'][
''][
'url']))
1278 if (isset($copyright[0][
'data']))
1282 $copyrights_parent = $this->registry->create(
'Copyright', array($copyright_url, $copyright_label));
1288 foreach ($credits as $credit)
1290 $credit_role = null;
1291 $credit_scheme = null;
1292 $credit_name = null;
1293 if (isset($credit[
'attribs'][
''][
'role']))
1297 if (isset($credit[
'attribs'][
''][
'scheme']))
1303 $credit_scheme =
'urn:ebu';
1305 if (isset($credit[
'data']))
1309 $credits_parent[] = $this->registry->create(
'Credit', array($credit_role, $credit_scheme, $credit_name));
1314 foreach ($credits as $credit)
1316 $credit_role = null;
1317 $credit_scheme = null;
1318 $credit_name = null;
1319 if (isset($credit[
'attribs'][
''][
'role']))
1323 if (isset($credit[
'attribs'][
''][
'scheme']))
1329 $credit_scheme =
'urn:ebu';
1331 if (isset($credit[
'data']))
1335 $credits_parent[] = $this->registry->create(
'Credit', array($credit_role, $credit_scheme, $credit_name));
1338 if (is_array($credits_parent))
1340 $credits_parent = array_values(array_unique($credits_parent));
1346 if (isset($description_parent[0][
'data']))
1353 if (isset($description_parent[0][
'data']))
1365 if (isset($duration_parent[0][
'data']))
1368 if (
sizeof($temp) > 0)
1370 $seconds = (int) array_pop($temp);
1372 if (
sizeof($temp) > 0)
1374 $minutes = (int) array_pop($temp);
1375 $seconds += $minutes * 60;
1377 if (
sizeof($temp) > 0)
1379 $hours = (int) array_pop($temp);
1380 $seconds += $hours * 3600;
1383 $duration_parent = $seconds;
1390 foreach ($hashes_iterator as $hash)
1394 if (isset($hash[
'data']))
1398 if (isset($hash[
'attribs'][
''][
'algo']))
1406 $hashes_parent[] = $algo.
':'.$value;
1411 foreach ($hashes_iterator as $hash)
1415 if (isset($hash[
'data']))
1419 if (isset($hash[
'attribs'][
''][
'algo']))
1427 $hashes_parent[] = $algo.
':'.$value;
1430 if (is_array($hashes_parent))
1432 $hashes_parent = array_values(array_unique($hashes_parent));
1438 if (isset($keywords[0][
'data']))
1441 foreach ($temp as $word)
1443 $keywords_parent[] = trim($word);
1450 if (isset($keywords[0][
'data']))
1453 foreach ($temp as $word)
1455 $keywords_parent[] = trim($word);
1462 if (isset($keywords[0][
'data']))
1465 foreach ($temp as $word)
1467 $keywords_parent[] = trim($word);
1474 if (isset($keywords[0][
'data']))
1477 foreach ($temp as $word)
1479 $keywords_parent[] = trim($word);
1484 if (is_array($keywords_parent))
1486 $keywords_parent = array_values(array_unique($keywords_parent));
1492 if (isset($player_parent[0][
'attribs'][
''][
'url']))
1499 if (isset($player_parent[0][
'attribs'][
''][
'url']))
1508 foreach ($ratings as $rating)
1510 $rating_scheme = null;
1511 $rating_value = null;
1512 if (isset($rating[
'attribs'][
''][
'scheme']))
1518 $rating_scheme =
'urn:simple';
1520 if (isset($rating[
'data']))
1524 $ratings_parent[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
1529 foreach ($ratings as $rating)
1531 $rating_scheme =
'urn:itunes';
1532 $rating_value = null;
1533 if (isset($rating[
'data']))
1537 $ratings_parent[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
1542 foreach ($ratings as $rating)
1544 $rating_scheme = null;
1545 $rating_value = null;
1546 if (isset($rating[
'attribs'][
''][
'scheme']))
1552 $rating_scheme =
'urn:simple';
1554 if (isset($rating[
'data']))
1558 $ratings_parent[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
1563 foreach ($ratings as $rating)
1565 $rating_scheme =
'urn:itunes';
1566 $rating_value = null;
1567 if (isset($rating[
'data']))
1571 $ratings_parent[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
1574 if (is_array($ratings_parent))
1576 $ratings_parent = array_values(array_unique($ratings_parent));
1582 foreach ($restrictions as $restriction)
1584 $restriction_relationship = null;
1585 $restriction_type = null;
1586 $restriction_value = null;
1587 if (isset($restriction[
'attribs'][
''][
'relationship']))
1591 if (isset($restriction[
'attribs'][
''][
'type']))
1595 if (isset($restriction[
'data']))
1599 $restrictions_parent[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1604 foreach ($restrictions as $restriction)
1606 $restriction_relationship =
'allow';
1607 $restriction_type = null;
1608 $restriction_value =
'itunes';
1609 if (isset($restriction[
'data']) && strtolower($restriction[
'data']) ===
'yes')
1611 $restriction_relationship =
'deny';
1613 $restrictions_parent[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1618 foreach ($restrictions as $restriction)
1620 $restriction_relationship = null;
1621 $restriction_type = null;
1622 $restriction_value = null;
1623 if (isset($restriction[
'attribs'][
''][
'relationship']))
1627 if (isset($restriction[
'attribs'][
''][
'type']))
1631 if (isset($restriction[
'data']))
1635 $restrictions_parent[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1640 foreach ($restrictions as $restriction)
1642 $restriction_relationship =
'allow';
1643 $restriction_type = null;
1644 $restriction_value =
'itunes';
1645 if (isset($restriction[
'data']) && strtolower($restriction[
'data']) ===
'yes')
1647 $restriction_relationship =
'deny';
1649 $restrictions_parent[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
1652 if (is_array($restrictions_parent))
1654 $restrictions_parent = array_values(array_unique($restrictions_parent));
1664 foreach ($thumbnails as $thumbnail)
1666 if (isset($thumbnail[
'attribs'][
''][
'url']))
1674 foreach ($thumbnails as $thumbnail)
1676 if (isset($thumbnail[
'attribs'][
''][
'url']))
1686 if (isset($title_parent[0][
'data']))
1693 if (isset($title_parent[0][
'data']))
1713 $samplingrate = null;
1723 $description = null;
1728 $restrictions = null;
1738 foreach ((array) $group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'content'] as $content)
1740 if (isset($content[
'attribs'][
''][
'url']))
1753 $samplingrate = null;
1763 $description = null;
1768 $restrictions = null;
1773 if (isset($content[
'attribs'][
''][
'bitrate']))
1777 if (isset($content[
'attribs'][
''][
'channels']))
1781 if (isset($content[
'attribs'][
''][
'duration']))
1787 $duration = $duration_parent;
1789 if (isset($content[
'attribs'][
''][
'expression']))
1793 if (isset($content[
'attribs'][
''][
'framerate']))
1797 if (isset($content[
'attribs'][
''][
'height']))
1801 if (isset($content[
'attribs'][
''][
'lang']))
1805 if (isset($content[
'attribs'][
''][
'fileSize']))
1807 $length = ceil($content[
'attribs'][
''][
'fileSize']);
1809 if (isset($content[
'attribs'][
''][
'medium']))
1813 if (isset($content[
'attribs'][
''][
'samplingrate']))
1817 if (isset($content[
'attribs'][
''][
'type']))
1821 if (isset($content[
'attribs'][
''][
'width']))
1830 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'text']))
1832 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'text'] as $caption)
1834 $caption_type = null;
1835 $caption_lang = null;
1836 $caption_startTime = null;
1837 $caption_endTime = null;
1838 $caption_text = null;
1839 if (isset($caption[
'attribs'][
''][
'type']))
1843 if (isset($caption[
'attribs'][
''][
'lang']))
1847 if (isset($caption[
'attribs'][
''][
'start']))
1851 if (isset($caption[
'attribs'][
''][
'end']))
1855 if (isset($caption[
'data']))
1859 $captions[] = $this->registry->create(
'Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
1861 if (is_array($captions))
1863 $captions = array_values(array_unique($captions));
1866 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'text']))
1868 foreach ($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'text'] as $caption)
1870 $caption_type = null;
1871 $caption_lang = null;
1872 $caption_startTime = null;
1873 $caption_endTime = null;
1874 $caption_text = null;
1875 if (isset($caption[
'attribs'][
''][
'type']))
1879 if (isset($caption[
'attribs'][
''][
'lang']))
1883 if (isset($caption[
'attribs'][
''][
'start']))
1887 if (isset($caption[
'attribs'][
''][
'end']))
1891 if (isset($caption[
'data']))
1895 $captions[] = $this->registry->create(
'Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
1897 if (is_array($captions))
1899 $captions = array_values(array_unique($captions));
1904 $captions = $captions_parent;
1908 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'category']))
1910 foreach ((array) $content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'category'] as $category)
1915 if (isset($category[
'data']))
1919 if (isset($category[
'attribs'][
''][
'scheme']))
1925 $scheme =
'http://search.yahoo.com/mrss/category_schema';
1927 if (isset($category[
'attribs'][
''][
'label']))
1931 $categories[] = $this->registry->create(
'Category', array($term, $scheme, $label));
1934 if (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'category']))
1936 foreach ((array) $group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'category'] as $category)
1941 if (isset($category[
'data']))
1945 if (isset($category[
'attribs'][
''][
'scheme']))
1951 $scheme =
'http://search.yahoo.com/mrss/category_schema';
1953 if (isset($category[
'attribs'][
''][
'label']))
1957 $categories[] = $this->registry->create(
'Category', array($term, $scheme, $label));
1960 if (is_array($categories) && is_array($categories_parent))
1962 $categories = array_values(array_unique(array_merge($categories, $categories_parent)));
1964 elseif (is_array($categories))
1966 $categories = array_values(array_unique($categories));
1968 elseif (is_array($categories_parent))
1970 $categories = array_values(array_unique($categories_parent));
1974 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright']))
1976 $copyright_url = null;
1977 $copyright_label = null;
1978 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright'][0][
'attribs'][
''][
'url']))
1982 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright'][0][
'data']))
1986 $copyrights = $this->registry->create(
'Copyright', array($copyright_url, $copyright_label));
1988 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright']))
1990 $copyright_url = null;
1991 $copyright_label = null;
1992 if (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright'][0][
'attribs'][
''][
'url']))
1996 if (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright'][0][
'data']))
2000 $copyrights = $this->registry->create(
'Copyright', array($copyright_url, $copyright_label));
2004 $copyrights = $copyrights_parent;
2008 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'credit']))
2010 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'credit'] as $credit)
2012 $credit_role = null;
2013 $credit_scheme = null;
2014 $credit_name = null;
2015 if (isset($credit[
'attribs'][
''][
'role']))
2019 if (isset($credit[
'attribs'][
''][
'scheme']))
2025 $credit_scheme =
'urn:ebu';
2027 if (isset($credit[
'data']))
2031 $credits[] = $this->registry->create(
'Credit', array($credit_role, $credit_scheme, $credit_name));
2033 if (is_array($credits))
2035 $credits = array_values(array_unique($credits));
2038 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'credit']))
2040 foreach ($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'credit'] as $credit)
2042 $credit_role = null;
2043 $credit_scheme = null;
2044 $credit_name = null;
2045 if (isset($credit[
'attribs'][
''][
'role']))
2049 if (isset($credit[
'attribs'][
''][
'scheme']))
2055 $credit_scheme =
'urn:ebu';
2057 if (isset($credit[
'data']))
2061 $credits[] = $this->registry->create(
'Credit', array($credit_role, $credit_scheme, $credit_name));
2063 if (is_array($credits))
2065 $credits = array_values(array_unique($credits));
2070 $credits = $credits_parent;
2074 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'description']))
2078 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'description']))
2084 $description = $description_parent;
2088 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'hash']))
2090 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'hash'] as $hash)
2094 if (isset($hash[
'data']))
2098 if (isset($hash[
'attribs'][
''][
'algo']))
2106 $hashes[] = $algo.
':'.$value;
2108 if (is_array($hashes))
2110 $hashes = array_values(array_unique($hashes));
2113 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'hash']))
2115 foreach ($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'hash'] as $hash)
2119 if (isset($hash[
'data']))
2123 if (isset($hash[
'attribs'][
''][
'algo']))
2131 $hashes[] = $algo.
':'.$value;
2133 if (is_array($hashes))
2135 $hashes = array_values(array_unique($hashes));
2140 $hashes = $hashes_parent;
2144 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'keywords']))
2146 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'keywords'][0][
'data']))
2149 foreach ($temp as $word)
2151 $keywords[] = trim($word);
2155 if (is_array($keywords))
2157 $keywords = array_values(array_unique($keywords));
2160 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'keywords']))
2162 if (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'keywords'][0][
'data']))
2165 foreach ($temp as $word)
2167 $keywords[] = trim($word);
2171 if (is_array($keywords))
2173 $keywords = array_values(array_unique($keywords));
2178 $keywords = $keywords_parent;
2182 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'player']))
2186 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'player']))
2192 $player = $player_parent;
2196 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'rating']))
2198 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'rating'] as $rating)
2200 $rating_scheme = null;
2201 $rating_value = null;
2202 if (isset($rating[
'attribs'][
''][
'scheme']))
2208 $rating_scheme =
'urn:simple';
2210 if (isset($rating[
'data']))
2214 $ratings[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
2216 if (is_array($ratings))
2218 $ratings = array_values(array_unique($ratings));
2221 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'rating']))
2223 foreach ($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'rating'] as $rating)
2225 $rating_scheme = null;
2226 $rating_value = null;
2227 if (isset($rating[
'attribs'][
''][
'scheme']))
2233 $rating_scheme =
'urn:simple';
2235 if (isset($rating[
'data']))
2239 $ratings[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
2241 if (is_array($ratings))
2243 $ratings = array_values(array_unique($ratings));
2248 $ratings = $ratings_parent;
2252 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'restriction']))
2254 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'restriction'] as $restriction)
2256 $restriction_relationship = null;
2257 $restriction_type = null;
2258 $restriction_value = null;
2259 if (isset($restriction[
'attribs'][
''][
'relationship']))
2263 if (isset($restriction[
'attribs'][
''][
'type']))
2267 if (isset($restriction[
'data']))
2271 $restrictions[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
2273 if (is_array($restrictions))
2275 $restrictions = array_values(array_unique($restrictions));
2278 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'restriction']))
2280 foreach ($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'restriction'] as $restriction)
2282 $restriction_relationship = null;
2283 $restriction_type = null;
2284 $restriction_value = null;
2285 if (isset($restriction[
'attribs'][
''][
'relationship']))
2289 if (isset($restriction[
'attribs'][
''][
'type']))
2293 if (isset($restriction[
'data']))
2297 $restrictions[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
2299 if (is_array($restrictions))
2301 $restrictions = array_values(array_unique($restrictions));
2306 $restrictions = $restrictions_parent;
2310 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'thumbnail']))
2312 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'thumbnail'] as $thumbnail)
2316 if (is_array($thumbnails))
2318 $thumbnails = array_values(array_unique($thumbnails));
2321 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'thumbnail']))
2323 foreach ($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'thumbnail'] as $thumbnail)
2327 if (is_array($thumbnails))
2329 $thumbnails = array_values(array_unique($thumbnails));
2334 $thumbnails = $thumbnails_parent;
2338 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'title']))
2342 elseif (isset($group[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'title']))
2348 $title = $title_parent;
2351 $this->data[
'enclosures'][] = $this->registry->create(
'Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
2360 foreach ((array) $this->data[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'content'] as $content)
2362 if (isset($content[
'attribs'][
''][
'url']) || isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'player']))
2375 $samplingrate = null;
2385 $description = null;
2390 $restrictions = null;
2395 if (isset($content[
'attribs'][
''][
'bitrate']))
2399 if (isset($content[
'attribs'][
''][
'channels']))
2403 if (isset($content[
'attribs'][
''][
'duration']))
2409 $duration = $duration_parent;
2411 if (isset($content[
'attribs'][
''][
'expression']))
2415 if (isset($content[
'attribs'][
''][
'framerate']))
2419 if (isset($content[
'attribs'][
''][
'height']))
2423 if (isset($content[
'attribs'][
''][
'lang']))
2427 if (isset($content[
'attribs'][
''][
'fileSize']))
2429 $length = ceil($content[
'attribs'][
''][
'fileSize']);
2431 if (isset($content[
'attribs'][
''][
'medium']))
2435 if (isset($content[
'attribs'][
''][
'samplingrate']))
2439 if (isset($content[
'attribs'][
''][
'type']))
2443 if (isset($content[
'attribs'][
''][
'width']))
2447 if (isset($content[
'attribs'][
''][
'url']))
2454 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'text']))
2456 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'text'] as $caption)
2458 $caption_type = null;
2459 $caption_lang = null;
2460 $caption_startTime = null;
2461 $caption_endTime = null;
2462 $caption_text = null;
2463 if (isset($caption[
'attribs'][
''][
'type']))
2467 if (isset($caption[
'attribs'][
''][
'lang']))
2471 if (isset($caption[
'attribs'][
''][
'start']))
2475 if (isset($caption[
'attribs'][
''][
'end']))
2479 if (isset($caption[
'data']))
2483 $captions[] = $this->registry->create(
'Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
2485 if (is_array($captions))
2487 $captions = array_values(array_unique($captions));
2492 $captions = $captions_parent;
2496 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'category']))
2498 foreach ((array) $content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'category'] as $category)
2503 if (isset($category[
'data']))
2507 if (isset($category[
'attribs'][
''][
'scheme']))
2513 $scheme =
'http://search.yahoo.com/mrss/category_schema';
2515 if (isset($category[
'attribs'][
''][
'label']))
2519 $categories[] = $this->registry->create(
'Category', array($term, $scheme, $label));
2522 if (is_array($categories) && is_array($categories_parent))
2524 $categories = array_values(array_unique(array_merge($categories, $categories_parent)));
2526 elseif (is_array($categories))
2528 $categories = array_values(array_unique($categories));
2530 elseif (is_array($categories_parent))
2532 $categories = array_values(array_unique($categories_parent));
2540 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright']))
2542 $copyright_url = null;
2543 $copyright_label = null;
2544 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright'][0][
'attribs'][
''][
'url']))
2548 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'copyright'][0][
'data']))
2552 $copyrights = $this->registry->create(
'Copyright', array($copyright_url, $copyright_label));
2556 $copyrights = $copyrights_parent;
2560 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'credit']))
2562 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'credit'] as $credit)
2564 $credit_role = null;
2565 $credit_scheme = null;
2566 $credit_name = null;
2567 if (isset($credit[
'attribs'][
''][
'role']))
2571 if (isset($credit[
'attribs'][
''][
'scheme']))
2577 $credit_scheme =
'urn:ebu';
2579 if (isset($credit[
'data']))
2583 $credits[] = $this->registry->create(
'Credit', array($credit_role, $credit_scheme, $credit_name));
2585 if (is_array($credits))
2587 $credits = array_values(array_unique($credits));
2592 $credits = $credits_parent;
2596 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'description']))
2602 $description = $description_parent;
2606 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'hash']))
2608 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'hash'] as $hash)
2612 if (isset($hash[
'data']))
2616 if (isset($hash[
'attribs'][
''][
'algo']))
2624 $hashes[] = $algo.
':'.$value;
2626 if (is_array($hashes))
2628 $hashes = array_values(array_unique($hashes));
2633 $hashes = $hashes_parent;
2637 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'keywords']))
2639 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'keywords'][0][
'data']))
2642 foreach ($temp as $word)
2644 $keywords[] = trim($word);
2648 if (is_array($keywords))
2650 $keywords = array_values(array_unique($keywords));
2655 $keywords = $keywords_parent;
2659 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'player']))
2665 $player = $player_parent;
2669 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'rating']))
2671 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'rating'] as $rating)
2673 $rating_scheme = null;
2674 $rating_value = null;
2675 if (isset($rating[
'attribs'][
''][
'scheme']))
2681 $rating_scheme =
'urn:simple';
2683 if (isset($rating[
'data']))
2687 $ratings[] = $this->registry->create(
'Rating', array($rating_scheme, $rating_value));
2689 if (is_array($ratings))
2691 $ratings = array_values(array_unique($ratings));
2696 $ratings = $ratings_parent;
2700 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'restriction']))
2702 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'restriction'] as $restriction)
2704 $restriction_relationship = null;
2705 $restriction_type = null;
2706 $restriction_value = null;
2707 if (isset($restriction[
'attribs'][
''][
'relationship']))
2711 if (isset($restriction[
'attribs'][
''][
'type']))
2715 if (isset($restriction[
'data']))
2719 $restrictions[] = $this->registry->create(
'Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
2721 if (is_array($restrictions))
2723 $restrictions = array_values(array_unique($restrictions));
2728 $restrictions = $restrictions_parent;
2732 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'thumbnail']))
2734 foreach ($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'thumbnail'] as $thumbnail)
2738 if (is_array($thumbnails))
2740 $thumbnails = array_values(array_unique($thumbnails));
2745 $thumbnails = $thumbnails_parent;
2749 if (isset($content[
'child'][SIMPLEPIE_NAMESPACE_MEDIARSS][
'title']))
2755 $title = $title_parent;
2758 $this->data[
'enclosures'][] = $this->registry->create(
'Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
2765 if (isset($link[
'attribs'][
''][
'href']) && !empty($link[
'attribs'][
''][
'rel']) && $link[
'attribs'][
''][
'rel'] ===
'enclosure')
2778 $samplingrate = null;
2784 if (isset($link[
'attribs'][
''][
'type']))
2788 if (isset($link[
'attribs'][
''][
'length']))
2790 $length = ceil($link[
'attribs'][
''][
'length']);
2794 $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));
2800 if (isset($link[
'attribs'][
''][
'href']) && !empty($link[
'attribs'][
''][
'rel']) && $link[
'attribs'][
''][
'rel'] ===
'enclosure')
2813 $samplingrate = null;
2819 if (isset($link[
'attribs'][
''][
'type']))
2823 if (isset($link[
'attribs'][
''][
'length']))
2825 $length = ceil($link[
'attribs'][
''][
'length']);
2829 $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));
2835 if (isset($enclosure[0][
'attribs'][
''][
'url']))
2848 $samplingrate = null;
2854 if (isset($enclosure[0][
'attribs'][
''][
'type']))
2858 if (isset($enclosure[0][
'attribs'][
''][
'length']))
2860 $length = ceil($enclosure[0][
'attribs'][
''][
'length']);
2864 $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));
2868 if (
sizeof($this->data[
'enclosures']) === 0 && ($url || $type || $length || $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))
2871 $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));
2874 $this->data[
'enclosures'] = array_values(array_unique($this->data[
'enclosures']));
2876 if (!empty($this->data[
'enclosures']))
2878 return $this->data[
'enclosures'];
2902 return (
float) $return[0][
'data'];
2906 return (
float) $match[1];
2930 return (
float) $return[0][
'data'];
2934 return (
float) $return[0][
'data'];
2938 return (
float) $match[2];
2956 return $this->registry->create(
'Source', array($this, $return[0]));