Add some basic feed generation when I should work on episode models.

This commit is contained in:
Dave Smith-Hayes 2024-12-29 03:26:05 +00:00
parent 7fd5798454
commit 5b0cef92ba
3 changed files with 79 additions and 22 deletions

44
app/composer.lock generated
View File

@ -2822,16 +2822,16 @@
}, },
{ {
"name": "robmorgan/phinx", "name": "robmorgan/phinx",
"version": "0.16.5", "version": "0.16.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cakephp/phinx.git", "url": "https://github.com/cakephp/phinx.git",
"reference": "31d837c17d6dc294d44f0b17331066548ac8c032" "reference": "5bad10934336e8cf45d50d529cabfcbe7fe287c5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cakephp/phinx/zipball/31d837c17d6dc294d44f0b17331066548ac8c032", "url": "https://api.github.com/repos/cakephp/phinx/zipball/5bad10934336e8cf45d50d529cabfcbe7fe287c5",
"reference": "31d837c17d6dc294d44f0b17331066548ac8c032", "reference": "5bad10934336e8cf45d50d529cabfcbe7fe287c5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2903,9 +2903,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/cakephp/phinx/issues", "issues": "https://github.com/cakephp/phinx/issues",
"source": "https://github.com/cakephp/phinx/tree/0.16.5" "source": "https://github.com/cakephp/phinx/tree/0.16.6"
}, },
"time": "2024-10-03T15:41:04+00:00" "time": "2024-12-20T23:02:54+00:00"
}, },
{ {
"name": "slim/flash", "name": "slim/flash",
@ -3409,12 +3409,12 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": { "branch-alias": {
"dev-main": "3.5-dev" "dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
} }
}, },
"autoload": { "autoload": {
@ -4021,12 +4021,12 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": { "branch-alias": {
"dev-main": "3.5-dev" "dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
} }
}, },
"autoload": { "autoload": {
@ -5356,16 +5356,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "11.5.1", "version": "11.5.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "2b94d4f2450b9869fa64a46fd8a6a41997aef56a" "reference": "153d0531b9f7e883c5053160cad6dd5ac28140b3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2b94d4f2450b9869fa64a46fd8a6a41997aef56a", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/153d0531b9f7e883c5053160cad6dd5ac28140b3",
"reference": "2b94d4f2450b9869fa64a46fd8a6a41997aef56a", "reference": "153d0531b9f7e883c5053160cad6dd5ac28140b3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5379,13 +5379,13 @@
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=8.2", "php": ">=8.2",
"phpunit/php-code-coverage": "^11.0.7", "phpunit/php-code-coverage": "^11.0.8",
"phpunit/php-file-iterator": "^5.1.0", "phpunit/php-file-iterator": "^5.1.0",
"phpunit/php-invoker": "^5.0.1", "phpunit/php-invoker": "^5.0.1",
"phpunit/php-text-template": "^4.0.1", "phpunit/php-text-template": "^4.0.1",
"phpunit/php-timer": "^7.0.1", "phpunit/php-timer": "^7.0.1",
"sebastian/cli-parser": "^3.0.2", "sebastian/cli-parser": "^3.0.2",
"sebastian/code-unit": "^3.0.1", "sebastian/code-unit": "^3.0.2",
"sebastian/comparator": "^6.2.1", "sebastian/comparator": "^6.2.1",
"sebastian/diff": "^6.0.2", "sebastian/diff": "^6.0.2",
"sebastian/environment": "^7.2.0", "sebastian/environment": "^7.2.0",
@ -5437,7 +5437,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.1" "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.2"
}, },
"funding": [ "funding": [
{ {
@ -5453,7 +5453,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-11T10:52:48+00:00" "time": "2024-12-21T05:51:08+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",

View File

@ -0,0 +1,32 @@
<?php
namespace Slovocast\Feed;
use DOMDocument;
use Slovocast\Feed\FeedGeneratorInterface;
use Slovocast\Domain\Entity\Channel;
class FeedGenerator implements FeedGeneratorInterface
{
protected DOMDocument $document;
public function __construct()
{
$this->document = new DOMDocument();
}
/**
* Reset the buffered DOMDocument object when building the Feed.
*/
protected function reset(): void
{
$this->document = new DOMDocument();
$rss = $this->document->createElement("rss");
}
public function generate(Channel $channel): DOMDocument
{
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace Slovocast\Feed;
use DOMDocument;
use Slovocast\Domain\Entity\Channel;
interface FeedGeneratorInterface
{
/**
* XMLNS Definitions that should be updated as new namespaces get added.
* This could probably be defines somewhere else if we need it. These are
* pulled from some old Podbean feeds.
*/
const XMLNS_CONTENT="http://purl.org/rss/1.0/modules/content/";
const XMLNS_WFW="http://wellformedweb.org/CommentAPI";
const XMLNS_DC="http://purl.org/dv/elements/1.1/";
const XMLNS_ATOM="http://www.w3.org/2005/Atom";
const XMLNS_ITUNES="http://www.itunes.com/dtds/podcast-1.0.dtd";
const XMLNS_GOOGLEPLAY="http://www.google.com/schemas/play-podcasts/1.0";
const XMLNS_SPOTIFY="https://www.spotify.com/ns/rss";
const XMLNS_MEDAI="http://search.yahoo.com/mrss/";
public function generate(Channel $channel): DOMDocument;
}