1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-31 17:42:02 +02:00

minor fixes from home

This commit is contained in:
Steve Clay
2011-10-14 16:10:05 -04:00
parent f67da8e359
commit e71e75e5b0
3 changed files with 55 additions and 58 deletions

View File

@@ -53,7 +53,7 @@ if (! isset($min_cachePath) && ! function_exists('sys_get_temp_dir')) {
ob_start();
?>
<!DOCTYPE HTML>
<!DOCTYPE html>
<title>Minify URI Builder</title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<style>
@@ -176,9 +176,16 @@ by Minify. E.g. <code>@import "<span class=minRoot>/min/?</span>g=css2";</code><
list</a>.</p>
<p><small>Powered by Minify <?php echo Minify::VERSION; ?></small></p>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="jquery-1.6.3.min.js"><\/script>')</script>
<script>
$(function () {
(function () {
// workaround required to test when /min isn't child of web root
var src = "../?f=" + location.pathname.replace(/\/[^\/]*$/, '/_index.js').substr(1);
// load script immediately
document.write('<\script src="' + src + '"><\/script>');
$(function () {
$('#builderScriptSrc')[0].href = src;
// give Minify a few seconds to serve _index.js before showing scary red warning
setTimeout(function () {
if (! window.MUB) {
@@ -212,16 +219,8 @@ $(function () {
);
});
});
});
</script>
<script>
// workaround required to test when /min isn't child of web root
var src = location.pathname.replace(/\/[^\/]*$/, '/_index.js').substr(1);
src = "../?f=" + src;
document.write('<\script type="text/javascript" src="' + src + '"><\/script>');
$(function () {
$('#builderScriptSrc')[0].href = src;
});
});
})();
</script>
</body>
<?php

4
min/builder/jquery-1.6.3.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -388,16 +388,16 @@ class Minify {
}
/**
* On IIS, create $_SERVER['DOCUMENT_ROOT']
* Set $_SERVER['DOCUMENT_ROOT']. On IIS, the value is created from SCRIPT_FILENAME and SCRIPT_NAME.
*
* @param bool $unsetPathInfo (default false) if true, $_SERVER['PATH_INFO']
* will be unset (it is inconsistent with Apache's setting)
*
* @return null
* @param string $docRoot value to use for DOCUMENT_ROOT
*/
public static function setDocRoot($unsetPathInfo = false)
public static function setDocRoot($docRoot = '')
{
if (isset($_SERVER['SERVER_SOFTWARE'])
self::$isDocRootSet = true;
if ($docRoot) {
$_SERVER['DOCUMENT_ROOT'] = $docRoot;
} elseif (isset($_SERVER['SERVER_SOFTWARE'])
&& 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/')
) {
$_SERVER['DOCUMENT_ROOT'] = rtrim(substr(
@@ -405,13 +405,7 @@ class Minify {
,0
,strlen($_SERVER['SCRIPT_FILENAME']) - strlen($_SERVER['SCRIPT_NAME'])
), '\\');
if ($unsetPathInfo) {
unset($_SERVER['PATH_INFO']);
}
require_once 'Minify/Logger.php';
Minify_Logger::log("setDocRoot() set DOCUMENT_ROOT to \"{$_SERVER['DOCUMENT_ROOT']}\"");
}
self::$isDocRootSet = true;
}
/**
@@ -511,7 +505,7 @@ class Minify {
: $defaultOptions;
}
// do we need to process our group right now?
if ($i > 0 // no, the first group doesn't exist yet
if ($i > 0 // yes, we have at least the first group populated
&& (
! $source // yes, we ran out of sources
|| $type === self::TYPE_CSS // yes, to process CSS individually (avoiding PCRE bugs/limits)