Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache Class Reference

Message group synchronization cache. More...

Public Member Functions

 __construct (private readonly PersistentCache $cache, private readonly int $initialTimeoutSeconds=2400, private readonly int $incrementalTimeoutSeconds=600,)
 
 getGroupsInSync ()
 Get the groups currently in sync.
 
 markGroupForSync (string $groupId)
 Start synchronization process for a group and starts the expiry time.
 
 getSyncEndTime (string $groupId)
 
 endSync (string $groupId)
 End synchronization for a group.
 
 forceEndSync (string $groupId)
 End synchronization for a group.
 
 addMessages (string $groupId, MessageUpdateParameter ... $messageParams)
 Add messages for a group to the cache.
 
 isGroupBeingProcessed (string $groupId)
 Check if the group is in synchronization.
 
 getGroupMessages (string $groupId)
 Return all messages in a group.
 
 isMessageBeingProcessed (string $groupId, string $messageKey)
 Check if a message is being processed.
 
 getSynchronizationStatus (string $groupId)
 Get the current synchronization status of the group.
 
 removeMessages (string $groupId, string ... $messageKeys)
 Remove messages from the cache.
 
 addGroupErrors (GroupSynchronizationResponse $response)
 
 getGroupsWithErrors ()
 Return the groups that have errors.
 
 getGroupErrorInfo (string $groupId)
 Fetch information about a particular group that has errors including messages that failed.
 
 markGroupAsResolved (string $groupId)
 Marks all messages in a group and the group itself as resolved.
 
 markMessageAsResolved (string $groupId, string $messagePageName)
 Marks errors for a message as resolved.
 
 groupHasErrors (string $groupId)
 Checks if the group has errors.
 
 syncGroupErrors (string $groupId)
 Checks if group has unresolved error messages.
 
 getGroupsInReview ()
 Return groups that are in review.
 
 markGroupAsInReview (string $groupId)
 
 markGroupAsReviewed (string $groupId)
 
 isGroupInReview (string $groupId)
 
 extendGroupExpiryTime (string $groupId)
 
 getGroupExpiryTime (string $groupId)
 

Detailed Description

Message group synchronization cache.

Handles storage of data in the cache to track which groups are currently being synchronized. Stores:

  1. Groups in sync:
    • Key: {hash($groupId)}_$groupId
    • Value: $groupId
    • Tag: See GroupSynchronizationCache::getGroupsTag()
    • Exptime: Set when startSyncTimer is called
  2. Message under each group being modified:
    • Key: {hash($groupId_$messageKey)}_$messageKey
    • Value: MessageUpdateParameter
    • Tag: gsc_$groupId
    • Exptime: none
Author
Abijeet Patro @license GPL-2.0-or-later
Since
2020.06

Definition at line 37 of file GroupSynchronizationCache.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::__construct ( private readonly PersistentCache $cache,
private readonly int $initialTimeoutSeconds = 2400,
private readonly int $incrementalTimeoutSeconds = 600 )

Definition at line 47 of file GroupSynchronizationCache.php.

Member Function Documentation

◆ addGroupErrors()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::addGroupErrors ( GroupSynchronizationResponse $response)

Definition at line 203 of file GroupSynchronizationCache.php.

◆ addMessages()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::addMessages ( string $groupId,
MessageUpdateParameter ... $messageParams )

Add messages for a group to the cache.

Definition at line 111 of file GroupSynchronizationCache.php.

◆ endSync()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::endSync ( string $groupId)

End synchronization for a group.

Deletes the group key

Definition at line 92 of file GroupSynchronizationCache.php.

◆ extendGroupExpiryTime()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::extendGroupExpiryTime ( string $groupId)

Definition at line 393 of file GroupSynchronizationCache.php.

◆ forceEndSync()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::forceEndSync ( string $groupId)

End synchronization for a group.

Deletes the group key and messages

Definition at line 105 of file GroupSynchronizationCache.php.

◆ getGroupErrorInfo()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getGroupErrorInfo ( string $groupId)

Fetch information about a particular group that has errors including messages that failed.

Definition at line 275 of file GroupSynchronizationCache.php.

◆ getGroupExpiryTime()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getGroupExpiryTime ( string $groupId)

Definition at line 423 of file GroupSynchronizationCache.php.

◆ getGroupMessages()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getGroupMessages ( string $groupId)

Return all messages in a group.

Parameters
string$groupId
Returns
MessageUpdateParameter[] Returns a key value pair, with the key being the messageKey and value being MessageUpdateParameter

Definition at line 139 of file GroupSynchronizationCache.php.

◆ getGroupsInReview()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getGroupsInReview ( )

Return groups that are in review.

Returns
string[]

Definition at line 360 of file GroupSynchronizationCache.php.

◆ getGroupsInSync()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getGroupsInSync ( )

Get the groups currently in sync.

Returns
string[]

Definition at line 62 of file GroupSynchronizationCache.php.

◆ getGroupsWithErrors()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getGroupsWithErrors ( )

Return the groups that have errors.

Returns
string[]

Definition at line 258 of file GroupSynchronizationCache.php.

◆ getSyncEndTime()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getSyncEndTime ( string $groupId)

Definition at line 86 of file GroupSynchronizationCache.php.

◆ getSynchronizationStatus()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::getSynchronizationStatus ( string $groupId)

Get the current synchronization status of the group.

Does not perform any updates.

Definition at line 163 of file GroupSynchronizationCache.php.

◆ groupHasErrors()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::groupHasErrors ( string $groupId)

Checks if the group has errors.

Definition at line 337 of file GroupSynchronizationCache.php.

◆ isGroupBeingProcessed()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::isGroupBeingProcessed ( string $groupId)

Check if the group is in synchronization.

Definition at line 128 of file GroupSynchronizationCache.php.

◆ isGroupInReview()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::isGroupInReview ( string $groupId)

Definition at line 389 of file GroupSynchronizationCache.php.

◆ isMessageBeingProcessed()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::isMessageBeingProcessed ( string $groupId,
string $messageKey )

Check if a message is being processed.

Definition at line 157 of file GroupSynchronizationCache.php.

◆ markGroupAsInReview()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::markGroupAsInReview ( string $groupId)

Definition at line 370 of file GroupSynchronizationCache.php.

◆ markGroupAsResolved()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::markGroupAsResolved ( string $groupId)

Marks all messages in a group and the group itself as resolved.

Definition at line 310 of file GroupSynchronizationCache.php.

◆ markGroupAsReviewed()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::markGroupAsReviewed ( string $groupId)

Definition at line 383 of file GroupSynchronizationCache.php.

◆ markGroupForSync()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::markGroupForSync ( string $groupId)

Start synchronization process for a group and starts the expiry time.

Definition at line 73 of file GroupSynchronizationCache.php.

◆ markMessageAsResolved()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::markMessageAsResolved ( string $groupId,
string $messagePageName )

Marks errors for a message as resolved.

Definition at line 324 of file GroupSynchronizationCache.php.

◆ removeMessages()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::removeMessages ( string $groupId,
string ... $messageKeys )

Remove messages from the cache.

Definition at line 197 of file GroupSynchronizationCache.php.

◆ syncGroupErrors()

MediaWiki\Extension\Translate\Synchronization\GroupSynchronizationCache::syncGroupErrors ( string $groupId)

Checks if group has unresolved error messages.

If not clears the group from error list

Definition at line 343 of file GroupSynchronizationCache.php.


The documentation for this class was generated from the following file: