This class abstract MessageGroup statistics calculation and storing. More...
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 |
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.
static MessageGroupStats::calculateGroup | ( | $ | group, | |
$ | code | |||
) | [static, protected] |
MessageGroup | $group | |
string | $code Language code |
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.
static MessageGroupStats::clearAll | ( | ) | [static] |
Purges all cached stats.
Definition at line 178 of file MessageGroupStats.php.
static MessageGroupStats::clearGroup | ( | $ | id | ) | [static] |
Definition at line 155 of file MessageGroupStats.php.
Referenced by MessageIndex::clearMessageGroupStats(), SpecialPageTranslation::execute(), and SpecialMessageGroupStats::getTable().
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.
$row |
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().
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.
Definition at line 125 of file MessageGroupStats.php.
static MessageGroupStats::forGroup | ( | $ | id | ) | [static] |
Returns stats for all languages in given group.
$id | string Group id |
Definition at line 109 of file MessageGroupStats.php.
Referenced by TTMServerBootstrap::exportGroup(), ApiQueryMessageGroupStats::getData(), SpecialMessageGroupStats::getTable(), and TranslatablePage::getTranslationPercentages().
static MessageGroupStats::forGroupInternal | ( | $ | group, | |
$ | stats = array() | |||
) | [static, protected] |
MessageGroup | $group | |
array | $stats |
Definition at line 268 of file MessageGroupStats.php.
Referenced by forEverything(), and forGroup().
static MessageGroupStats::forItem | ( | $ | id, | |
$ | code | |||
) | [static] |
Returns stats for given group in given language.
$id | string Group id | |
$code | string Language code |
Definition at line 70 of file MessageGroupStats.php.
Referenced by StatsBar::getNew(), and MessageGroupStatesUpdaterJob::run().
static MessageGroupStats::forItemInternal | ( | &$ | stats, | |
$ | group, | |||
$ | code | |||
) | [static, protected] |
Definition at line 308 of file MessageGroupStats.php.
Referenced by forGroupInternal(), forItem(), and forLanguageInternal().
static MessageGroupStats::forLanguage | ( | $ | code | ) | [static] |
Returns stats for all groups in given language.
$code | string Language code |
Definition at line 94 of file MessageGroupStats.php.
Referenced by ApiQueryLanguageStats::getData(), and SpecialLanguageStats::getTable().
static MessageGroupStats::forLanguageInternal | ( | $ | code, | |
$ | stats = array() | |||
) | [static, protected] |
$code | ||
array | $stats |
Definition at line 229 of file MessageGroupStats.php.
Referenced by forLanguage().
static MessageGroupStats::getEmptyStats | ( | ) | [static] |
Returns empty stats array.
Useful because the number of elements may change.
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.
Definition at line 60 of file MessageGroupStats.php.
Referenced by forItem(), and forItemInternal().
static MessageGroupStats::multiAdd | ( | &$ | a, | |
$ | b | |||
) | [static] |
Definition at line 371 of file MessageGroupStats.php.
Referenced by forItemInternal(), SpecialLanguageStats::makeGroupRow(), and SpecialMessageGroupStats::makeRow().
static MessageGroupStats::selectRowsIdLang | ( | $ | ids = null , |
|
$ | codes = null | |||
) | [static, protected] |
Definition at line 292 of file MessageGroupStats.php.
Referenced by forGroupInternal(), forItem(), forItemInternal(), and forLanguageInternal().
static MessageGroupStats::setTimeLimit | ( | $ | limit | ) | [static] |
Set the maximum time statistics are calculated.
If the time limit is exceeded, the missing entries will be null.
$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.
$number | int |
Definition at line 438 of file MessageGroupStats.php.
Referenced by update().
static MessageGroupStats::update | ( | MessageHandle $ | handle, | |
$ | changes = array() | |||
) | [static] |
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::FUZZY = 2 |
Array index.
Definition at line 25 of file MessageGroupStats.php.
Referenced by StatsBar::getHtml(), MessageGroupStatesUpdaterJob::getStatValue(), SpecialLanguageStats::makeGroupRow(), ApiStatsQuery::makeItem(), StatsTable::makeNumberColumns(), SpecialMessageGroupStats::makeRow(), and MessageGroupStatesUpdaterJobTest::testGetStatValue().
const MessageGroupStats::PROOFREAD = 3 |
Array index.
Definition at line 26 of file MessageGroupStats.php.
Referenced by StatsBar::getHtml(), MessageGroupStatesUpdaterJob::getStatValue(), ApiStatsQuery::makeItem(), and MessageGroupStatesUpdaterJobTest::testGetStatValue().
const MessageGroupStats::TABLE = 'translate_groupstats' |
Name of the database table.
Definition at line 21 of file MessageGroupStats.php.
const MessageGroupStats::TOTAL = 0 |
Array index.
Definition at line 23 of file MessageGroupStats.php.
Referenced by ApiStatsQuery::execute(), StatsBar::getHtml(), MessageGroupStatesUpdaterJob::getNewState(), MessageGroupStatesUpdaterJob::getStatValue(), TranslatablePage::getTranslationPercentages(), SpecialLanguageStats::makeGroupRow(), ApiStatsQuery::makeItem(), StatsTable::makeNumberColumns(), SpecialMessageGroupStats::makeRow(), and MessageGroupStatesUpdaterJobTest::testGetStatValue().
const MessageGroupStats::TRANSLATED = 1 |
Array index.
Definition at line 24 of file MessageGroupStats.php.
Referenced by TTMServerBootstrap::exportGroup(), StatsBar::getHtml(), MessageGroupStatesUpdaterJob::getStatValue(), TranslatablePage::getTranslationPercentages(), SpecialLanguageStats::makeGroupRow(), ApiStatsQuery::makeItem(), StatsTable::makeNumberColumns(), SpecialMessageGroupStats::makeRow(), and MessageGroupStatesUpdaterJobTest::testGetStatValue().