4 chdir(dirname(__FILE__));
5 require_once
'common.php';
6 require_once
'../tests/path2class.func.php';
7 require_once
'../library/HTMLPurifier/Bootstrap.php';
17 chdir(dirname(__FILE__) .
'/../library/');
21 'HTMLPurifier/Language/',
22 'HTMLPurifier/ConfigSchema/',
23 'HTMLPurifier/Filter/',
24 'HTMLPurifier/Printer/',
30 'HTMLPurifier/Lexer/PEARSax3.php',
31 'HTMLPurifier/Lexer/PH5P.php',
32 'HTMLPurifier/Printer.php',
36 echo 'Scanning for files... ';
41 $file = substr($file, 2);
42 if (strncmp(
'standalone/', $file, 11) === 0)
continue;
43 if (substr_count($file,
'.') > 1)
continue;
46 if (strncmp($dir, $file, strlen($dir)) === 0) {
71 static $cache =
array();
72 if (isset($cache[$file]))
return $cache[
$file];
73 if (!file_exists($file)) {
74 echo "File doesn't exist: $file\n";
77 $fh = fopen($file,
'r');
81 if (strncmp(
'class', $line, 5) === 0) {
84 $arr = explode(
' extends ', trim($line,
' {'.
"\n\r"), 2);
85 if (count($arr) < 2)
break;
88 if (!$dep_file)
break;
89 $deps[$dep_file] =
true;
94 foreach (array_keys($deps) as $file) {
98 $cache[
$file] = $deps;
116 foreach (
$files as $file) {
117 if (isset($cache[$file]))
continue;
119 foreach (array_keys($deps) as $dep) {
120 if (!isset($cache[$dep])) {
125 $cache[
$file] =
true;
160 foreach (
$files as $file) {
164 echo "Writing HTMLPurifier.includes.php... ";
165 file_put_contents(
'HTMLPurifier.includes.php',
$php);
180 \$__dir = dirname(__FILE__); 184 foreach (
$files as $file) {
185 $php .=
"require_once \$__dir . '/$file';" .
PHP_EOL;
188 echo "Writing HTMLPurifier.safe-includes.php... ";
189 file_put_contents(
'HTMLPurifier.safe-includes.php',
$php);
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
static getPath($class)
Returns the path for a specific class.
Create styles array
The data for the language used.
dep_sort($files)
Sorts files based on dependencies.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
get_dependency_lookup($file)
Returns a lookup array of dependencies for a file.