2 HTMLPurifier.auto.php using spl_autoload_register with user registration loading test
5 if (!function_exists('spl_autoload_register')) {
6 echo "skip - spl_autoload_register() not available";
10 function my_autoload($class) {
11 echo "Autoloading $class...
13 eval("class $class {}");
17 public static function myAutoload($class) {
18 if ($class == 'Foo') {
19 echo "Special autoloading Foo...
21 eval("class $class {}");
26 spl_autoload_register(array('MyClass', 'myAutoload'));
27 spl_autoload_register('my_autoload');
29 require '../library/HTMLPurifier.auto.php';
30 require 'HTMLPurifier/PHPT/loading/_autoload.inc';
31 $config = HTMLPurifier_Config::createDefault();
32 $purifier = new HTMLPurifier($config);
33 echo $purifier->purify('<b>Salsa!') . "
36 // purposely invoke older autoloads
42 Special autoloading Foo...