r69047 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69046‎ | r69047 | r69048 >
Date:09:12, 5 July 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Tweaked script description to reflect new intented use + more standard $IP detection
Modified paths:
  • /trunk/extensions/Translate/scripts/tm-export.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/tm-export.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Script to export messages for translatetoolkit translation memory
 4+ * Script to bootstrap translatetoolkit translation memory
55 *
66 * @author Niklas Laxstrom
77 *
@@ -9,11 +9,12 @@
1010 * @file
1111 */
1212
13 -$optionsWithArgs = array( 'target' );
14 -
15 -$dir = dirname( __FILE__ ); $IP = "$dir/../../..";
16 -@include( "$dir/../../CorePath.php" ); // Allow override
17 -define( 'TRANSLATE_CLI', 1 );
 13+// Standard boilerplate to define $IP
 14+if ( getenv( 'MW_INSTALL_PATH' ) !== false ) {
 15+ $IP = getenv( 'MW_INSTALL_PATH' );
 16+} else {
 17+ $dir = dirname( __FILE__ ); $IP = "$dir/../../..";
 18+}
1819 require_once( "$IP/maintenance/Maintenance.php" );
1920
2021 class TMExport extends Maintenance {

Status & tagging log