$baseDir); } else { // we are in a subdirectory adjust symlink $rootdir = preg_replace('!' . $dir[0] . '$!', '', $baseDir); $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(); foreach ($filenames as $filename) { if (preg_match($filenamePattern, $filename) && file_exists($baseDir . $filename) ) { $servefiles[] = $baseDir . $filename; } } //options for minify request $serveOptions = array( 'quiet' => false, 'rewriteCssUris' => true, 'files' => $servefiles, 'maxAge' => 31536000, // now + 1 yr 'bubbleCssImports' => 'true' ); //include option for symlinks and merge with $serveOptions $min_serveOptions['minifierOptions']['text/css']['symlinks'] = $min_symlinks; if (!empty($rootdir)) { $min_serveOptions['minifierOptions']['text/css']['prependRelativePath'] = $rootdir; } $serveOptions = array_merge($serveOptions, $min_serveOptions); //and SERVE SpeedsterMinify::serve('Files', $serveOptions); exit(); } header("HTTP/1.0 404 Not Found"); echo "HTTP/1.0 404 Not Found";