MediaWiki  REL1_22
CheckLanguageCLI Class Reference
Inheritance diagram for CheckLanguageCLI:

List of all members.

Public Member Functions

 __construct (array $options)
 Constructor.
 execute ()
 Execute the script.
 outputWiki ()
 Output the checks results as wiki text.

Protected Member Functions

 checkLanguage ($code)
 Check a language.
 defaultChecks ()
 Get the default checks.
 doChecks ()
 Execute the checks.
 easyChecks ()
 Get the checks that can easily be treated by non-speakers of the language.
 formatKey ($key, $code)
 Format a message key.
 getCheckBlacklist ()
 Get the check blacklist.
 getChecks ()
 Get all checks.
 getDescriptions ()
 Get all check descriptions.
 getTotalCount ()
 Get total count for each check non-messages check.
 help ()
 Get help.
 isEmpty ()
 Check if there are any results for the checks, in any language.
 nonMessageChecks ()
 Get the checks which check other things than messages.
 outputText ()
 Output the checks results as plain text.

Protected Attributes

 $checkAll = false
 $checks = array()
 $code = null
 $doLinks = false
 $L = null
 $level = 2
 $linksPrefix = ''
 $output = 'plain'
 $results = array()
 $wikiCode = 'en'

Private Attributes

 $includeExif = false

Detailed Description

Definition at line 27 of file checkLanguage.inc.


Constructor & Destructor Documentation

Constructor.

Parameters:
$optionsarray Options for script.

Definition at line 46 of file checkLanguage.inc.

References code, defaultChecks(), easyChecks(), global, help(), and output().


Member Function Documentation

CheckLanguageCLI::checkLanguage ( code) [protected]

Check a language.

Parameters:
$codestring The language code.
Exceptions:
MWException
Returns:
array The results.

Reimplemented in CheckExtensionsCLI.

Definition at line 312 of file checkLanguage.inc.

References $checkBlacklist, $code, $results, array(), as, getCheckBlacklist(), and getChecks().

Referenced by doChecks(), and help().

Get the default checks.

Returns:
array A list of the default checks.

Reimplemented in CheckExtensionsCLI.

Definition at line 99 of file checkLanguage.inc.

References array().

Referenced by __construct().

CheckLanguageCLI::doChecks ( ) [protected]

Execute the checks.

Definition at line 276 of file checkLanguage.inc.

References array(), as, checkLanguage(), and code.

Referenced by execute(), and CheckExtensionsCLI\execute().

Get the checks that can easily be treated by non-speakers of the language.

Returns:
Array A list of the easy checks.

Reimplemented in CheckExtensionsCLI.

Definition at line 123 of file checkLanguage.inc.

References array().

Referenced by __construct().

Execute the script.

Reimplemented in CheckExtensionsCLI.

Definition at line 257 of file checkLanguage.inc.

References doChecks(), output(), outputText(), and outputWiki().

CheckLanguageCLI::formatKey ( key,
code 
) [protected]

Format a message key.

Parameters:
$keystring The message key.
$codestring The language code.
Returns:
string The formatted message key.

Definition at line 347 of file checkLanguage.inc.

References $code, and $key.

Referenced by outputText(), and outputWiki().

Get the check blacklist.

Returns:
array The list of checks which should not be executed.

Definition at line 300 of file checkLanguage.inc.

References $checkBlacklist, and global.

Referenced by checkLanguage().

CheckLanguageCLI::getChecks ( ) [protected]

Get all checks.

Returns:
array An array of all check names mapped to their function names.

Definition at line 134 of file checkLanguage.inc.

References array().

Referenced by checkLanguage().

Get all check descriptions.

Returns:
array An array of all check names mapped to their descriptions.

Definition at line 181 of file checkLanguage.inc.

References array().

Referenced by outputText().

Get total count for each check non-messages check.

Returns:
array An array of all check names mapped to a two-element array: function name to get the total count and language code or null for checked code.

Definition at line 164 of file checkLanguage.inc.

References array().

Referenced by outputText().

CheckLanguageCLI::help ( ) [protected]

Get help.

Returns:
string The help string.

Reimplemented in CheckExtensionsCLI.

Definition at line 209 of file checkLanguage.inc.

References add, are, broken, characters, check, checkLanguage(), code, complete, content, empty, errors, file, following, form, headers, in, installation, is, language, line, list, message, messages, of, off, on, only, output(), over, page, pages, project, result, settings, Special, specific, that, them, used, values, well, were, and wiki.

Referenced by __construct().

CheckLanguageCLI::isEmpty ( ) [protected]

Check if there are any results for the checks, in any language.

Returns:
bool True if there are any results, false if not.

Definition at line 467 of file checkLanguage.inc.

References $messages, $results, as, and empty.

Referenced by CheckExtensionsCLI\checkLanguage().

Get the checks which check other things than messages.

Returns:
array A list of the non-message checks.

Reimplemented in CheckExtensionsCLI.

Definition at line 112 of file checkLanguage.inc.

References array().

Referenced by outputText(), and outputWiki().

Output the checks results as plain text.

Definition at line 363 of file checkLanguage.inc.

References $code, $count, $key, $messages, $results, $total, $value, array(), as, empty, formatKey(), getDescriptions(), getTotalCount(), and nonMessageChecks().

Referenced by CheckExtensionsCLI\checkLanguage(), and execute().


Member Data Documentation

CheckLanguageCLI::$checkAll = false [protected]

Definition at line 33 of file checkLanguage.inc.

CheckLanguageCLI::$checks = array() [protected]

Definition at line 35 of file checkLanguage.inc.

CheckLanguageCLI::$code = null [protected]
CheckLanguageCLI::$doLinks = false [protected]

Definition at line 30 of file checkLanguage.inc.

CheckLanguageCLI::$includeExif = false [private]

Definition at line 40 of file checkLanguage.inc.

CheckLanguageCLI::$L = null [protected]

Definition at line 36 of file checkLanguage.inc.

CheckLanguageCLI::$level = 2 [protected]

Definition at line 29 of file checkLanguage.inc.

CheckLanguageCLI::$linksPrefix = '' [protected]

Definition at line 31 of file checkLanguage.inc.

CheckLanguageCLI::$output = 'plain' [protected]

Definition at line 34 of file checkLanguage.inc.

CheckLanguageCLI::$results = array() [protected]

Definition at line 38 of file checkLanguage.inc.

Referenced by checkLanguage(), isEmpty(), outputText(), and outputWiki().

CheckLanguageCLI::$wikiCode = 'en' [protected]

Definition at line 32 of file checkLanguage.inc.


The documentation for this class was generated from the following file: