MessageGroupStats Class Reference
[Statistics]

This class abstract MessageGroup statistics calculation and storing. More...

List of all members.

Static Public Member Functions

static setTimeLimit ($limit)
 Set the maximum time statistics are calculated.
static getEmptyStats ()
 Returns empty stats array.
static forItem ($id, $code)
 Returns stats for given group in given language.
static forLanguage ($code)
 Returns stats for all groups in given language.
static forGroup ($id)
 Returns stats for all languages in given group.
static forEverything ()
 Returns stats for all group in all languages.
static clear (MessageHandle $handle)
 Clears the cache for all groups associated with the message.
static clearGroup ($id)
static clearLanguage ($code)
static clearAll ()
 Purges all cached stats.
static update (MessageHandle $handle, $changes=array())
static multiAdd (&$a, $b)

Public Attributes

const TABLE = 'translate_groupstats'
 Name of the database table.
const TOTAL = 0
 Array index.
const TRANSLATED = 1
 Array index.
const FUZZY = 2
 Array index.
const PROOFREAD = 3
 Array index.

Static Protected Member Functions

static getUnknownStats ()
 Returns empty stats array that indicates stats are incomplete or unknown.
static extractResults ($res, $stats=array())
static extractNumbers ($row)
 Returns an array of needed database fields.
static forLanguageInternal ($code, $stats=array())
static forGroupInternal ($group, $stats=array())
static selectRowsIdLang ($ids=null, $codes=null)
static forItemInternal (&$stats, $group, $code)
static calculateGroup ($group, $code)
static stringifyNumber ($number)
 Converts input to "+2" "-4" type of string.

Static Protected Attributes

static $timeStart = null
static $limit = null

Detailed Description

This class abstract MessageGroup statistics calculation and storing.

You can access stats easily per language or per group. Stat array for each item is of format array( total, translate, fuzzy ).

Definition at line 19 of file MessageGroupStats.php.


Member Function Documentation

static MessageGroupStats::calculateGroup ( group,
code 
) [static, protected]
Parameters:
MessageGroup $group
string $code Language code
Returns:
array ( total, translated, fuzzy, proofread )

Definition at line 387 of file MessageGroupStats.php.

Referenced by forItemInternal().

static MessageGroupStats::clear ( MessageHandle handle  )  [static]

Clears the cache for all groups associated with the message.

Hook: TranslateEventTranslationEdit Hook: TranslateEventTranslationReview

Definition at line 141 of file MessageGroupStats.php.

Here is the call graph for this function:

static MessageGroupStats::clearAll (  )  [static]

Purges all cached stats.

Definition at line 178 of file MessageGroupStats.php.

static MessageGroupStats::clearGroup ( id  )  [static]
static MessageGroupStats::clearLanguage ( code  )  [static]

Definition at line 165 of file MessageGroupStats.php.

Referenced by SpecialLanguageStats::getTable().

static MessageGroupStats::extractNumbers ( row  )  [static, protected]

Returns an array of needed database fields.

Parameters:
$row 
Returns:
array

Definition at line 215 of file MessageGroupStats.php.

Referenced by extractResults().

static MessageGroupStats::extractResults ( res,
stats = array() 
) [static, protected]

Definition at line 184 of file MessageGroupStats.php.

Referenced by forGroupInternal(), forItem(), forItemInternal(), and forLanguageInternal().

Here is the call graph for this function:

static MessageGroupStats::forEverything (  )  [static]

Returns stats for all group in all languages.

Might be slow, might use lots of memory. Returns two dimensional array indexed by group and language.

Returns:
Array

Definition at line 125 of file MessageGroupStats.php.

Here is the call graph for this function:

static MessageGroupStats::forGroup ( id  )  [static]

Returns stats for all languages in given group.

Parameters:
$id string Group id
Returns:
Array

Definition at line 109 of file MessageGroupStats.php.

Referenced by TTMServerBootstrap::exportGroup(), ApiQueryMessageGroupStats::getData(), SpecialMessageGroupStats::getTable(), and TranslatablePage::getTranslationPercentages().

Here is the call graph for this function:

static MessageGroupStats::forGroupInternal ( group,
stats = array() 
) [static, protected]
Parameters:
MessageGroup $group
array $stats
Returns:
array

Definition at line 268 of file MessageGroupStats.php.

Referenced by forEverything(), and forGroup().

Here is the call graph for this function:

static MessageGroupStats::forItem ( id,
code 
) [static]

Returns stats for given group in given language.

Parameters:
$id string Group id
$code string Language code
Returns:
Array

Definition at line 70 of file MessageGroupStats.php.

Referenced by StatsBar::getNew(), and MessageGroupStatesUpdaterJob::run().

Here is the call graph for this function:

static MessageGroupStats::forItemInternal ( &$  stats,
group,
code 
) [static, protected]

Definition at line 308 of file MessageGroupStats.php.

Referenced by forGroupInternal(), forItem(), and forLanguageInternal().

Here is the call graph for this function:

static MessageGroupStats::forLanguage ( code  )  [static]

Returns stats for all groups in given language.

Parameters:
$code string Language code
Returns:
Array

Definition at line 94 of file MessageGroupStats.php.

Referenced by ApiQueryLanguageStats::getData(), and SpecialLanguageStats::getTable().

Here is the call graph for this function:

static MessageGroupStats::forLanguageInternal ( code,
stats = array() 
) [static, protected]
Parameters:
$code 
array $stats
Returns:
array

Definition at line 229 of file MessageGroupStats.php.

Referenced by forLanguage().

Here is the call graph for this function:

static MessageGroupStats::getEmptyStats (  )  [static]

Returns empty stats array.

Useful because the number of elements may change.

Returns:
array
Since:
2012-09-21

Definition at line 50 of file MessageGroupStats.php.

Referenced by SpecialMessageGroupStats::__construct(), SpecialLanguageStats::__construct(), and forItemInternal().

static MessageGroupStats::getUnknownStats (  )  [static, protected]

Returns empty stats array that indicates stats are incomplete or unknown.

Returns:
array
Since:
2013-01-02

Definition at line 60 of file MessageGroupStats.php.

Referenced by forItem(), and forItemInternal().

static MessageGroupStats::multiAdd ( &$  a,
b 
) [static]
static MessageGroupStats::selectRowsIdLang ( ids = null,
codes = null 
) [static, protected]
static MessageGroupStats::setTimeLimit ( limit  )  [static]

Set the maximum time statistics are calculated.

If the time limit is exceeded, the missing entries will be null.

Parameters:
$limit float time in seconds

Definition at line 39 of file MessageGroupStats.php.

Referenced by ApiStatsQuery::execute(), SpecialMessageGroupStats::getTable(), and SpecialLanguageStats::getTable().

static MessageGroupStats::stringifyNumber ( number  )  [static, protected]

Converts input to "+2" "-4" type of string.

Parameters:
$number int
Returns:
string

Definition at line 438 of file MessageGroupStats.php.

Referenced by update().

static MessageGroupStats::update ( MessageHandle handle,
changes = array() 
) [static]

Definition at line 192 of file MessageGroupStats.php.

Here is the call graph for this function:


Member Data Documentation

MessageGroupStats::$limit = null [static, protected]

Definition at line 31 of file MessageGroupStats.php.

Referenced by setTimeLimit().

MessageGroupStats::$timeStart = null [static, protected]

Definition at line 29 of file MessageGroupStats.php.

const MessageGroupStats::TABLE = 'translate_groupstats'

Name of the database table.

Definition at line 21 of file MessageGroupStats.php.


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