From 7b630170bde1251e536b0f2660c569f9373869c4 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Tue, 14 Oct 2025 22:06:33 -0400 Subject: [PATCH] Remove wikimedia_licenses.xml and files that use it This file doesn't seem to be used. Resolves #6504. --- app/src/main/res/xml/wikimedia_licenses.xml | 18 ------ update-license-info/Makefile | 14 ---- update-license-info/include-stubs.php | 68 -------------------- update-license-info/licenses.php | 71 --------------------- 4 files changed, 171 deletions(-) delete mode 100644 app/src/main/res/xml/wikimedia_licenses.xml delete mode 100644 update-license-info/Makefile delete mode 100644 update-license-info/include-stubs.php delete mode 100644 update-license-info/licenses.php diff --git a/app/src/main/res/xml/wikimedia_licenses.xml b/app/src/main/res/xml/wikimedia_licenses.xml deleted file mode 100644 index b9ac19124..000000000 --- a/app/src/main/res/xml/wikimedia_licenses.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/update-license-info/Makefile b/update-license-info/Makefile deleted file mode 100644 index a6c96ee2a..000000000 --- a/update-license-info/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -.FAKE : build update clean install - -build : ../app/src/main/res/xml/wikimedia_licenses.xml - -../app/src/main/res/xml/wikimedia_licenses.xml : licenses.php mediawiki-extensions-UploadWizard - php licenses.php > ../app/src/main/res/xml/wikimedia_licenses.xml - -mediawiki-extensions-UploadWizard : update - -update : - if [ -d mediawiki-extensions-UploadWizard ]; then (cd mediawiki-extensions-UploadWizard && git pull origin master); else git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/UploadWizard mediawiki-extensions-UploadWizard; fi - -clean : - rm -rf mediawiki-extensions-UploadWizard diff --git a/update-license-info/include-stubs.php b/update-license-info/include-stubs.php deleted file mode 100644 index c0a01a0d6..000000000 --- a/update-license-info/include-stubs.php +++ /dev/null @@ -1,68 +0,0 @@ - 'English' ); - } -} -$wgMemc = new FakeMemc(); - -class FakeMessage { - function plain() { - return 'stub-message-plain'; - } - function parse() { - return 'stub-message-parsed'; - } -} - -function wfMessage() { - return new FakeMessage(); -} - -/** - * Converts shorthand byte notation to integer form - * - * @param $string String - * @return Integer - */ -function wfShorthandToInteger( $string = '' ) { - $string = trim( $string ); - if ( $string === '' ) { - return -1; - } - $last = $string[strlen( $string ) - 1]; - $val = intval( $string ); - switch ( $last ) { - case 'g': - case 'G': - $val *= 1024; - // break intentionally missing - case 'm': - case 'M': - $val *= 1024; - // break intentionally missing - case 'k': - case 'K': - $val *= 1024; - } - - return $val; -} - -$wgAPIModules = array(); diff --git a/update-license-info/licenses.php b/update-license-info/licenses.php deleted file mode 100644 index badda1a08..000000000 --- a/update-license-info/licenses.php +++ /dev/null @@ -1,71 +0,0 @@ - -// 2013-09-30 - -require 'include-stubs.php'; -$config = require "mediawiki-extensions-UploadWizard/UploadWizard.config.php"; -require "mediawiki-extensions-UploadWizard/UploadWizard.i18n.php"; -$licenseList = array(); - -foreach ( $config['licenses'] as $key => $license ) { - // Determine template -> license mappings - if ( isset( $license['templates'] ) ) { - $templates = $license['templates']; - } else { - $templates = array( $key ); - } - - if ( count( $templates ) < 1 ) { - throw new Exception("No templates for $key, this is wrong."); - } - if ( count( $templates ) > 1 ) { - //echo "Skipping multi-template license: $key\n"; - continue; - } - $template = $templates[0]; - if ( preg_match( '/^subst:/i', $template ) ) { - //echo "Skipping subst license: $key\n"; - continue; - } - - $msg = $messages['en'][$license['msg']]; - - $licenseInfo = array( - 'desc' => $msg, - 'template' => $template - ); - if ( isset( $license['url'] ) ) { - $url = $license['url']; - if ( substr( $url, 0, 2 ) == '//' ) { - $url = 'https:' . $url; - } - if ( isset( $license['languageCodePrefix'] ) ) { - $url .= $license['languageCodePrefix'] . '$lang'; - } - $licenseInfo['url'] = $url; - } - $licenseList[$key] = $licenseInfo; -} - -//var_dump( $licenseList ); - -echo "\n"; -echo "\n"; -foreach( $licenseList as $key => $licenseInfo ) { - $encId = htmlspecialchars( $key ); - echo " \n"; - -} -echo "\n"; - \ No newline at end of file