4chdir(dirname(__FILE__));
 
    5require_once 
'common.php';
 
   30        if ($entry[0] == 
'.') {
 
   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])) {
 
  123echo 
'Generating includes file... ';
 
  124shell_exec(
'php generate-includes.php');
 
  127chdir(dirname(__FILE__) . 
'/../library/');
 
  129echo 
'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());",
 
  138file_put_contents(
'HTMLPurifier.standalone.php', 
$contents);
 
  141echo 
'Creating standalone directory...';
 
  142$FS->rmdirr(
'standalone'); 
 
  145$FS->mkdirr(
'standalone/HTMLPurifier/DefinitionCache/Serializer');
 
An exception for terminatinating execution or to throw for unit testing.
replace_includes_callback($matches)
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.
make_file_standalone($file)
Copies the contents of a file to the standalone directory.
copy_and_remove_includes($file, $sfile)
Copies a file to another location recursively, if it is a PHP file remove includes.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
remove_php_tags($text)
Removes leading PHP tags from included files.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file