mediawiki-extensions-Echo/scripts/generatecss.php
Fomafix 1e71b8bef3 Use PHP's implode() with the suggested order of arguments
https://secure.php.net/manual/en/function.implode.php defines the order
of arguments as

 string implode ( string $glue , array $pieces )
 string implode ( array $pieces )

Note:
  implode() can, for historical reasons, accept its parameters in
  either order. For consistency with explode(), however, it may be less
  confusing to use the documented order of arguments.

Change-Id: I74468fe2833c897ec9a7ddeb5a1e5b50bb50da94
2018-04-16 20:21:44 +02:00

29 lines
646 B
PHP

<?php
if ( count( $argv ) < 3 ) {
print "Call with 2 arguments: the path to the load url and the file to output to";
exit();
}
$loadUrl = $argv[1];
$outputFile = $argv[2];
define( 'MEDIAWIKI', true );
const NS_MAIN = 0;
$wgVersion = 1.23;
$wgSpecialPages = [];
$wgResourceModules = [];
include "Resources.php";
$query = [];
$blacklist = [];
foreach ( $wgResourceModules as $moduleName => $def ) {
if ( !in_array( $moduleName, $blacklist ) ) {
$query[] = $moduleName;
}
}
$url = $loadUrl . '?only=styles&skin=vector&modules=' . implode( '|', $query );
echo $url;
$css = file_get_contents( $url );
file_put_contents( $outputFile, $css );