MediaWiki  1.23.6
digit2html.php
Go to the documentation of this file.
1 <?php
24 require_once __DIR__ . '/../Maintenance.php';
25 
31 class Digit2Html extends Maintenance {
32 
33  # A list of unicode numerals is available at:
34  # http://www.fileformat.info/info/unicode/category/Nd/list.htm
35  private $mLangs = array(
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->mDescription = "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] ... " );
51  unset( $digitTransformTable );
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 = array(\n" );
59  foreach ( $digitTransformTable as $latin => $translation ) {
60  $htmlent = utf8ToHexSequence( $translation );
61  $this->output( "'$latin' => '$translation', # &#x$htmlent;\n" );
62  }
63  $this->output( ");\n" );
64  }
65  }
66 }
67 
68 $maintClass = "Digit2Html";
69 require_once RUN_MAINTENANCE_IF_MAIN;
Digit2Html\__construct
__construct()
Default constructor.
Definition: digit2html.php:42
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
utf8ToHexSequence
utf8ToHexSequence( $str)
Take a UTF-8 string and return a space-separated series of hex numbers representing Unicode code poin...
Definition: UtfNormalUtil.php:78
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
Language\getMessagesFileName
static getMessagesFileName( $code)
Definition: Language.php:4090
Digit2Html\execute
execute()
Do the actual work.
Definition: digit2html.php:47
Digit2Html\$mLangs
$mLangs
Definition: digit2html.php:35
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
Maintenance\error
error( $err, $die=0)
Throw an error to the user.
Definition: Maintenance.php:333
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition: Maintenance.php:314
$digitTransformTable
$digitTransformTable
Definition: MessagesAr.php:84
$maintClass
$maintClass
Definition: digit2html.php:68
Digit2Html
Maintenance script that check digit transformation.
Definition: digit2html.php:31