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:
parent
e3d28be967
commit
c4d5be53c2
15 changed files with 366 additions and 155 deletions
application/render
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue