2020-06-26 14:34:52 +00:00
|
|
|
<?php
|
2020-08-04 11:25:22 +00:00
|
|
|
|
2020-07-10 12:20:25 +00:00
|
|
|
/**
|
|
|
|
* @copyright 2020 Podlibre
|
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
2020-06-26 14:34:52 +00:00
|
|
|
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use App\Models\PodcastModel;
|
|
|
|
use CodeIgniter\Controller;
|
|
|
|
|
|
|
|
class Feed extends Controller
|
|
|
|
{
|
2020-08-04 11:25:22 +00:00
|
|
|
public function index($podcastName)
|
2020-06-26 14:34:52 +00:00
|
|
|
{
|
|
|
|
// The page cache is set to a decade so it is deleted manually upon podcast update
|
|
|
|
$this->cachePage(DECADE);
|
|
|
|
|
2020-08-04 11:25:22 +00:00
|
|
|
helper('rss');
|
|
|
|
|
|
|
|
$podcast = (new PodcastModel())->where('name', $podcastName)->first();
|
|
|
|
|
2020-06-26 14:34:52 +00:00
|
|
|
return $this->response->setXML(get_rss_feed($podcast));
|
|
|
|
}
|
|
|
|
}
|