MediaWiki  1.23.14
generateNormalizerDataMl.php
Go to the documentation of this file.
1 <?php
24 require_once __DIR__ . '/../Maintenance.php';
25 
33  public function __construct() {
34  parent::__construct();
35  $this->mDescription = 'Generate the normalizer data file for Malayalam';
36  }
37 
38  public function getDbType() {
39  return Maintenance::DB_NONE;
40  }
41 
42  public function execute() {
43  $hexPairs = array(
44  # From http://unicode.org/versions/Unicode5.1.0/#Malayalam_Chillu_Characters
45  '0D23 0D4D 200D' => '0D7A',
46  '0D28 0D4D 200D' => '0D7B',
47  '0D30 0D4D 200D' => '0D7C',
48  '0D32 0D4D 200D' => '0D7D',
49  '0D33 0D4D 200D' => '0D7E',
50 
51  # From http://permalink.gmane.org/gmane.science.linguistics.wikipedia.technical/46413
52  '0D15 0D4D 200D' => '0D7F',
53  );
54 
55  $pairs = array();
56  foreach ( $hexPairs as $hexSource => $hexDest ) {
57  $source = hexSequenceToUtf8( $hexSource );
58  $dest = hexSequenceToUtf8( $hexDest );
59  $pairs[$source] = $dest;
60  }
61 
62  global $IP;
63  file_put_contents( "$IP/serialized/normalize-ml.ser", serialize( $pairs ) );
64  echo "ml: " . count( $pairs ) . " pairs written.\n";
65  }
66 }
67 
68 $maintClass = 'GenerateNormalizerDataMl';
69 require_once RUN_MAINTENANCE_IF_MAIN;
$maintClass
$maintClass
Definition: generateNormalizerDataMl.php:68
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
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition: maintenance.txt:50
GenerateNormalizerDataMl\__construct
__construct()
Default constructor.
Definition: generateNormalizerDataMl.php:33
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: maintenance.txt:39
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
GenerateNormalizerDataMl\execute
execute()
Do the actual work.
Definition: generateNormalizerDataMl.php:42
Maintenance\DB_NONE
const DB_NONE
Constants for DB access type.
Definition: Maintenance.php:57
hexSequenceToUtf8
hexSequenceToUtf8( $sequence)
Take a series of space-separated hexadecimal numbers representing Unicode code points and return a UT...
Definition: UtfNormalUtil.php:61
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
$source
if(PHP_SAPI !='cli') $source
Definition: mwdoc-filter.php:18
GenerateNormalizerDataMl\getDbType
getDbType()
Does the script need different DB access? By default, we give Maintenance scripts normal rights to th...
Definition: generateNormalizerDataMl.php:38
$IP
$IP
Definition: WebStart.php:92
GenerateNormalizerDataMl
Generates the normalizer data file for Malayalam.
Definition: generateNormalizerDataMl.php:32