MediaWiki REL1_33
digit2html.php
Go to the documentation of this file.
1<?php
24require_once __DIR__ . '/../Maintenance.php';
25
31class Digit2Html extends Maintenance {
32
33 # A list of unicode numerals is available at:
34 # https://www.fileformat.info/info/unicode/category/Nd/list.htm
35 private $mLangs = [
36 'Ar', 'As', 'Bh', 'Bo', 'Dz',
37 'Fa', 'Gu', 'Hi', 'Km', 'Kn',
38 'Ks', 'Lo', 'Ml', 'Mr', 'Ne',
39 'New', 'Or', 'Pa', 'Pi', 'Sa'
40 ];
41
42 public function __construct() {
43 parent::__construct();
44 $this->addDescription( 'Check digit transformation' );
45 }
46
47 public function execute() {
48 foreach ( $this->mLangs as $code ) {
49 $filename = Language::getMessagesFileName( $code );
50 $this->output( "Loading language [$code] ... " );
52 require_once $filename;
53 if ( !isset( $digitTransformTable ) ) {
54 $this->error( "\$digitTransformTable not found for lang: $code" );
55 continue;
56 }
57
58 $this->output( "OK\n\$digitTransformTable = [\n" );
59 foreach ( $digitTransformTable as $latin => $translation ) {
60 $htmlent = bin2hex( $translation );
61 $this->output( "'$latin' => '$translation', # &#x$htmlent;\n" );
62 }
63 $this->output( "];\n" );
64 }
65 }
66}
67
68$maintClass = Digit2Html::class;
69require_once RUN_MAINTENANCE_IF_MAIN;
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$digitTransformTable
Maintenance script that check digit transformation.
execute()
Do the actual work.
__construct()
Default constructor.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
addDescription( $text)
Set the description text.
$maintClass
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults error
Definition hooks.txt:2644
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Definition hooks.txt:856
require_once RUN_MAINTENANCE_IF_MAIN