Remove wikimedia_licenses.xml and files that use it

This file doesn't seem to be used.

Resolves #6504.
This commit is contained in:
Amir E. Aharoni 2025-10-14 22:06:33 -04:00
parent 09c8d987e1
commit 7b630170bd
4 changed files with 0 additions and 171 deletions

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<licenses xmlns="https://www.mediawiki.org/wiki/Extension:UploadWizard/xmlns/licenses">
<license id="cc-by-4.0" template="cc-by-4.0" url="https://creativecommons.org/licenses/by/4.0/deed.$lang"/>
<license id="cc-by-sa-4.0" template="cc-by-sa-4.0" url="https://creativecommons.org/licenses/by-sa/4.0/deed.$lang"/>
<license id="cc-by-sa-3.0" template="cc-by-sa-3.0" url="https://creativecommons.org/licenses/by-sa/3.0/deed.$lang"/>
<license id="cc-by-sa-3.0-at" template="cc-by-sa-3.0-at" url="https://creativecommons.org/licenses/by-sa/3.0/at/deed.$lang"/>
<license id="cc-by-sa-3.0-de" template="cc-by-sa-3.0-de" url="https://creativecommons.org/licenses/by-sa/3.0/de/deed.$lang"/>
<license id="cc-by-sa-3.0-ee" template="cc-by-sa-3.0-ee" url="https://creativecommons.org/licenses/by-sa/3.0/ee/deed.$lang"/>
<license id="cc-by-sa-3.0-es" template="cc-by-sa-3.0-es" url="https://creativecommons.org/licenses/by-sa/3.0/es/deed.$lang"/>
<license id="cc-by-sa-3.0-hr" template="cc-by-sa-3.0-hr" url="https://creativecommons.org/licenses/by-sa/3.0/hr/deed.$lang"/>
<license id="cc-by-sa-3.0-lu" template="cc-by-sa-3.0-lu" url="https://creativecommons.org/licenses/by-sa/3.0/lu/deed.$lang"/>
<license id="cc-by-sa-3.0-nl" template="cc-by-sa-3.0-nl" url="https://creativecommons.org/licenses/by-sa/3.0/nl/deed.$lang"/>
<license id="cc-by-sa-3.0-no" template="cc-by-sa-3.0-no" url="https://creativecommons.org/licenses/by-sa/3.0/no/deed.$lang"/>
<license id="cc-by-sa-3.0-pl" template="cc-by-sa-3.0-pl" url="https://creativecommons.org/licenses/by-sa/3.0/pl/deed.$lang"/>
<license id="cc-by-sa-3.0-ro" template="cc-by-sa-3.0-ro" url="https://creativecommons.org/licenses/by-sa/3.0/ro/deed.$lang"/>
<license id="cc-by-3.0" template="cc-by-3.0" url="https://creativecommons.org/licenses/by/3.0/deed.$lang"/>
<license id="cc-zero" template="cc-zero" url="https://creativecommons.org/publicdomain/zero/1.0/deed.$lang"/>
</licenses>

View file

@ -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

View file

@ -1,68 +0,0 @@
<?php
// Stubs for enough of the MediaWiki environment to run UploadWizard.config.php
global $wgFileExtensions, $wgServer, $wgScriptPath, $wgAPIModules, $wgMaxUploadSize, $wgLang, $wgMemc, $wgUploadWizardConfig;
class FakeLang {
function getCode() {
return 'en';
}
}
$wgLang = new FakeLang();
function wfMemcKey() {
return 'fake-key';
}
class FakeMemc {
function get() {
return array( 'en' => '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();

View file

@ -1,71 +0,0 @@
<?php
// Quick hack to extract default license list from UploadWizard configuration.
// In future, try to export this info via the API on wiki so we can pull dynamically.
//
// Brion Vibber <brion@pobox.com>
// 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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<licenses xmlns=\"https://www.mediawiki.org/wiki/Extension:UploadWizard/xmlns/licenses\">\n";
foreach( $licenseList as $key => $licenseInfo ) {
$encId = htmlspecialchars( $key );
echo " <license id=\"$encId\"";
$encTemplate = htmlspecialchars( $licenseInfo['template'] );
echo " template=\"$encTemplate\"";
if ( isset( $licenseInfo['url'] ) ) {
$encUrl = htmlspecialchars( $licenseInfo['url'] );
echo " url=\"$encUrl\"";
}
echo "/>\n";
}
echo "</licenses>\n";