summaryrefslogtreecommitdiff
blob: 723c19dbc12aa36e907340183e037ad8d81717a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare( strict_types = 1 );

namespace MediaWiki\Extension\Translate\Cache;

/** Defines what method should be provided by a class implementing a persistent cache */
interface PersistentCache {
	/** @return PersistentCacheEntry[] */
	public function get( string ...$keynames ): array;

	public function getWithLock( string $keyname ): ?PersistentCacheEntry;

	public function has( string $keyname ): bool;

	public function hasEntryWithTag( string $tag ): bool;

	public function hasExpiredEntry( string $keyname ): bool;

	/** @return PersistentCacheEntry[] */
	public function getByTag( string $tag ): array;

	public function set( PersistentCacheEntry ...$cacheEntry ): void;

	public function delete( string ...$keyname ): void;

	public function deleteEntriesWithTag( string $tag ): void;

	public function clear(): void;
}

class_alias( PersistentCache::class, '\MediaWiki\Extensions\Translate\PersistentCache' );