4 chdir(dirname(__FILE__));
5 require_once
'common.php';
30 if ($entry[0] ==
'.') {
35 public function copy($source, $dest)
50 return preg_replace_callback(
51 "/require(?:_once)? ['\"]([^'\"]+)['\"];/",
52 'replace_includes_callback',
65 $text = preg_replace(
'#// vim:.+#',
'',
$text);
66 return substr(
$text, 5);
76 return $FS->copyr($dir,
'standalone/' . $dir);
86 $FS->mkdirr(
'standalone/' . dirname(
$file));
101 return file_put_contents($sfile,
$contents);
113 'XML/HTMLSax3.php' => 1
115 if (isset($preserve[
$file])) {
118 if (isset(
$GLOBALS[
'loaded'][$file]))
return '';
123 echo 'Generating includes file... ';
124 shell_exec(
'php generate-includes.php');
127 chdir(dirname(__FILE__) .
'/../library/');
129 echo 'Creating full file...';
133 "define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));",
134 "define('HTMLPURIFIER_PREFIX', dirname(__FILE__) . '/standalone'); 135 set_include_path(HTMLPURIFIER_PREFIX . PATH_SEPARATOR . get_include_path());",
138 file_put_contents(
'HTMLPurifier.standalone.php',
$contents);
141 echo 'Creating standalone directory...';
142 $FS->rmdirr(
'standalone');
145 $FS->mkdirr(
'standalone/HTMLPurifier/DefinitionCache/Serializer');
remove_php_tags($text)
Removes leading PHP tags from included files.
replace_includes_callback($matches)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
make_dir_standalone($dir)
Copies the contents of a directory to the standalone directory.
replace_includes($text)
Replaces the includes inside PHP source code with the corresponding source.
copy_and_remove_includes($file, $sfile)
Copies a file to another location recursively, if it is a PHP file remove includes.
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
Create styles array
The data for the language used.
make_file_standalone($file)
Copies the contents of a file to the standalone directory.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file