mirror of
https://github.com/mrclay/minify.git
synced 2025-08-14 01:54:11 +02:00
Issue 60. Zlib no longer required, but unit tests gives a "WARN" that encoding will not be performed.
This commit is contained in:
@@ -263,9 +263,11 @@ class Minify {
|
||||
// generate & cache content
|
||||
$content = self::_combineMinify();
|
||||
self::$_cache->store($cacheId, $content);
|
||||
if (function_exists('gzdeflate')) {
|
||||
self::$_cache->store($cacheId . '.zd', gzdeflate($content, self::$_options['encodeLevel']));
|
||||
self::$_cache->store($cacheId . '.zg', gzencode($content, self::$_options['encodeLevel']));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// no cache
|
||||
$cacheIsReady = false;
|
||||
|
@@ -43,7 +43,7 @@ abstract class Minify_Controller_Base {
|
||||
public function getDefaultMinifyOptions() {
|
||||
return array(
|
||||
'isPublic' => true
|
||||
,'encodeOutput' => true
|
||||
,'encodeOutput' => function_exists('gzdeflate')
|
||||
,'encodeMethod' => null // determine later
|
||||
,'encodeLevel' => 9
|
||||
,'minifierOptions' => array() // no minifier options
|
||||
|
@@ -88,6 +88,11 @@ function test_HTTP_Encoder()
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('gzdeflate')) {
|
||||
echo "!WARN: HTTP_Encoder : Zlib support is not present in PHP. Encoding cannot be performed/tested.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
// test compression of varied content (HTML,JS, & CSS)
|
||||
$variedContent = file_get_contents($thisDir . '/_test_files/html/before.html')
|
||||
. file_get_contents($thisDir . '/_test_files/css/subsilver.css')
|
||||
|
Reference in New Issue
Block a user