From 75daa0a92609d412a2ebb3fb1aab578afc1c47c2 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Mon, 10 Jan 2022 11:16:37 +0530 Subject: [PATCH] Fix broken webfonts build scripts In f9532855ad92ad1a1d4fff760da20b1367a2a829 classes were namespaced that broke the maintenance scripts referring them. Follow up: f9532855ad92ad1a1d4fff760da20b1367a2a829 Change-Id: I2b9658ed06cd75c25789bad8bb867e39eba6afcd --- scripts/compile-font-repo.php | 7 ++++++- scripts/generate-font-test-page.php | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/compile-font-repo.php b/scripts/compile-font-repo.php index 1c4fcf11..03b467c0 100644 --- a/scripts/compile-font-repo.php +++ b/scripts/compile-font-repo.php @@ -6,6 +6,11 @@ * @file */ +namespace UniversalLanguageSelector; + +use FormatJson; +use Maintenance; + // Standard boilerplate to define $IP if ( getenv( 'MW_INSTALL_PATH' ) !== false ) { $IP = getenv( 'MW_INSTALL_PATH' ); @@ -46,5 +51,5 @@ JAVASCRIPT; } } -$maintClass = 'CompileFontRepo'; +$maintClass = 'UniversalLanguageSelector\CompileFontRepo'; require_once RUN_MAINTENANCE_IF_MAIN; diff --git a/scripts/generate-font-test-page.php b/scripts/generate-font-test-page.php index 5f851969..bae28b59 100644 --- a/scripts/generate-font-test-page.php +++ b/scripts/generate-font-test-page.php @@ -6,6 +6,12 @@ * @file */ +namespace UniversalLanguageSelector; + +use FormatJson; +use Html; +use Maintenance; + // Standard boilerplate to define $IP if ( getenv( 'MW_INSTALL_PATH' ) !== false ) { $IP = getenv( 'MW_INSTALL_PATH' ); @@ -35,6 +41,9 @@ class GenerateFontTestPage extends Maintenance { $body = ''; foreach ( $list['languages'] as $code => $fonts ) { + if ( !isset( $corpus[$code] ) ) { + continue; + } foreach ( $fonts as $fontname ) { if ( $fontname === 'system' ) { continue; @@ -93,5 +102,5 @@ HTML; } } -$maintClass = 'GenerateFontTestPage'; +$maintClass = 'UniversalLanguageSelector\GenerateFontTestPage'; require_once RUN_MAINTENANCE_IF_MAIN;