namespace Shaarli\Render;
+use Shaarli\Feed\CachedPage;
+
/**
* Cache utilities
*/
/** @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;
}
/**
// Purge page cache shared by sessions.
$this->purgeCachedPages();
}
+
+ public function getCachePage(string $pageUrl): CachedPage
+ {
+ return new CachedPage(
+ $this->pageCacheDir,
+ $pageUrl,
+ false === $this->isLoggedIn
+ );
+ }
}