示例#1
0
} else {
    // we are in a subdirectory adjust symlink
    $rootdir = preg_replace('!' . $dir[0] . '$!', '', BP);
    $min_symlinks = array('//' => $rootdir);
    //use this for ~user apache installs
    //$min_symlinks=array( '/'.$dir[0]=>$rootdir);
}

// Serve
if (isset($_GET['f'])) {
    $_GET['f'] = str_replace("\x00", '', (string)$_GET['f']);
    $filenames = explode(",", $_GET['f']);
    $filenamePattern = '/[^\'"\\/\\\\]+\\.(?:' . implode('|', $serveExtensions) . ')$/';

    if ($minifyCachePath) {
        SpeedsterMinify::setCache($minifyCachePath);
    }

    if ($min_documentRoot) {
        $_SERVER['DOCUMENT_ROOT'] = $min_documentRoot;
    } elseif (0 === stripos(PHP_OS, 'win')) {
        SpeedsterMinify::setDocRoot(); // IIS may need help
    }

    //on some apache installs this is needed
    if (array_key_exists('SUBDOMAIN_DOCUMENT_ROOT', $_SERVER)) {
        $_SERVER['DOCUMENT_ROOT'] = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'];
    }

    //check if requested files exists and add to minify request
    $servefiles = array();