summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/utils/MessageGroupCache.php')
-rw-r--r--MLEB/Translate/utils/MessageGroupCache.php24
1 files changed, 9 insertions, 15 deletions
diff --git a/MLEB/Translate/utils/MessageGroupCache.php b/MLEB/Translate/utils/MessageGroupCache.php
index fdb1fc01..fa174a35 100644
--- a/MLEB/Translate/utils/MessageGroupCache.php
+++ b/MLEB/Translate/utils/MessageGroupCache.php
@@ -19,24 +19,13 @@ class MessageGroupCache {
public const NO_CACHE = 2;
public const CHANGED = 3;
- /**
- * @var FileBasedMessageGroup
- */
+ /** @var FileBasedMessageGroup */
protected $group;
-
- /**
- * @var \Cdb\Reader
- */
+ /** @var \Cdb\Reader */
protected $cache;
-
- /**
- * @var string
- */
+ /** @var string */
protected $code;
-
- /**
- * @var string
- */
+ /** @var string */
private $cacheFilePath;
/**
@@ -253,6 +242,11 @@ class MessageGroupCache {
return false;
}
+ public function invalidate(): void {
+ $this->close();
+ unlink( $this->getCacheFilePath() );
+ }
+
private function serialize( array $data ): string {
// Using simple prefix for easy future extension
return 'J' . json_encode( $data );