From dfc650aa239d3a2c028d0ba13132ce75b4f4c0b4 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Mon, 3 Dec 2018 00:08:04 +0100 Subject: namespacing: \Shaarli\Feed\{Cache,CachedPage,FeedBuilder} Signed-off-by: VirtualTam --- application/CachedPage.php | 59 ---------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 application/CachedPage.php (limited to 'application/CachedPage.php') diff --git a/application/CachedPage.php b/application/CachedPage.php deleted file mode 100644 index e11cc52d..00000000 --- a/application/CachedPage.php +++ /dev/null @@ -1,59 +0,0 @@ -cacheDir = $cacheDir; - $this->filename = $this->cacheDir.'/'.sha1($url).'.cache'; - $this->shouldBeCached = $shouldBeCached; - } - - /** - * Returns the cached version of a page, if it exists and should be cached - * - * @return string a cached version of the page if it exists, null otherwise - */ - public function cachedVersion() - { - if (!$this->shouldBeCached) { - return null; - } - if (is_file($this->filename)) { - return file_get_contents($this->filename); - } - return null; - } - - /** - * Puts a page in the cache - * - * @param string $pageContent XML content to cache - */ - public function cache($pageContent) - { - if (!$this->shouldBeCached) { - return; - } - file_put_contents($this->filename, $pageContent); - } -} -- cgit v1.2.3