Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merging develop to master in preparation for 2.10.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed May 24, 2018
2 parents 66d2752 + d00bf71 commit c3b1b86
Show file tree
Hide file tree
Showing 38 changed files with 3,707 additions and 33 deletions.
74 changes: 70 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,85 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.9.2 - TBD
## 2.10.0 - 2018-05-24

### Added

- Nothing.
- [#78](https://github.com/zendframework/zend-feed/pull/78) adds support for the Google Play Podcasts 1.0 DTD in both the Reader and
Writer subcomponents. The following new classes provide the support:

- `Zend\Feed\Reader\Extension\GooglePlayPodcast\Entry`
- `Zend\Feed\Reader\Extension\GooglePlayPodcast\Feed`
- `Zend\Feed\Writer\Extension\GooglePlayPodcast\Entry`
- `Zend\Feed\Writer\Extension\GooglePlayPodcast\Feed`
- `Zend\Feed\Writer\Extension\GooglePlayPodcast\Renderer\Entry`
- `Zend\Feed\Writer\Extension\GooglePlayPodcast\Renderer\Feed`

The extensions are registered by default with both `Zend\Feed\Reader\Reader`
and `Zend\Feed\Writer\Writer`.

- [#77](https://github.com/zendframework/zend-feed/pull/77) adds support for `itunes:image` for each of:
- `Zend\Feed\Reader\Extension\Podcast\Entry`, via `getItunesImage()`; previously only the `Feed` supported it.
- `Zend\Feed\Writer\Extension\ITunes\Entry`, via `setItunesImage()`; previously only the `Feed` supported it.
- `Zend\Feed\Writer\Extension\ITunes\Renderer\Entry`; previously on the `Feed` supported it.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Writer\Extension\ITunes\Entry::setItunesSeason()`, corresponding to the
`itunes:season` tag, and allowing setting the season number of the episode the
entry represents.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Writer\Extension\ITunes\Entry::setItunesIsClosedCaptioned()`, corresponding to the
`itunes:isClosedCaptioned` tag, and allowing setting the status of closed
captioning support in the episode the entry represents.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Writer\Extension\ITunes\Entry::setItunesEpisodeType()`, corresponding to the
`itunes:episodeType` tag, and allowing setting the type of episode the entry represents
(one of "full", "trailer", or "bonus", and defaulting to "full").

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Writer\Extension\ITunes\Entry::setEpisode()`, corresponding to the
`itunes:episode` tag, and allowing setting the number of the episode the entry represents.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Writer\Extension\ITunes\Feed::setItunesComplete()`, corresponding to the
`itunes:complete` tag. It allows setting a boolean flag, indicating whether or not the
podcast is complete (will not air new episodes).

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Writer\Extension\ITunes\Feed::setItunesType()`, corresponding to the
`itunes:type` tag, and allowing setting the podcast type (one of "serial" or "episodic").

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Reader\Extension\Podcast\Entry::getEpisodeType()`, corresponding to the
`itunes:episodeType` tag, and returning the type of episode the entry represents
(one of "full", "trailer", or "bonus", and defaulting to "full").

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Reader\Extension\Podcast\Entry::getSeason()`, corresponding to the
`itunes:season` tag, and returning the season number of the episode the entry represents.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Reader\Extension\Podcast\Entry::isClsoedCaptioned()`, corresponding to the
`itunes:isClosedCaptioned` tag, and returning the status of closed captioning
in the episode the entry represents.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Reader\Extension\Podcast\Entry::getEpisode()`, corresponding to the
`itunes:episode` tag, and returning the number of the episode the entry represents.

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Reader\Extension\Podcast\Feed::isComplete()`, corresponding to the
`itunes:complete` tag. It returns a boolean, indicating whether or not the podcast is
complete (will not air new episodes).

- [#75](https://github.com/zendframework/zend-feed/pull/75) adds `Zend\Feed\Reader\Extension\Podcast\Feed::getPodcastType()`, corresponding to the
`itunes:type` tag, and providing the podcast type (one of "serial" or "episodic", defaulting
to the latter).

### Changed

- Nothing.
- [#77](https://github.com/zendframework/zend-feed/pull/77) updates URI validation for `Zend\Feed\Writer\Extension\ITunes\Feed::setItunesImage()` to
first check that we have received a string value before proceeding.

### Deprecated

- Nothing.
- [#75](https://github.com/zendframework/zend-feed/pull/75) deprecates each of:
- `Zend\Feed\Reader\Extension\Podcast\Entry::getKeywords()`
- `Zend\Feed\Reader\Extension\Podcast\Feed::getKeywords()`
- `Zend\Feed\Writer\Extension\ITunes\Entry::setKeywords()`
- `Zend\Feed\Writer\Extension\ITunes\Feed::setKeywords()`
as the iTunes Podcast RSS specification no longer supports keywords.

### Removed

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.9-dev",
"dev-develop": "2.10-dev"
"dev-master": "2.10.x-dev",
"dev-develop": "2.11.x-dev"
}
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/book/reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ Slash | Implements support for the Slash RSS 1.0 module.
WellFormedWeb | Implements support for the Well Formed Web CommentAPI 1.0.
Thread | Implements support for Atom Threading Extensions as described in RFC 4685.
Podcast | Implements support for the Podcast 1.0 DTD from Apple.
GooglePlayPodcast | Implements support for the Google Play Podcasts 1.0 DTD from Google.

The core extensions are somewhat special since they are extremely common and
multi-faceted. For example, we have a core extension for Atom. Atom is
Expand Down
90 changes: 90 additions & 0 deletions src/Reader/Extension/GooglePlayPodcast/Entry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/**
* @see https://github.com/zendframework/zend-feed for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-feed/blob/master/LICENSE.md New BSD License
*/

namespace Zend\Feed\Reader\Extension\GooglePlayPodcast;

use Zend\Feed\Reader\Extension;

class Entry extends Extension\AbstractEntry
{
/**
* Get the entry block
*
* @return string
*/
public function getPlayPodcastBlock()
{
if (isset($this->data['block'])) {
return $this->data['block'];
}

$block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:block)');

if (! $block) {
$block = null;
}

$this->data['block'] = $block;

return $this->data['block'];
}

/**
* Get the entry explicit
*
* @return string
*/
public function getPlayPodcastExplicit()
{
if (isset($this->data['explicit'])) {
return $this->data['explicit'];
}

$explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:explicit)');

if (! $explicit) {
$explicit = null;
}

$this->data['explicit'] = $explicit;

return $this->data['explicit'];
}

/**
* Get the episode summary/description
*
* Uses verbiage so it does not conflict with base entry.
*
* @return string
*/
public function getPlayPodcastDescription()
{
if (isset($this->data['description'])) {
return $this->data['description'];
}

$description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:description)');

if (! $description) {
$description = null;
}

$this->data['description'] = $description;

return $this->data['description'];
}

/**
* Register googleplay namespace
*
*/
protected function registerNamespaces()
{
$this->xpath->registerNamespace('googleplay', 'http://www.google.com/schemas/play-podcasts/1.0');
}
}
175 changes: 175 additions & 0 deletions src/Reader/Extension/GooglePlayPodcast/Feed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<?php
/**
* @see https://github.com/zendframework/zend-feed for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-feed/blob/master/LICENSE.md New BSD License
*/

namespace Zend\Feed\Reader\Extension\GooglePlayPodcast;

use DOMText;
use Zend\Feed\Reader\Extension;

class Feed extends Extension\AbstractFeed
{
/**
* Get the entry author
*
* @return string
*/
public function getPlayPodcastAuthor()
{
if (isset($this->data['author'])) {
return $this->data['author'];
}

$author = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:author)');

if (! $author) {
$author = null;
}

$this->data['author'] = $author;

return $this->data['author'];
}

/**
* Get the entry block
*
* @return string
*/
public function getPlayPodcastBlock()
{
if (isset($this->data['block'])) {
return $this->data['block'];
}

$block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:block)');

if (! $block) {
$block = null;
}

$this->data['block'] = $block;

return $this->data['block'];
}

/**
* Get the entry category
*
* @return array|null
*/
public function getPlayPodcastCategories()
{
if (isset($this->data['categories'])) {
return $this->data['categories'];
}

$categoryList = $this->xpath->query($this->getXpathPrefix() . '/googleplay:category');

$categories = [];

if ($categoryList->length > 0) {
foreach ($categoryList as $node) {
$children = null;

if ($node->childNodes->length > 0) {
$children = [];

foreach ($node->childNodes as $childNode) {
if (! ($childNode instanceof DOMText)) {
$children[$childNode->getAttribute('text')] = null;
}
}
}

$categories[$node->getAttribute('text')] = $children;
}
}

if (! $categories) {
$categories = null;
}

$this->data['categories'] = $categories;

return $this->data['categories'];
}

/**
* Get the entry explicit
*
* @return string
*/
public function getPlayPodcastExplicit()
{
if (isset($this->data['explicit'])) {
return $this->data['explicit'];
}

$explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:explicit)');

if (! $explicit) {
$explicit = null;
}

$this->data['explicit'] = $explicit;

return $this->data['explicit'];
}

/**
* Get the feed/podcast image
*
* @return string
*/
public function getPlayPodcastImage()
{
if (isset($this->data['image'])) {
return $this->data['image'];
}

$image = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:image/@href)');

if (! $image) {
$image = null;
}

$this->data['image'] = $image;

return $this->data['image'];
}

/**
* Get the entry description
*
* @return string
*/
public function getPlayPodcastDescription()
{
if (isset($this->data['description'])) {
return $this->data['description'];
}

$description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:description)');

if (! $description) {
$description = null;
}

$this->data['description'] = $description;

return $this->data['description'];
}

/**
* Register googleplay namespace
*
*/
protected function registerNamespaces()
{
$this->xpath->registerNamespace('googleplay', 'http://www.google.com/schemas/play-podcasts/1.0');
}
}

0 comments on commit c3b1b86

Please sign in to comment.