X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Flanguage%2FgenerateUtf8Case.php;h=961424d46d4e0e9e2a119a47bbfdb87197b6b96c;hb=fb7b3eebeb8de47eb42e8d6ccf204106a2d6d9e4;hp=3520b874904b397680c3190906a01a7f8b6dd18a;hpb=ea76d59537c580bdb2ddc8acc4c32fe38ae3f58d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/language/generateUtf8Case.php b/maintenance/language/generateUtf8Case.php index 3520b87490..961424d46d 100644 --- a/maintenance/language/generateUtf8Case.php +++ b/maintenance/language/generateUtf8Case.php @@ -37,8 +37,8 @@ class GenerateUtf8Case extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = 'Generate Utf8Case.ser from the Unicode Character Database ' . - 'and supplementary files'; + $this->addDescription( 'Generate Utf8Case.ser from the Unicode Character Database ' . + 'and supplementary files' ); $this->addOption( 'unicode-data-file', 'The local location of the data file ' . 'from http://unicode.org/Public/UNIDATA/UnicodeData.txt', false, true ); } @@ -70,7 +70,7 @@ class GenerateUtf8Case extends Maintenance { } // For the file format, see http://www.unicode.org/reports/tr44/ - $fieldNames = array( + $fieldNames = [ 'Code', 'Name', 'General_Category', @@ -86,10 +86,10 @@ class GenerateUtf8Case extends Maintenance { 'Simple_Uppercase_Mapping', 'Simple_Lowercase_Mapping', 'Simple_Titlecase_Mapping' - ); + ]; - $upper = array(); - $lower = array(); + $upper = []; + $lower = []; $lineNum = 0; while ( false !== ( $line = fgets( $file ) ) ) { @@ -103,7 +103,7 @@ class GenerateUtf8Case extends Maintenance { # Split fields $numberedData = explode( ';', $line ); - $data = array(); + $data = []; foreach ( $fieldNames as $number => $name ) { $data[$name] = $numberedData[$number]; } @@ -118,10 +118,10 @@ class GenerateUtf8Case extends Maintenance { } global $IP; - file_put_contents( "$IP/serialized/Utf8Case.ser", serialize( array( + file_put_contents( "$IP/serialized/Utf8Case.ser", serialize( [ 'wikiUpperChars' => $upper, 'wikiLowerChars' => $lower, - ) ) ); + ] ) ); } }