r72100 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72099‎ | r72100 | r72101 >
Date:12:02, 1 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Docu updates
Modified paths:
  • /trunk/extensions/Translate/Doxyfile (modified) (history)
  • /trunk/extensions/Translate/SpecialFirstSteps.php (modified) (history)
  • /trunk/extensions/Translate/SpecialImportTranslations.php (modified) (history)
  • /trunk/extensions/Translate/SpecialLanguageStats.php (modified) (history)
  • /trunk/extensions/Translate/SpecialMagic.php (modified) (history)
  • /trunk/extensions/Translate/SpecialMyLanguage.php (modified) (history)
  • /trunk/extensions/Translate/SpecialSupportedLanguages.php (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslationChanges.php (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslationStats.php (modified) (history)
  • /trunk/extensions/Translate/SpecialTranslations.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/scripts/cli.inc (modified) (history)
  • /trunk/extensions/Translate/scripts/groupStatistics.php (modified) (history)
  • /trunk/extensions/Translate/scripts/languageeditstats.php (modified) (history)
  • /trunk/extensions/Translate/utils/Font.php (modified) (history)
  • /trunk/extensions/Translate/utils/MemoryCache.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialMyLanguage.php
@@ -14,7 +14,7 @@
1515 *
1616 * Usage: [[Special:MyLanguage/Page name|link text]]
1717 *
18 - * @ingroup SpecialPage
 18+ * @ingroup SpecialPage TranslateSpecialPage
1919 */
2020 class SpecialMyLanguage extends UnlistedSpecialPage {
2121 /**
Index: trunk/extensions/Translate/Doxyfile
@@ -57,7 +57,7 @@
5858 # configuration options related to the input files
5959 #---------------------------------------------------------------------------
6060 INPUT =
61 -FILE_PATTERNS = *.php
 61+FILE_PATTERNS = *.php *.inc
6262 RECURSIVE = YES
6363 EXCLUDE = spyc
6464 EXCLUDE_SYMLINKS = YES
@@ -170,7 +170,7 @@
171171 #---------------------------------------------------------------------------
172172 # Configuration::additions related to external references
173173 #---------------------------------------------------------------------------
174 -TAGFILES =
 174+TAGFILES = ../../docs/html/tagfile.xml=http://svn.wikimedia.org/doc
175175 GENERATE_TAGFILE =
176176 ALLEXTERNALS = NO
177177 EXTERNAL_GROUPS = YES
Index: trunk/extensions/Translate/scripts/cli.inc
@@ -7,8 +7,11 @@
88 * @copyright Copyright © 2008-2010, Niklas Laxström
99 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1010 * @file
 11+ * @defgroup Script Command line scripts
 12+ * @todo Migrate cli scripts to use the new Maintenance class.
1113 */
1214
 15+///@{
1316 // Standard boilerplate to define $IP
1417 if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
1518 $IP = getenv( 'MW_INSTALL_PATH' );
@@ -17,7 +20,16 @@
1821 }
1922 define( 'TRANSLATE_CLI', 1 );
2023 require_once( "$IP/maintenance/commandLine.inc" );
 24+///@}
2125
 26+/**
 27+ * Output a message to command line (if available).
 28+ * @param $str \string The message.
 29+ * @param $channel \mixed Channel identifier. Consecutive messages to
 30+ * the same channel do not get automatic newlines between then,
 31+ * @param $force \bool Do not suppress output even if script was run
 32+ * with --quiet
 33+ */
2234 function STDOUT( $str, $channel = null, $force = false ) {
2335 global $options;
2436
@@ -54,16 +66,28 @@
5567 $lastChannel = $channel;
5668 }
5769
 70+/**
 71+ * Output a warning message to command line (if available).
 72+ * @see STDOUT
 73+ */
5874 function STDERR( $message, $channel = null ) {
5975 STDOUT( $message, $channel, true );
6076 }
6177
 78+///@{
6279 register_shutdown_function('STDOUT', false);
 80+///@}
6381
6482 /**
65 - * @todo Needs documentation.
 83+ * A general CLI utility class.
 84+ * @todo Move elsewhere?
6685 */
6786 class Cli {
 87+ /**
 88+ * Parses list of language codes to an array.
 89+ * @param $codes \string Command line input.
 90+ * @return \list{String} Language codes.
 91+ */
6892 public static function parseLanguageCodes( /* string */ $codes ) {
6993 $langs = array_map( 'trim', explode( ',', $codes ) );
7094 if ( $langs[0] === '*' ) {
Index: trunk/extensions/Translate/scripts/groupStatistics.php
@@ -7,6 +7,7 @@
88 * @copyright Copyright © 2007-2010, Niklas Laxström, Siebrand Mazeland
99 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1010 * @file
 11+ * @ingroup Script Stats
1112 */
1213
1314 /**
@@ -164,6 +165,7 @@
165166
166167 /**
167168 * @todo Needs documentation.
 169+ * @ingroup Stats
168170 */
169171 class TranslateStatsOutput extends wikiStatsOutput {
170172 function heading() {
Index: trunk/extensions/Translate/scripts/languageeditstats.php
@@ -4,9 +4,10 @@
55 *
66 * @author Niklas Laxström
77 * @author Siebrand Mazeland
8 - * @copyright Copyright © 2008 Niklas Laxström, Siebrand Mazeland
 8+ * @copyright Copyright © 2008-2010 Niklas Laxström, Siebrand Mazeland
99 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1010 * @file
 11+ * @ingroup Script Stats
1112 */
1213
1314 $optionsWithArgs = array( 'top', 'days', 'bots', 'ns' );
Index: trunk/extensions/Translate/SpecialLanguageStats.php
@@ -18,7 +18,7 @@
1919 * Use {{Special:LanguageStats/nl/1}} to show for 'nl' and suppres completely
2020 * translated groups.
2121 *
22 - * @ingroup SpecialPage
 22+ * @ingroup SpecialPage TranslateSpecialPage Stats
2323 */
2424 class SpecialLanguageStats extends IncludableSpecialPage {
2525 function __construct() {
Index: trunk/extensions/Translate/SpecialFirstSteps.php
@@ -13,7 +13,7 @@
1414 * Implements a special page which assists users to become translators.
1515 * Currently it is tailored for the needs of translatewiki.net
1616 *
17 - * @ingroup SpecialPage
 17+ * @ingroup SpecialPage TranslateSpecialPage
1818 */
1919 class SpecialFirstSteps extends UnlistedSpecialPage {
2020 protected $skin, $user, $out;
Index: trunk/extensions/Translate/SpecialSupportedLanguages.php
@@ -17,7 +17,7 @@
1818 * "translators". The subpage "translators" must contain the template
1919 * [[:{{ns:template}}:User|User]], taking a user name as parameter.
2020 *
21 - * @ingroup SpecialPage
 21+ * @ingroup SpecialPage TranslateSpecialPage
2222 */
2323 class SpecialSupportedLanguages extends UnlistedSpecialPage {
2424 public function __construct() {
Index: trunk/extensions/Translate/SpecialImportTranslations.php
@@ -12,7 +12,7 @@
1313 * Special page to import Gettext (.po) files exported using Translate extension.
1414 * Does not support generic Gettext files.
1515 *
16 - * @ingroup SpecialPage
 16+ * @ingroup SpecialPage TranslateSpecialPage
1717 */
1818 class SpecialImportTranslations extends SpecialPage {
1919 /**
Index: trunk/extensions/Translate/SpecialTranslationStats.php
@@ -1,6 +1,7 @@
22 <?php
33 /**
44 * Contains logic for special page Special:TranslationStats.
 5+ * @defgroup Stats Statistics
56 *
67 * @file
78 * @author Niklas Laxström
@@ -11,7 +12,7 @@
1213 /**
1314 * Includable special page for generating graphs on translations.
1415 *
15 - * @ingroup SpecialPage
 16+ * @ingroup SpecialPage TranslateSpecialPage Stats
1617 * @todo Needs documentation.
1718 */
1819 class SpecialTranslationStats extends IncludableSpecialPage {
Index: trunk/extensions/Translate/SpecialTranslationChanges.php
@@ -13,7 +13,7 @@
1414 * Implementation of Special:TranslationChanges special page. Gives an overview
1515 * per message group of translations in a given number of hours.
1616 *
17 - * @ingroup SpecialPage
 17+ * @ingroup SpecialPage TranslateSpecialPage
1818 */
1919 class SpecialTranslationChanges extends SpecialPage {
2020 const MSG = 'translationchanges-';
Index: trunk/extensions/Translate/Translate.php
@@ -644,4 +644,4 @@
645645 $wgNamespacesToBeSearchedDefault[$id] = true;
646646 }
647647
648 -/** @defgroup SpecialPage Special pages */
 648+/** @defgroup TranslateSpecialPage Special pages of Translate extension */
Index: trunk/extensions/Translate/utils/MemoryCache.php
@@ -12,6 +12,7 @@
1313 * Class for caching translation completion percentages.
1414 * @todo Figure out a better name.
1515 * @todo Tries to be generic, but is not.
 16+ * @ingroup Stats
1617 */
1718 class ArrayMemoryCache {
1819 /// Key for the data stored
Index: trunk/extensions/Translate/utils/Font.php
@@ -2,18 +2,24 @@
33 /**
44 * Contains class with wrapper around font-config.
55 *
 6+ * @author Niklas Laxström
 7+ * @copyright Copyright © 2008-2010, Niklas Laxström
 8+ * @license Public Domain
69 * @file
7 - * @author Niklas Laxström, 2008
8 - * @license Public Domain
910 */
1011
1112 /**
1213 * Wrapper around font-config to get useful ttf font given a language code.
13 - * Uses wfShellExec, wfEscapeShellArg and wfDebugLog from MediaWiki.
 14+ * Uses wfShellExec, wfEscapeShellArg and wfDebugLog, wfGetCache and
 15+ * wfMemckey from %MediaWiki.
1416 *
15 - * @todo Needs documentation.
 17+ * @ingroup Stats
1618 */
1719 class FCFontFinder {
 20+ /**
 21+ * Searches for suitable font in the system.
 22+ * @param $code \string Language code.
 23+ */
1824 public static function find( $code ) {
1925 if ( ini_get( 'open_basedir' ) ) {
2026 wfDebugLog( 'fcfont', 'Disabled because of open_basedir is active' );
Index: trunk/extensions/Translate/utils/TranslationStats.php
@@ -11,6 +11,7 @@
1212
1313 /**
1414 * Contains methods that provide statistics for message groups.
 15+ * @ingroup Stats
1516 */
1617 class TranslationStats {
1718 /**
Index: trunk/extensions/Translate/SpecialMagic.php
@@ -9,14 +9,15 @@
1010 */
1111
1212 /**
13 - * This special page helps with the translations of MediaWiki features that are
 13+ * This special page helps with the translations of %MediaWiki features that are
1414 * not in the main messages array (special page aliases, magic words, namespace names).
1515 *
16 - * @ingroup SpecialPage
 16+ * @ingroup SpecialPage TranslateSpecialPage
1717 */
1818 class SpecialMagic extends SpecialPage {
1919 /**
2020 * Message prefix for translations
 21+ * @todo Remove.
2122 */
2223 const MSG = 'translate-magic-';
2324
Index: trunk/extensions/Translate/SpecialTranslations.php
@@ -13,7 +13,7 @@
1414 * Implements a special page which shows all translations for a message.
1515 * Bits taken from SpecialPrefixindex.php and TranslateTasks.php
1616 *
17 - * @ingroup SpecialPage
 17+ * @ingroup SpecialPage TranslateSpecialPage
1818 */
1919 class SpecialTranslations extends SpecialAllpages {
2020 function __construct() {

Status & tagging log