4 chdir(dirname(__FILE__));
5 require_once
'common.php';
21 $output_file =
'../library/HTMLPurifier/EntityLookup/entities.ser';
28 } elseif ($dec < 2048) {
29 $utf = chr(192 + (($dec - ($dec % 64)) / 64));
30 $utf .= chr(128 + ($dec % 64));
32 $utf = chr(224 + (($dec - ($dec % 4096)) / 4096));
33 $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64));
34 $utf .= chr(128 + ($dec % 64));
39 if ( !is_dir(
$entity_dir) )
exit(
"Fatal Error: Can't find entity directory.\n");
40 if ( file_exists(
$output_file) )
exit(
"Fatal Error: output file already exists.\n");
43 if ( !$dh )
exit(
"Fatal Error: Cannot read entity directory.\n");
45 $entity_files =
array();
46 while ((
$file = readdir($dh)) !==
false) {
47 if (@
$file[0] ===
'.')
continue;
48 if (substr(strrchr(
$file,
"."), 1) !==
'ent')
continue;
49 $entity_files[] =
$file;
53 if ( !$entity_files )
exit(
"Fatal Error: No entity files to parse.\n");
55 $entity_table =
array();
56 $regexp =
'/<!ENTITY\s+([A-Za-z0-9]+)\s+"&#(?:38;#)?([0-9]+);">/';
58 foreach ( $entity_files as
$file ) {
61 preg_match_all($regexp,
$contents, $matches, PREG_SET_ORDER);
62 foreach ($matches as $match) {
63 $entity_table[$match[1]] =
unichr($match[2]);
73 echo "Completed successfully.";
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file