Some general static methods for instantiating TTMServer and helpers. More...
Static Public Member Functions | |
static | factory ($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) |
Hook: ArticleDeleteComplete Switch to this when BC goes no further than 1.21: public static function onDelete( WikiPage $wikipage ) {. | |
static | onChange (MessageHandle $handle, $text, $fuzzy) |
Called from TranslateEditAddons::onSave. | |
static | onGroupChange (MessageHandle $handle, $old, $new) |
Protected Member Functions | |
__construct ($config) | |
Static Protected Member Functions | |
static | qualitySort ($a, $b) |
Protected Attributes | |
$config |
Some general static methods for instantiating TTMServer and helpers.
Definition at line 18 of file TTMServer.php.
TTMServer::__construct | ( | $ | config | ) | [protected] |
Reimplemented in SolrTTMServer.
Definition at line 21 of file TTMServer.php.
static TTMServer::factory | ( | $ | config | ) | [static] |
Definition at line 25 of file TTMServer.php.
Referenced by ApiTTMServer::execute(), TTMServerBootstrap::exportGroup(), DatabaseTTMServer::filterForFulltext(), TranslationHelpers::formatTTMServerSuggestions(), TTMServerAid::getData(), TranslationHelpers::getSuggestionBox(), TranslationHelpers::getTTMServerBox(), primary(), and SolrTTMServerTest::testSearchableTTMServer().
static TTMServer::levenshtein | ( | $ | str1, | |
$ | str2, | |||
$ | length1, | |||
$ | length2 | |||
) | [static] |
PHP implementation of Levenshtein edit distance algorithm.
Uses the native PHP implementation when possible for speed. The native levenshtein is limited to 255 bytes.
$str1 | ||
$str2 | ||
$length1 | ||
$length2 |
Definition at line 90 of file TTMServer.php.
Referenced by DatabaseTTMServer::processQueryResults().
static TTMServer::onChange | ( | MessageHandle $ | handle, | |
$ | text, | |||
$ | fuzzy | |||
) | [static] |
Called from TranslateEditAddons::onSave.
Definition at line 138 of file TTMServer.php.
Referenced by TranslateEditAddons::onSave(), and TTMServerMessageUpdateJob::run().
static TTMServer::onDelete | ( | $ | wikipage | ) | [static] |
Hook: ArticleDeleteComplete Switch to this when BC goes no further than 1.21: public static function onDelete( WikiPage $wikipage ) {.
Definition at line 130 of file TTMServer.php.
static TTMServer::onGroupChange | ( | MessageHandle $ | handle, | |
$ | old, | |||
$ | new | |||
) | [static] |
static TTMServer::primary | ( | ) | [static] |
Returns the primary server instance, useful for chaining.
Primary one is defined as config with key TTMServer in $wgTranslateTranslationServices.
Definition at line 51 of file TTMServer.php.
Referenced by SpecialSearchTranslations::execute(), onChange(), onDelete(), and TTMServerTest::testConstruct().
static TTMServer::qualitySort | ( | $ | a, | |
$ | b | |||
) | [static, protected] |
Definition at line 69 of file TTMServer.php.
static TTMServer::sortSuggestions | ( | array $ | suggestions | ) | [static] |
Definition at line 63 of file TTMServer.php.
Referenced by TTMServerAid::getData(), and DatabaseTTMServer::processQueryResults().
TTMServer::$config [protected] |
Definition at line 19 of file TTMServer.php.
Referenced by __construct(), SolrTTMServer::__construct(), and factory().