From 4a35428499c40165383226addaa5295e5b7a9335 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 29 Jul 2018 16:05:57 +0200 Subject: [PATCH] cleanup of PurgeLimiter #342 --- lib/Persistence/PurgeLimiter.php | 27 +++++++++++---------------- tst/Persistence/PurgeLimiterTest.php | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/Persistence/PurgeLimiter.php b/lib/Persistence/PurgeLimiter.php index 1b99d680..629dd921 100644 --- a/lib/Persistence/PurgeLimiter.php +++ b/lib/Persistence/PurgeLimiter.php @@ -70,23 +70,18 @@ class PurgeLimiter extends AbstractPersistence return true; } - $file = 'purge_limiter.php'; - $now = time(); - $content = '= $now) { + return false; + } } - $path = self::getPath($file); - require $path; - $pl = $GLOBALS['purge_limiter']; - - if ($pl + self::$_limit >= $now) { - $result = false; - } else { - $result = true; - self::_store($file, $content); - } - return $result; + $content = 'assertEquals(false, PurgeLimiter::canPurge()); sleep(2); $this->assertEquals(true, PurgeLimiter::canPurge());