TTMServer Class Reference
[The Translate extension translation memory interface]

Some general static methods for instantiating TTMServer and helpers. More...

Inheritance diagram for TTMServer:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Some general static methods for instantiating TTMServer and helpers.

Since:
2012-01-28 Rewritten in 2012-06-27.

Definition at line 18 of file TTMServer.php.


Constructor & Destructor Documentation

TTMServer::__construct ( config  )  [protected]

Reimplemented in SolrTTMServer.

Definition at line 21 of file TTMServer.php.


Member Function Documentation

static TTMServer::factory ( config  )  [static]
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.

Parameters:
$str1 
$str2 
$length1 
$length2 
Returns:
int

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

static TTMServer::onGroupChange ( MessageHandle handle,
old,
new 
) [static]

Definition at line 145 of file TTMServer.php.

Here is the call graph for this function:

static TTMServer::primary (  )  [static]

Returns the primary server instance, useful for chaining.

Primary one is defined as config with key TTMServer in $wgTranslateTranslationServices.

Returns:
WritableTTMServer

Definition at line 51 of file TTMServer.php.

Referenced by SpecialSearchTranslations::execute(), onChange(), onDelete(), and TTMServerTest::testConstruct().

Here is the call graph for this function:

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().


Member Data Documentation

TTMServer::$config [protected]

Definition at line 19 of file TTMServer.php.

Referenced by __construct(), SolrTTMServer::__construct(), and factory().


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:56 2013 for MediaWiki Translate Extension by  doxygen 1.6.3