Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace MediaWiki\Extension\Translate\TtmServer; |
5 | |
6 | use MediaWiki\Extension\Translate\MessageLoading\MessageHandle; |
7 | |
8 | /** |
9 | * Interface for TtmServer that can be updated. |
10 | * @ingroup TTMServer |
11 | */ |
12 | interface WritableTtmServer { |
13 | /** |
14 | * Shovels the new translation into translation memory. |
15 | * Use this for single updates (=after message edit). |
16 | * If no text is provided, entry will be removed from the translation |
17 | * memory. |
18 | * |
19 | * @param MessageHandle $handle |
20 | * @param string|null $targetText Use null to only delete. |
21 | */ |
22 | public function update( MessageHandle $handle, ?string $targetText ): bool; |
23 | |
24 | /** |
25 | * Called when starting to fill the translation memory. |
26 | * Set up necessary variables and remove old content |
27 | * from the server. |
28 | */ |
29 | public function beginBootstrap(): void; |
30 | |
31 | /** Called before every batch (MessageGroup). */ |
32 | public function beginBatch(): void; |
33 | |
34 | /** Called multiple times per batch if necessary. */ |
35 | public function batchInsertDefinitions( array $batch ): void; |
36 | |
37 | /** Called multiple times per batch if necessary. */ |
38 | public function batchInsertTranslations( array $batch ): void; |
39 | |
40 | /** Called after every batch (MessageGroup). */ |
41 | public function endBatch(): void; |
42 | |
43 | /** Do any cleanup, optimizing etc. */ |
44 | public function endBootstrap(): void; |
45 | |
46 | /** Instruct the service to fully wipe the index and start from scratch. */ |
47 | public function setDoReIndex(): void; |
48 | } |