Process Daily RSS feed through Slim controller

The daily RSS template has been entirely rewritten to handle the whole feed through the template engine.
This commit is contained in:
ArthurHoaro 2020-05-17 14:16:32 +02:00
parent e3d28be967
commit c4d5be53c2
15 changed files with 366 additions and 155 deletions
application/render

View file

@ -2,6 +2,8 @@
namespace Shaarli\Render;
use Shaarli\Feed\CachedPage;
/**
* Cache utilities
*/
@ -10,9 +12,13 @@ class PageCacheManager
/** @var string Cache directory */
protected $pageCacheDir;
public function __construct(string $pageCacheDir)
/** @var bool */
protected $isLoggedIn;
public function __construct(string $pageCacheDir, bool $isLoggedIn)
{
$this->pageCacheDir = $pageCacheDir;
$this->isLoggedIn = $isLoggedIn;
}
/**
@ -42,4 +48,13 @@ class PageCacheManager
// Purge page cache shared by sessions.
$this->purgeCachedPages();
}
public function getCachePage(string $pageUrl): CachedPage
{
return new CachedPage(
$this->pageCacheDir,
$pageUrl,
false === $this->isLoggedIn
);
}
}