Closed GoogleCodeExporter closed 9 years ago
Please try the CSSMin configuration:
http://code.google.com/p/minify/wiki/CookBook#CSSmin_PHP_port
Original comment by mrclay....@gmail.com
on 5 Nov 2013 at 3:29
I can not understand how to use this code. I put it in /min/config.php, but
that does not change (not work)
(Я не могу понять как пользоваться данным
кодом. Я вставил его в /min/config.php, но ни чего
не изменилось)
I found another version of the solutions (not ideal)
Я нашел другой вариант решения (не
идеальный)
This problem in the file /min/lib/Minify/CSS/Compressor.php #113-124
// remove ws in selectors
$css = preg_replace_callback('/
(?: # non-capture
\\s*
[^~>+,\\s]+ # selector part
\\s*
[,>+~] # combinators
)+
\\s*
[^~>+,\\s]+ # selector part
{ # open declaration block
/x'
,array($this, '_selectorsCB'), $css);
a temporary solution to this problem
(временное решение этой проблемы)
preg_match_all('~(url\((\'|")data:image/(jpeg|gif|png|svg)(.*)(\'|")\))~',
$css, $temp_base64, PREG_PATTERN_ORDER);
$css = preg_replace('~(url\((\'|")data:image/(jpeg|gif|png|svg)(.*)(\'|")\))~',
'temp_base64_c7dc78yhuinm4', $css);
// remove ws in selectors
$css = preg_replace_callback('/
(?: # non-capture
\\s*
[^~>+,\\s]+ # selector part
\\s*
[,>+~] # combinators
)+
\\s*
[^~>+,\\s]+ # selector part
{ # open declaration block
/x'
,array($this, '_selectorsCB'), $css);
$i = 0;
foreach ($temp_base64[0] as $return_from_temp) {
$css = preg_replace('~temp_base64_c7dc78yhuinm4~', $return_from_temp, $css, ++$i);
}
Original comment by ad...@g63.ru
on 5 Nov 2013 at 4:33
Paste the code from the wiki (http://pastebin.com/GLd0a1cn) into min/config.php
and clear your browser cache. CSSmin will be used for compression and it has
specific workarounds for this issue. I have no time/interest in patching the
Minify_CSS_Compressor class at this time.
Original comment by mrclay....@gmail.com
on 5 Nov 2013 at 1:49
Ok. Thank you for your help.
Original comment by ad...@g63.ru
on 5 Nov 2013 at 5:13
Original issue reported on code.google.com by
ad...@g63.ru
on 5 Nov 2013 at 12:17Attachments: