4 * @ingroup MaintenanceLanguage
7 if ( !isset( $argv[1] ) ) {
8 print "Usage: php {$argv[0]} <filename>\n";
13 define( 'MEDIAWIKI', 1 );
14 define( 'NOT_REALLY_MEDIAWIKI', 1 );
16 $IP = dirname( __FILE__
) . '/../..';
18 require_once( "$IP/includes/Defines.php" );
19 require_once( "$IP/languages/Language.php" );
22 foreach ( $argv as $arg ) {
23 $files = array_merge( $files, glob( $arg ) );
26 foreach ( $files as $filename ) {
28 $vars = getVars( $filename );
29 $keys = array_keys( $vars );
30 $diff = array_diff( $keys, Language
::$mLocalisationKeys );
32 print "\nWarning: unrecognised variable(s): " . implode( ', ', $diff ) ."\n";
38 function getVars( $filename ) {
40 $vars = get_defined_vars();
41 unset( $vars['filename'] );