1
0
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:
Steve Clay
2008-10-08 14:20:34 +00:00
parent 340c8a91fe
commit 44f8668c92
3 changed files with 10 additions and 3 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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')