Example #1
0
<?php

/**
 * Setup common include path
 */
set_include_path(__DIR__ . '/src' . PATH_SEPARATOR . get_include_path());
/**
 * Include setup files and initialise autoloaders
 */
require_once 'Benchmark/Timer.php';
require_once 'HTMLPurifier.auto.php';
require_once 'htmLawed.php';
require_once 'Wibble/Loader.php';
$loader = new \Wibble\Loader();
$loader->register();
define('HTMLPURIFIER_CACHE', __DIR__ . '/cache');
define('BENCHMARK_ITERATIONS', 200);
/**
 * Benchmark WIP - Install "Benchmark" package from PEAR
 */
$timer = new Benchmark_Timer();
/**
 * Directory deletion function for HTMLPurifier's cache
 */
function recursiveDelete($str)
{
    if (is_file($str)) {
        return @unlink($str);
    } elseif (is_dir($str)) {
        $scan = glob(rtrim($str, '/') . '/*');
        foreach ($scan as $index => $path) {
Example #2
0
 public function tearDown()
 {
     spl_autoload_unregister('\\Wibble\\Loader::loadClass');
     $loader = new \Wibble\Loader();
     $loader->register();
 }