MediaWiki  REL1_24
GenerateJsonI18n Class Reference

Maintenance script to generate JSON i18n files from a PHP i18n file. More...

Inheritance diagram for GenerateJsonI18n:
Collaboration diagram for GenerateJsonI18n:

List of all members.

Public Member Functions

 __construct ()
 execute ()
 transformI18nFile ($phpfile, $jsondir=null)

Protected Member Functions

 doShim ($jsondir)
 findCommentBefore ($needle, $haystack)
 Find the documentation comment immediately before a given search string.
 getAuthorsFromComment ($comment)
 Get an array of author names from a documentation comment containing.
 shimOnly ($phpfile, $jsondir)

Detailed Description

Maintenance script to generate JSON i18n files from a PHP i18n file.

Definition at line 35 of file generateJsonI18n.php.


Constructor & Destructor Documentation

Reimplemented from Maintenance.

Definition at line 36 of file generateJsonI18n.php.

References Maintenance\addArg(), and Maintenance\addOption().


Member Function Documentation

GenerateJsonI18n::doShim ( jsondir) [protected]

Definition at line 205 of file generateJsonI18n.php.

References $cache, $GLOBALS, $key, $messages, array(), as, FormatJson\decode(), PHP, php, and wfRandomString().

Referenced by shimOnly(), and transformI18nFile().

GenerateJsonI18n::findCommentBefore ( needle,
haystack 
) [protected]

Find the documentation comment immediately before a given search string.

Parameters:
string$needleString to search for
string$haystackString to search in
Returns:
string Substring of $haystack starting at '/**' ending right before $needle, or empty

Definition at line 258 of file generateJsonI18n.php.

Referenced by transformI18nFile().

GenerateJsonI18n::getAuthorsFromComment ( comment) [protected]

Get an array of author names from a documentation comment containing.

Author:
declarations.
Parameters:
string$commentDocumentation comment
Returns:
array Array of author names (strings)

Definition at line 278 of file generateJsonI18n.php.

Referenced by transformI18nFile().

GenerateJsonI18n::shimOnly ( phpfile,
jsondir 
) [protected]

Definition at line 176 of file generateJsonI18n.php.

References array(), doShim(), Maintenance\error(), and Maintenance\output().

Referenced by transformI18nFile().


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