mediawiki-extensions-Echo/scripts/generatecss.php
James D. Forrester 1ee78723d9 build: Enable phpcs rule 'Generic.PHP.ForbiddenFunctions.FoundWithAlternative' and make pass
Change-Id: Ib883696662745641ee8b59ddb4fe478a44c46a02
2015-10-29 12:57:15 +01:00

29 lines
666 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 = array();
$wgResourceModules = array();
include "Resources.php";
$query = array();
$blacklist = array();
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 );