Index: trunk/extensions/Translate/scripts/tm-export.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * Script to export messages for translatetoolkit translation memory |
| 4 | + * Script to bootstrap translatetoolkit translation memory |
5 | 5 | * |
6 | 6 | * @author Niklas Laxstrom |
7 | 7 | * |
— | — | @@ -9,11 +9,12 @@ |
10 | 10 | * @file |
11 | 11 | */ |
12 | 12 | |
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 | +} |
18 | 19 | require_once( "$IP/maintenance/Maintenance.php" ); |
19 | 20 | |
20 | 21 | class TMExport extends Maintenance { |