1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-13 09:34:54 +02:00

+ URI rewriter in CSS min, fix for protocol-relative URIs, + partial minify.php compatibility

This commit is contained in:
Steve Clay
2008-03-01 20:23:50 +00:00
parent 381bd8856d
commit d86d79b7d2
8 changed files with 169 additions and 52 deletions

View File

@@ -55,34 +55,6 @@ class Minify {
: $path;
}
/**
* Create a controller instance and handle the request
*
* @param string type This should be the filename of the controller without
* extension. e.g. 'Group'
*
* @param array $ctrlOptions options for the controller's constructor
*
* @param array $minOptions options passed on to Minify
*
* @return mixed false on failure or array of content and headers sent
*/
public static function serveold($type, $ctrlOptions = array(), $minOptions = array()) {
$class = 'Minify_Controller_' . $type;
if (! class_exists($class, false)) {
require_once "Minify/Controller/{$type}.php";
}
$ctrl = new $class($ctrlOptions, $minOptions);
$ret = self::handleRequest($ctrl);
if (false === $ret) {
if (! isset($ctrl->minOptions['quiet']) || ! $ctrl->minOptions['quiet']) {
header("HTTP/1.0 400 Bad Request");
exit('400 Bad Request');
}
}
return $ret;
}
/**
* Serve a request for a minified file.
*
@@ -219,7 +191,7 @@ class Minify {
// add headers to those from ConditionalGet
//$headers['Content-Length'] = strlen($content);
$headers['Content-Type'] = (null !== self::$_options['contentTypeCharset'])
? self::$_options['contentType'] . ';charset=' . self::$_options['contentTypeCharset']
? self::$_options['contentType'] . '; charset=' . self::$_options['contentTypeCharset']
: self::$_options['contentType'];
if (self::$_options['encodeMethod'] !== '') {
$headers['Content-Encoding'] = $contentEncoding;