mirror of
https://github.com/mrclay/minify.git
synced 2025-09-06 04:02:54 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1928e89208 | ||
|
e4ba869444 | ||
|
2c83b82bfa | ||
|
32150b84b6 | ||
|
48a34d6900 | ||
|
a36e201ab2 | ||
|
fefc85d481 | ||
|
21cc3e7224 | ||
|
176fb1084f |
23
HISTORY.txt
23
HISTORY.txt
@@ -1,6 +1,19 @@
|
||||
Minify Release History
|
||||
|
||||
Version 2.3.0
|
||||
Version 2.3.3 (2017-11-03)
|
||||
* Fix closure-compiler's error "redirection limit reached". #618, #619
|
||||
|
||||
Version 2.3.2 (2017-06-09)
|
||||
* PHP 7.1 compatibility fix. #600
|
||||
|
||||
Version 2.3.1 (2017-04-03)
|
||||
* No longer alters inline SVG id URLs. #517, #519
|
||||
* Use $min_libPath in examples and move it within config.php. #522, #524
|
||||
* Prevent false mod_rewrite error. #540
|
||||
* Sync JSMin with mrclay/jsmin-php. #537
|
||||
* URI rewriter passes through empty URLs. #561, #564
|
||||
|
||||
Version 2.3.0 (2016-03-11)
|
||||
* Adds `$min_concatOnly` option to just concatenate files
|
||||
* Deprecates use of Minify_Loader
|
||||
* Deprecates use of Minify_Logger
|
||||
@@ -116,7 +129,7 @@ Version 2.1.0 (2008-09-18)
|
||||
* Better IIS support
|
||||
* Improved minifier classes:
|
||||
* JS: preserves IE conditional comments
|
||||
* CSS: smaller output, preserves more hacks and valid CSS syntax,
|
||||
* CSS: smaller output, preserves more hacks and valid CSS syntax,
|
||||
shorter line lengths, other bug fixes
|
||||
* HTML: smaller output, shorter line lengths, other bug fixes
|
||||
* Default Cache-Control: max-age of 30 minutes
|
||||
@@ -133,15 +146,15 @@ Version 2.0.1 (2008-05-31)
|
||||
* E_STRICT compliance (Cache_Lite_File).
|
||||
|
||||
Version 2.0.0 (2008-05-22)
|
||||
* Complete code overhaul. Minify is now a PEAR-style class and toolkit
|
||||
* Complete code overhaul. Minify is now a PEAR-style class and toolkit
|
||||
for building customized minifying file servers.
|
||||
* Content-Encoding: deflate/gzip/compress, based on request headers
|
||||
* Expanded CSS and HTML minifiers with test cases
|
||||
* Easily plug-in 3rd-party minifiers (like Packer)
|
||||
* Plug-able front end controller allows changing the way files are chosen
|
||||
* Compression & encoding modules lazy-loaded as needed (304 responses use
|
||||
* Compression & encoding modules lazy-loaded as needed (304 responses use
|
||||
use minimal code)
|
||||
* Separate utility classes for HTTP encoding and cache control
|
||||
* Separate utility classes for HTTP encoding and cache control
|
||||
|
||||
Version 1.0.1 (2007-05-05)
|
||||
* Fixed various problems resolving pathnames when hosted on an NFS mount.
|
||||
|
@@ -67,24 +67,6 @@ $min_serveOptions['minifiers']['text/css'] = 'yuiCss';
|
||||
|
||||
Minify has added Túbal Martín's [PHP port](https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/blob/master/cssmin.php) of the YUI Compressor's CSSmin. While it is not completely integrated yet, you may try it out:
|
||||
|
||||
```
|
||||
function yuiCssPort($css, $options) {
|
||||
$compressor = new CSSmin();
|
||||
$css = $compressor->run($css, 9999999);
|
||||
|
||||
$css = Minify_CSS_UriRewriter::rewrite(
|
||||
$css,
|
||||
$options['currentDir'],
|
||||
isset($options['docRoot']) ? $options['docRoot'] : $_SERVER['DOCUMENT_ROOT'],
|
||||
isset($options['symlinks']) ? $options['symlinks'] : array()
|
||||
);
|
||||
return $css;
|
||||
}
|
||||
$min_serveOptions['minifiers']['text/css'] = 'yuiCssPort';
|
||||
```
|
||||
|
||||
As of commit [218f37](https://github.com/mrclay/minify/commit/218f37fb44f9be2ea138cf9efb8b7f6dc84bad7f), this is easier:
|
||||
|
||||
```
|
||||
$min_serveOptions['minifiers']['text/css'] = array('Minify_CSSmin', 'minify');
|
||||
```
|
||||
@@ -154,4 +136,4 @@ function postProcess($content, $type) {
|
||||
}
|
||||
$min_serveOptions['postprocessor'] = 'postProcess';
|
||||
```
|
||||
This function is only called once immediately after minification and its output is stored in the cache.
|
||||
This function is only called once immediately after minification and its output is stored in the cache.
|
||||
|
@@ -766,12 +766,12 @@ class CSSmin
|
||||
{
|
||||
if (is_string($size)) {
|
||||
switch (substr($size, -1)) {
|
||||
case 'M': case 'm': return $size * 1048576;
|
||||
case 'K': case 'k': return $size * 1024;
|
||||
case 'G': case 'g': return $size * 1073741824;
|
||||
case 'M': case 'm': return (int) $size * 1048576;
|
||||
case 'K': case 'k': return (int) $size * 1024;
|
||||
case 'G': case 'g': return (int) $size * 1073741824;
|
||||
}
|
||||
}
|
||||
|
||||
return (int) $size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ class Minify_JS_ClosureCompiler {
|
||||
/**
|
||||
* @var string $url URL of compiler server. defaults to Google's
|
||||
*/
|
||||
protected $serviceUrl = 'http://closure-compiler.appspot.com/compile';
|
||||
protected $serviceUrl = 'https://closure-compiler.appspot.com/compile';
|
||||
|
||||
/**
|
||||
* @var int $maxBytes The maximum JS size that can be sent to the compiler server in bytes
|
||||
@@ -172,6 +172,9 @@ class Minify_JS_ClosureCompiler {
|
||||
$contents = file_get_contents($this->serviceUrl, false, stream_context_create(array(
|
||||
'http' => array(
|
||||
'method' => 'POST',
|
||||
'compilation_level' => 'SIMPLE',
|
||||
'output_format' => 'text',
|
||||
'output_info' => 'compiled_code',
|
||||
'header' => "Content-type: application/x-www-form-urlencoded\r\nConnection: close\r\n",
|
||||
'content' => $postBody,
|
||||
'max_redirects' => 0,
|
||||
|
Reference in New Issue
Block a user