aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/render/PageCacheManager.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-05-17 14:16:32 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commitc4d5be53c2ae503c00da3cfe6b28d0ce9d2ca7f5 (patch)
tree2aa6b156d45da7a1bb3cfe0b6e8622030fddb990 /application/render/PageCacheManager.php
parente3d28be9673a9f8404ff907b8191209729ad690c (diff)
downloadShaarli-c4d5be53c2ae503c00da3cfe6b28d0ce9d2ca7f5.tar.gz
Shaarli-c4d5be53c2ae503c00da3cfe6b28d0ce9d2ca7f5.tar.zst
Shaarli-c4d5be53c2ae503c00da3cfe6b28d0ce9d2ca7f5.zip
Process Daily RSS feed through Slim controller
The daily RSS template has been entirely rewritten to handle the whole feed through the template engine.
Diffstat (limited to 'application/render/PageCacheManager.php')
-rw-r--r--application/render/PageCacheManager.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/application/render/PageCacheManager.php b/application/render/PageCacheManager.php
index bd91fe0d..97805c35 100644
--- a/application/render/PageCacheManager.php
+++ b/application/render/PageCacheManager.php
@@ -2,6 +2,8 @@
2 2
3namespace Shaarli\Render; 3namespace Shaarli\Render;
4 4
5use Shaarli\Feed\CachedPage;
6
5/** 7/**
6 * Cache utilities 8 * Cache utilities
7 */ 9 */
@@ -10,9 +12,13 @@ class PageCacheManager
10 /** @var string Cache directory */ 12 /** @var string Cache directory */
11 protected $pageCacheDir; 13 protected $pageCacheDir;
12 14
13 public function __construct(string $pageCacheDir) 15 /** @var bool */
16 protected $isLoggedIn;
17
18 public function __construct(string $pageCacheDir, bool $isLoggedIn)
14 { 19 {
15 $this->pageCacheDir = $pageCacheDir; 20 $this->pageCacheDir = $pageCacheDir;
21 $this->isLoggedIn = $isLoggedIn;
16 } 22 }
17 23
18 /** 24 /**
@@ -42,4 +48,13 @@ class PageCacheManager
42 // Purge page cache shared by sessions. 48 // Purge page cache shared by sessions.
43 $this->purgeCachedPages(); 49 $this->purgeCachedPages();
44 } 50 }
51
52 public function getCachePage(string $pageUrl): CachedPage
53 {
54 return new CachedPage(
55 $this->pageCacheDir,
56 $pageUrl,
57 false === $this->isLoggedIn
58 );
59 }
45} 60}