Remove support for MediaWiki 1.29 and earlier

extension.json already requires "MediaWiki": ">= 1.30.0".

Change-Id: Ic460e6364967cd7b0367e66f613077c424bd8f19
This commit is contained in:
Fomafix
2018-08-31 16:42:22 +02:00
committed by jenkins-bot
parent 137fb70a75
commit 72fb42cdba
4 changed files with 7 additions and 43 deletions

View File

@@ -93,7 +93,7 @@ class FontRepoCompiler {
foreach ( [ 'woff', 'woff2' ] as $format ) {
if ( isset( $font[$format] ) ) {
$info[$format] = $this->getFontWebPath( $fontpath, $fontdir, $font[$format] );
$info[$format] = OutputPage::transformFilePath( $fontdir, $fontpath, $font[$format] );
}
}
@@ -101,7 +101,7 @@ class FontRepoCompiler {
if ( !isset( $info['woff'] ) ) {
foreach ( glob( "$fontpath/*.{woff,woff2}", GLOB_BRACE ) as $fontfile ) {
$type = substr( $fontfile, strrpos( $fontfile, '.' ) + 1 );
$info[$type] = $this->getFontWebPath( $fontpath, $fontdir, basename( $fontfile ) );
$info[$type] = OutputPage::transformFilePath( $fontdir, $fontpath, basename( $fontfile ) );
}
}
@@ -120,14 +120,4 @@ class FontRepoCompiler {
return $info;
}
private function getFontWebPath( $path, $fontdir, $filename ) {
if ( method_exists( 'OutputPage', 'transformFilePath' ) ) {
return OutputPage::transformFilePath( $fontdir, $path, $filename );
}
// BC for MediaWiki <= 1.27
$hash = md5_file( "$path/$filename" );
return "$fontdir/$filename?" . substr( $hash, 0, 5 );
}
}