Go to the source code of this file.
|
| $BEAUT_PATH = realpath(".") . "/Services/COPage/syntax_highlight/php" |
|
| if (!isset( $BEAUT_PATH)) |
|
◆ convert()
Definition at line 151 of file HFile_conv.php.
152{
154 global $LANGNAME;
156 $LANGNAME = str_replace(".txt", "", $LANGNAME);
157
158 $fileout = '../object/' . $LANGNAME . '.php';
159
160 print "Writing $file to $fileout\n";
161
162 HFile_parse_file(
$file);
163
164 ob_start();
165 ob_implicit_flush(0);
166
168 $out = ob_get_contents();
169 ob_end_clean();
170
171 if (isset($fileout)) {
172 $fd = fopen($fileout, "w");
174 fclose($fd);
175 }
176}
HFile_print_php_file($tofile=1)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
References $file, $out, HFile_print_php_file(), and print.
Referenced by showHelp().
◆ dump_array()
dump_array |
( |
|
$array, |
|
|
|
$name |
|
) |
| |
◆ dump_colours()
Definition at line 104 of file HFile_conv.php.
105{
106 global $colours;
107
108 $usedcols = array();
109 foreach ($cats as $c) {
110 array_push($usedcols, $colours[$c-1]);
111 }
113}
dump_array($array, $name)
References dump_array().
Referenced by HFile_print_php_file().
◆ dump_hash()
dump_hash |
( |
|
$hash, |
|
|
|
$name |
|
) |
| |
◆ dump_linkscripts()
dump_linkscripts |
( |
|
$cats | ) |
|
Definition at line 85 of file HFile_conv.php.
86{
88// Each category can specify a PHP function that returns an altered
89// version of the keyword.
90 # This link is then placed in a <a href=\"...\">foo</a>; structure around keyword 'foo' - which is
91 \n\n";
92
93 $linkhash = array();
94
95 foreach ($cats as $c) {
96 $linkhash{$c} = "donothing";
97 }
98
99 dump_hash($linkhash,
"\$this->linkscripts ");
100 print "}\n# DoNothing link function\n\n";
101 print "function donothing(\$keywordin)\n{\n return \$keywordin;\n}\n";
102}
References dump_hash(), and print.
Referenced by HFile_print_php_file().
◆ dump_var()
dump_var |
( |
|
$variable, |
|
|
|
$name |
|
) |
| |
◆ get_categories()
Definition at line 71 of file HFile_conv.php.
72{
73 global $keywords;
74 $usedcats = array();
75
76 foreach (array_keys($keywords) as $k) {
77 $cat = $keywords[$k];
78 if (!in_array($cat, $usedcats)) {
79 array_push($usedcats, $cat);
80 }
81 }
82 return $usedcats;
83}
Referenced by HFile_print_php_file().
◆ HFile_print_php_file()
HFile_print_php_file |
( |
|
$tofile = 1 | ) |
|
Definition at line 16 of file HFile_conv.php.
17{
18 global $LANGNAME;
19 global $indent, $unindent, $stringchars,
$config, $keywords, $delimiters, $lang_name;
20 global $linecommenton, $blockcommenton, $blockcommentoff;
21 global $perl, $nocase, $notrim;
22 if ($tofile) {
24 } else {
26 }
27
28 print 'require_once(\'HFile.php\');' .
"\n";
29 print ' class HFile_' . $LANGNAME .
' extends HFile{' .
"\n";
30 print ' function HFile_' . $LANGNAME .
'(){' .
"\n";
31 print ' $this->HFile(); ' .
"\n";
32
33
34
35 print "######################################\n";
36 print "# Beautifier Highlighting Configuration File \n";
37 print "# $lang_name\n";
38 print "######################################\n";
40 dump_var($nocase,
"\$this->nocase ");
41 dump_var($notrim,
"\$this->notrim ");
43 print "\n# Colours\n\n";
46 dump_var(
"blue",
"\$this->quotecolour ");
47 dump_var(
"green",
"\$this->blockcommentcolour");
48 dump_var(
"green",
"\$this->linecommentcolour ");
49 print "\n# Indent Strings\n\n";
52 print "\n# String characters and delimiters\n\n";
53 dump_array($stringchars,
"\$this->stringchars ");
54 dump_array($delimiters,
"\$this->delimiters ");
55 dump_var($escchar,
"\$this->escchar ");
56 print "\n# Comment settings\n\n";
57 dump_var($linecommenton,
"\$this->linecommenton ");
58 dump_var($blockcommenton,
"\$this->blockcommenton ");
59 dump_var($blockcommentoff,
"\$this->blockcommentoff ");
60 print "\n# Keywords (keyword mapping to colour number)\n\n";
61 dump_hash($keywords,
"\$this->keywords ");
62 print "\n# Special extensions\n";
64 if ($tofile) {
66 } else {
68 }
69}
dump_var($variable, $name)
References $config, dump_array(), dump_colours(), dump_hash(), dump_linkscripts(), dump_var(), get_categories(), and print.
Referenced by convert().
◆ $BEAUT_PATH
$BEAUT_PATH = realpath(".") . "/Services/COPage/syntax_highlight/php" |
◆ if
if(!isset($BEAUT_PATH)) |
( |
! |
isset $BEAUT_PATH | ) |
|