X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=blobdiff_plain;f=includes%2Fnormal%2FUtfNormalGenerate.php;h=f392df52aad026e7f70a8388a97646ec371bcfca;hb=6c163ad26532346ae30984ad1423ee4bf5aed561;hp=f0eb5330d968083b9f71cce45932eea6ae0fb0fa;hpb=14c53b728fe55f9ad21647b2303c49f1cb491901;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/normal/UtfNormalGenerate.php b/includes/normal/UtfNormalGenerate.php index f0eb5330d9..f392df52aa 100644 --- a/includes/normal/UtfNormalGenerate.php +++ b/includes/normal/UtfNormalGenerate.php @@ -1,43 +1,42 @@ -# http://www.mediawiki.org/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# http://www.gnu.org/copyleft/gpl.html - /** * This script generates UniNormalData.inc from the Unicode Character Database * and supplementary files. * - * @package UtfNormal - * @access private + * Copyright (C) 2004 Brion Vibber + * http://www.mediawiki.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup UtfNormal */ -/** */ - -if( php_sapi_name() != 'cli' ) { +if( PHP_SAPI != 'cli' ) { die( "Run me from the command line please.\n" ); } +require_once 'UtfNormalDefines.php'; require_once 'UtfNormalUtil.php'; $in = fopen("DerivedNormalizationProps.txt", "rt" ); if( !$in ) { print "Can't open DerivedNormalizationProps.txt for reading.\n"; print "If necessary, fetch this file from the internet:\n"; - print "http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt\n"; + print "http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt\n"; exit(-1); } print "Initializing normalization quick check tables...\n"; @@ -91,7 +90,7 @@ $canon = 0; print "Reading character definitions...\n"; while( false !== ($line = fgets( $in ) ) ) { - $columns = split(';', $line); + $columns = explode(';', $line); $codepoint = $columns[0]; $name = $columns[1]; $canonicalCombiningClass = $columns[3]; @@ -175,15 +174,15 @@ if( $out ) { /** * This file was automatically generated -- do not edit! * Run UtfNormalGenerate.php to create this file again (make clean && make) - * @package MediaWiki + * + * @file */ -/** */ -global \$utfCombiningClass, \$utfCanonicalComp, \$utfCanonicalDecomp, \$utfCheckNFC; -\$utfCombiningClass = unserialize( '$serCombining' ); -\$utfCanonicalComp = unserialize( '$serComp' ); -\$utfCanonicalDecomp = unserialize( '$serCanon' ); -\$utfCheckNFC = unserialize( '$serCheckNFC' ); -?" . ">\n"; + +UtfNormal::\$utfCombiningClass = unserialize( '$serCombining' ); +UtfNormal::\$utfCanonicalComp = unserialize( '$serComp' ); +UtfNormal::\$utfCanonicalDecomp = unserialize( '$serCanon' ); +UtfNormal::\$utfCheckNFC = unserialize( '$serCheckNFC' ); +\n"; fputs( $out, $outdata ); fclose( $out ); print "Wrote out UtfNormalData.inc\n"; @@ -200,12 +199,12 @@ if( $out ) { /** * This file was automatically generated -- do not edit! * Run UtfNormalGenerate.php to create this file again (make clean && make) - * @package MediaWiki + * + * @file */ -/** */ -global \$utfCompatibilityDecomp; -\$utfCompatibilityDecomp = unserialize( '$serCompat' ); -?" . ">\n"; + +UtfNormal::\$utfCompatibilityDecomp = unserialize( '$serCompat' ); +\n"; fputs( $out, $outdata ); fclose( $out ); print "Wrote out UtfNormalDataK.inc\n"; @@ -232,5 +231,3 @@ function callbackCompat( $matches ) { } return $matches[1]; } - -?>