MediaWiki  1.23.14
validate.php
Go to the documentation of this file.
1 <?php
24 if ( PHP_SAPI != 'cli' ) {
25  die( "Run me from the command line please.\n" );
26 }
27 
28 if ( !isset( $argv[1] ) ) {
29  print "Usage: php {$argv[0]} <filename>\n";
30  exit( 1 );
31 }
32 array_shift( $argv );
33 
34 define( 'MEDIAWIKI', 1 );
35 define( 'NOT_REALLY_MEDIAWIKI', 1 );
36 
37 $IP = __DIR__ . '/../..';
38 
39 require_once "$IP/includes/Defines.php";
40 require_once "$IP/languages/Language.php";
41 
43 foreach ( $argv as $arg ) {
44  $files = array_merge( $files, glob( $arg ) );
45 }
46 
47 foreach ( $files as $filename ) {
48  print "$filename...";
49  $vars = getVars( $filename );
50  $keys = array_keys( $vars );
51  $diff = array_diff( $keys, Language::$mLocalisationKeys );
52  if ( $diff ) {
53  print "\nWarning: unrecognised variable(s): " . implode( ', ', $diff ) . "\n";
54  } else {
55  print " ok\n";
56  }
57 }
58 
59 function getVars( $filename ) {
60  require $filename;
61  $vars = get_defined_vars();
62  unset( $vars['filename'] );
63 
64  return $vars;
65 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
getVars
foreach( $argv as $arg) foreach( $files as $filename) getVars( $filename)
Definition: validate.php:59
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
$IP
$IP
Definition: validate.php:37
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
$keys
$keys
Definition: testCompression.php:63
$vars
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
Definition: hooks.txt:1684
$files
$files
Definition: validate.php:42