Mysql based backend. More...
Public Member Functions | |
update (MessageHandle $handle, $targetText) | |
Shovels the new translation into translation memory. | |
beginBootstrap () | |
Called when starting to fill the translation memory. | |
beginBatch () | |
Called before every batch (MessageGroup). | |
batchInsertDefinitions (array $batch) | |
Called multiple times per batch if necessary. | |
batchInsertTranslations (array $batch) | |
Called multiple times per batch if necessary. | |
endBatch () | |
Called before every batch (MessageGroup). | |
endBootstrap () | |
Do any cleanup, optimizing etc. | |
isLocalSuggestion (array $suggestion) | |
Determines if the suggestion returned by this TTMServer comes from this wiki or any other wiki. | |
expandLocation (array $suggestion) | |
Given suggestion returned by this TTMServer, constructs fully qualified URL to the location of the translation. | |
query ( $sourceLanguage, $targetLanguage, $text) | |
Fetches all relevant suggestions for given text. | |
setDoReIndex () | |
Instruct the service to fully wipe the index and start from scratch. | |
Public Member Functions inherited from TTMServer | |
__construct (array $config) | |
getMirrors () | |
isFrozen () | |
Public Member Functions inherited from WritableTTMServer | |
getMirrors () | |
Get the list of services to duplicate writes to make them "mirrors" of this service. | |
isFrozen () | |
Check if the service is frozen, attempting to write to a frozen service may lead to errors or unexpected behaviors. | |
Protected Member Functions | |
getDB ( $mode=DB_REPLICA) | |
insertSource (Title $context, $sourceLanguage, $text) | |
filterForFulltext ( $language, $input) | |
Tokenizes the text for fulltext search. | |
processQueryResults ( $res, $text, $targetLanguage) | |
Protected Attributes | |
$sids | |
Protected Attributes inherited from TTMServer | |
$config | |
Additional Inherited Members | |
Static Public Member Functions inherited from TTMServer | |
static | factory (array $config) |
static | primary () |
Returns the primary server instance, useful for chaining. | |
static | sortSuggestions (array $suggestions) |
static | levenshtein ( $str1, $str2, $length1, $length2) |
PHP implementation of Levenshtein edit distance algorithm. | |
static | onDelete (WikiPage $wikipage) |
Hook: ArticleDeleteComplete. | |
static | onChange (MessageHandle $handle) |
Called from TranslateEditAddons::onSave. | |
static | onGroupChange (MessageHandle $handle, $old) |
DatabaseTTMServer::batchInsertDefinitions | ( | array | $batch | ) |
Called multiple times per batch if necessary.
array | $batch |
Implements WritableTTMServer.
Definition at line 164 of file DatabaseTTMServer.php.
DatabaseTTMServer::batchInsertTranslations | ( | array | $batch | ) |
Called multiple times per batch if necessary.
array | $batch |
Implements WritableTTMServer.
Definition at line 175 of file DatabaseTTMServer.php.
DatabaseTTMServer::beginBatch | ( | ) |
Called before every batch (MessageGroup).
Implements WritableTTMServer.
Definition at line 160 of file DatabaseTTMServer.php.
DatabaseTTMServer::beginBootstrap | ( | ) |
Called when starting to fill the translation memory.
Set up necessary variables and remove old content from the server.
Implements WritableTTMServer.
Definition at line 146 of file DatabaseTTMServer.php.
DatabaseTTMServer::endBatch | ( | ) |
Called before every batch (MessageGroup).
Implements WritableTTMServer.
Definition at line 192 of file DatabaseTTMServer.php.
DatabaseTTMServer::endBootstrap | ( | ) |
Do any cleanup, optimizing etc.
Implements WritableTTMServer.
Definition at line 195 of file DatabaseTTMServer.php.
DatabaseTTMServer::expandLocation | ( | array | $suggestion | ) |
Given suggestion returned by this TTMServer, constructs fully qualified URL to the location of the translation.
array | $suggestion |
Implements ReadableTTMServer.
Definition at line 207 of file DatabaseTTMServer.php.
|
protected |
Tokenizes the text for fulltext search.
Tries to find the most useful tokens.
string | $language | Language code |
string | $input |
Definition at line 121 of file DatabaseTTMServer.php.
|
protected |
int | $mode | DB_REPLICA|DB_PRIMARY |
Definition at line 27 of file DatabaseTTMServer.php.
|
protected |
Definition at line 89 of file DatabaseTTMServer.php.
DatabaseTTMServer::isLocalSuggestion | ( | array | $suggestion | ) |
Determines if the suggestion returned by this TTMServer comes from this wiki or any other wiki.
array | $suggestion |
Implements ReadableTTMServer.
Definition at line 203 of file DatabaseTTMServer.php.
|
protected |
Definition at line 245 of file DatabaseTTMServer.php.
DatabaseTTMServer::query | ( | $sourceLanguage, | |
$targetLanguage, | |||
$text ) |
Fetches all relevant suggestions for given text.
string | $sourceLanguage | language code for the provide text |
string | $targetLanguage | language code for the suggestions |
string | $text | the text for which to search suggestions |
Implements ReadableTTMServer.
Definition at line 213 of file DatabaseTTMServer.php.
DatabaseTTMServer::setDoReIndex | ( | ) |
Instruct the service to fully wipe the index and start from scratch.
Implements WritableTTMServer.
Definition at line 286 of file DatabaseTTMServer.php.
DatabaseTTMServer::update | ( | MessageHandle | $handle, |
$targetText ) |
Shovels the new translation into translation memory.
Use this for single updates (=after message edit). If no text is provided, entry will be removed from the translation memory.
MessageHandle | $handle | |
string | null | $targetText | Use null to only delete. |
Implements WritableTTMServer.
Definition at line 31 of file DatabaseTTMServer.php.
|
protected |
Definition at line 21 of file DatabaseTTMServer.php.