1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-04 21:28:06 +02:00

All PHPT tests for now complete! Fix an SPL autoload bug.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1564 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-02-18 01:11:17 +00:00
parent 969a027a5b
commit a4abc45505
8 changed files with 38 additions and 88 deletions

View File

@@ -55,4 +55,18 @@ class HTMLPurifier_Bootstrap
return str_replace('_', '/', $class) . '.php';
}
/**
* "Pre-registers" our autoloader on the SPL stack.
*/
public static function registerAutoload() {
$autoload = array('HTMLPurifier_Bootstrap', 'autoload');
if ( ($funcs = spl_autoload_functions()) === false ) {
spl_autoload_register($autoload);
} else {
foreach ($funcs as $func) spl_autoload_unregister($func);
spl_autoload_register($autoload);
foreach ($funcs as $func) spl_autoload_register($func);
}
}
}