X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fzendframework%2Fzend-feed%2Fsrc%2FReader%2FExtension%2FCreativeCommons%2FFeed.php;fp=vendor%2Fzendframework%2Fzend-feed%2Fsrc%2FReader%2FExtension%2FCreativeCommons%2FFeed.php;h=8532a88c0ab694ee892a56deb26904dc7eb0426d;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/zendframework/zend-feed/src/Reader/Extension/CreativeCommons/Feed.php b/vendor/zendframework/zend-feed/src/Reader/Extension/CreativeCommons/Feed.php new file mode 100644 index 000000000..8532a88c0 --- /dev/null +++ b/vendor/zendframework/zend-feed/src/Reader/Extension/CreativeCommons/Feed.php @@ -0,0 +1,70 @@ +getLicenses(); + + if (isset($licenses[$index])) { + return $licenses[$index]; + } + + return; + } + + /** + * Get the entry licenses + * + * @return array + */ + public function getLicenses() + { + $name = 'licenses'; + if (array_key_exists($name, $this->data)) { + return $this->data[$name]; + } + + $licenses = []; + $list = $this->xpath->evaluate('channel/cc:license'); + + if ($list->length) { + foreach ($list as $license) { + $licenses[] = $license->nodeValue; + } + + $licenses = array_unique($licenses); + } + + $this->data[$name] = $licenses; + + return $this->data[$name]; + } + + /** + * Register Creative Commons namespaces + * + * @return void + */ + protected function registerNamespaces() + { + $this->xpath->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule'); + } +}