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. | |
Protected Member Functions | |
getDB ($mode=DB_SLAVE) | |
insertSource (Title $context, $sourceLanguage, $text) | |
filterForFulltext ($language, $input) | |
Tokenizes the text for fulltext search. | |
processQueryResults ($res, $text, $targetLanguage) | |
Protected Attributes | |
$sids |
Mysql based backend.
Definition at line 17 of file DatabaseTTMServer.php.
DatabaseTTMServer::batchInsertDefinitions | ( | array $ | batch | ) |
Called multiple times per batch if necessary.
Implements WritableTTMServer.
Definition at line 164 of file DatabaseTTMServer.php.
DatabaseTTMServer::batchInsertTranslations | ( | array $ | batch | ) |
Called multiple times per batch if necessary.
Implements WritableTTMServer.
Definition at line 174 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 190 of file DatabaseTTMServer.php.
DatabaseTTMServer::endBootstrap | ( | ) |
Do any cleanup, optimizing etc.
Implements WritableTTMServer.
Definition at line 193 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 205 of file DatabaseTTMServer.php.
DatabaseTTMServer::filterForFulltext | ( | $ | language, | |
$ | input | |||
) | [protected] |
Tokenizes the text for fulltext search.
Tries to find the most useful tokens.
Definition at line 117 of file DatabaseTTMServer.php.
Referenced by insertSource(), and query().
DatabaseTTMServer::getDB | ( | $ | mode = DB_SLAVE |
) | [protected] |
$mode | int DB_SLAVE|DB_MASTER |
Definition at line 24 of file DatabaseTTMServer.php.
Referenced by batchInsertTranslations(), beginBootstrap(), endBootstrap(), insertSource(), query(), and update().
DatabaseTTMServer::insertSource | ( | Title $ | context, | |
$ | sourceLanguage, | |||
$ | text | |||
) | [protected] |
Definition at line 86 of file DatabaseTTMServer.php.
Referenced by batchInsertDefinitions(), and update().
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 201 of file DatabaseTTMServer.php.
DatabaseTTMServer::processQueryResults | ( | $ | res, | |
$ | text, | |||
$ | targetLanguage | |||
) | [protected] |
Definition at line 245 of file DatabaseTTMServer.php.
Referenced by query().
DatabaseTTMServer::query | ( | $ | sourceLanguage, | |
$ | targetLanguage, | |||
$ | text | |||
) |
Fetches all relevant suggestions for given text.
$sourceLanguage | String: language code for the provide text | |
$targetLanguage | String: language code for the suggestions | |
$text | String: the text for which to search suggestions |
Implements ReadableTTMServer.
Definition at line 211 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 28 of file DatabaseTTMServer.php.
DatabaseTTMServer::$sids [protected] |
Definition at line 18 of file DatabaseTTMServer.php.