r95063 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95062‎ | r95063 | r95064 >
Date:05:01, 20 August 2011
Author:maxsem
Status:ok
Tags:
Comment:
wh_generate.php --> generateTables.php
Modified paths:
  • /trunk/extensions/wikihiero/generateTables.php (added) (history)
  • /trunk/extensions/wikihiero/wh_generate.php (deleted) (history)

Diff [purge]

Index: trunk/extensions/wikihiero/wh_generate.php
@@ -1,100 +0,0 @@
2 -<?php
3 -
4 -//////////////////////////////////////////////////////////////////////////
5 -//
6 -// WikiHiero - A PHP convert from text using "Manual for the encoding of
7 -// hieroglyphic texts for computer input" syntax to HTML entities (table and
8 -// images).
9 -//
10 -// Copyright (C) 2004 Guillaume Blanchard (Aoineko)
11 -//
12 -// This program is free software; you can redistribute it and/or
13 -// modify it under the terms of the GNU General Public License
14 -// as published by the Free Software Foundation; either version 2
15 -// of the License, or any later version.
16 -//
17 -// This program is distributed in the hope that it will be useful,
18 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 -// GNU General Public License for more details.
21 -//
22 -// You should have received a copy of the GNU General Public License
23 -// along with this program; if not, write to the Free Software
24 -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 -//
26 -//////////////////////////////////////////////////////////////////////////
27 -
28 -echo "This script is insecure and shouldn't be used on a public wiki.\n";
29 -exit( 1 );
30 -
31 -
32 -include "wh_main.php";
33 -
34 -if ( array_key_exists( "lang", $_GET ) ) {
35 - $lang = $_GET["lang"];
36 -} else {
37 - $lang = "fr";
38 -}
39 -?>
40 -<html lang=<?php echo htmlspecialchars( $lang ); ?>>
41 - <head>
42 - <title>WikiHiero - Table generator</title>
43 - <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
44 - <link rel="shortcut icon" href="https://www.mediawiki.org/favicon.ico">
45 - </head>
46 - <body bgcolor="#DDDDDD">
47 -
48 - <big><?php echo "WikiHiero v" . WH_VER_MAJ . "." . WH_VER_MED . "." . WH_VER_MIN; ?></big>
49 -
50 - <br /><br />Parsing hieroglyph files and creating tables...<br /><br />
51 -
52 - <?php
53 -
54 - $wh_prefabs = "\$wh_prefabs = array(\n";
55 - $wh_files = "\$wh_files = array(\n";
56 -
57 - $img_dir = dirname( __FILE__ ) . '/img/';
58 -
59 - if ( is_dir( $img_dir ) )
60 - {
61 - $dh = opendir( $img_dir );
62 - if ( $dh )
63 - {
64 - while ( ( $file = readdir( $dh ) ) !== false )
65 - {
66 - if ( stristr( $file, WH_IMG_EXT ) )
67 - {
68 - list( $width, $height, $type, $attr ) = getimagesize( $img_dir . $file );
69 - $wh_files .= " \"" . WH_GetCode( $file ) . "\" => array( $width, $height ),\n";
70 - if ( strchr( $file, '&' ) )
71 - $wh_prefabs .= " \"" . WH_GetCode( $file ) . "\",\n";
72 - }
73 - }
74 - closedir( $dh );
75 - }
76 - }
77 -
78 - $wh_prefabs .= ");";
79 - $wh_files .= ");";
80 -
81 - echo "<pre>$wh_prefabs<br /><br />";
82 - echo "$wh_files<br /><br /></pre>";
83 -
84 - $file = fopen( "wh_list.php", "w+" );
85 - fwrite( $file, "<?php\n\n" );
86 - fwrite( $file, "// File created by wh_generate.php version " . WH_VER_MAJ . "." . WH_VER_MED . "." . WH_VER_MIN . "\n" );
87 - fwrite( $file, "// " . date( "Y/m/d at H:i" ) . "\n\n" );
88 - fwrite( $file, "global \$wh_prefabs, \$wh_files;\n\n" );
89 - fwrite( $file, "$wh_prefabs\n\n" );
90 - fwrite( $file, "$wh_files\n\n" );
91 - fwrite( $file, "?>" );
92 - fclose( $file );
93 -
94 - // if(file_exists("wh_list(0).php"))
95 -
96 - ?>
97 -
98 - <small><?php echo WH_Credit(); ?></small>
99 -
100 - </body>
101 -</html>
Index: trunk/extensions/wikihiero/generateTables.php
@@ -0,0 +1,100 @@
 2+<?php
 3+
 4+//////////////////////////////////////////////////////////////////////////
 5+//
 6+// WikiHiero - A PHP convert from text using "Manual for the encoding of
 7+// hieroglyphic texts for computer input" syntax to HTML entities (table and
 8+// images).
 9+//
 10+// Copyright (C) 2004 Guillaume Blanchard (Aoineko)
 11+//
 12+// This program is free software; you can redistribute it and/or
 13+// modify it under the terms of the GNU General Public License
 14+// as published by the Free Software Foundation; either version 2
 15+// of the License, or any later version.
 16+//
 17+// This program is distributed in the hope that it will be useful,
 18+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 19+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 20+// GNU General Public License for more details.
 21+//
 22+// You should have received a copy of the GNU General Public License
 23+// along with this program; if not, write to the Free Software
 24+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 25+//
 26+//////////////////////////////////////////////////////////////////////////
 27+
 28+echo "This script is insecure and shouldn't be used on a public wiki.\n";
 29+exit( 1 );
 30+
 31+
 32+include "wh_main.php";
 33+
 34+if ( array_key_exists( "lang", $_GET ) ) {
 35+ $lang = $_GET["lang"];
 36+} else {
 37+ $lang = "fr";
 38+}
 39+?>
 40+<html lang=<?php echo htmlspecialchars( $lang ); ?>>
 41+ <head>
 42+ <title>WikiHiero - Table generator</title>
 43+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
 44+ <link rel="shortcut icon" href="https://www.mediawiki.org/favicon.ico">
 45+ </head>
 46+ <body bgcolor="#DDDDDD">
 47+
 48+ <big><?php echo "WikiHiero v" . WH_VER_MAJ . "." . WH_VER_MED . "." . WH_VER_MIN; ?></big>
 49+
 50+ <br /><br />Parsing hieroglyph files and creating tables...<br /><br />
 51+
 52+ <?php
 53+
 54+ $wh_prefabs = "\$wh_prefabs = array(\n";
 55+ $wh_files = "\$wh_files = array(\n";
 56+
 57+ $img_dir = dirname( __FILE__ ) . '/img/';
 58+
 59+ if ( is_dir( $img_dir ) )
 60+ {
 61+ $dh = opendir( $img_dir );
 62+ if ( $dh )
 63+ {
 64+ while ( ( $file = readdir( $dh ) ) !== false )
 65+ {
 66+ if ( stristr( $file, WH_IMG_EXT ) )
 67+ {
 68+ list( $width, $height, $type, $attr ) = getimagesize( $img_dir . $file );
 69+ $wh_files .= " \"" . WH_GetCode( $file ) . "\" => array( $width, $height ),\n";
 70+ if ( strchr( $file, '&' ) )
 71+ $wh_prefabs .= " \"" . WH_GetCode( $file ) . "\",\n";
 72+ }
 73+ }
 74+ closedir( $dh );
 75+ }
 76+ }
 77+
 78+ $wh_prefabs .= ");";
 79+ $wh_files .= ");";
 80+
 81+ echo "<pre>$wh_prefabs<br /><br />";
 82+ echo "$wh_files<br /><br /></pre>";
 83+
 84+ $file = fopen( "wh_list.php", "w+" );
 85+ fwrite( $file, "<?php\n\n" );
 86+ fwrite( $file, "// File created by wh_generate.php version " . WH_VER_MAJ . "." . WH_VER_MED . "." . WH_VER_MIN . "\n" );
 87+ fwrite( $file, "// " . date( "Y/m/d at H:i" ) . "\n\n" );
 88+ fwrite( $file, "global \$wh_prefabs, \$wh_files;\n\n" );
 89+ fwrite( $file, "$wh_prefabs\n\n" );
 90+ fwrite( $file, "$wh_files\n\n" );
 91+ fwrite( $file, "?>" );
 92+ fclose( $file );
 93+
 94+ // if(file_exists("wh_list(0).php"))
 95+
 96+ ?>
 97+
 98+ <small><?php echo WH_Credit(); ?></small>
 99+
 100+ </body>
 101+</html>
Property changes on: trunk/extensions/wikihiero/generateTables.php
___________________________________________________________________
Added: svn:eol-style
1102 + native
Added: svn:keywords
2103 + Author Date Id Revision

Status & tagging log