Closed GoogleCodeExporter closed 8 years ago
Sorry but i'm unable to reproduce this error. You sample stylesheet get
minified correctly without any errors.
Result:
string(482)
"body{width:300px;margin:auto}.bouton{width:296px;height:48px;margin:20px
0;padding:7px 0;background-image:url(../img/btn.png);background-position:top
left;background-repeat:no-repeat;font-family:Verdana, Arial, Helvetica,
sans-serif;font-size:24px;font-style:normal;font-weight:700;text-transform:none;
color:#fff;text-decoration:none;text-align:center;cursor:pointer}.bouton:hover{b
ackground-image:url(../img/btn_over.png)}.bouton:active{background-image:url(../
img/btn_active.png)}"
Code:
require("libaries/cssmin/source/CssMin.php");
$source = file_get_contents("public/temp/choix.css");
$r = CssMin::minify($source, array
(
"ImportImports" => false,
"RemoveComments" => true,
"RemoveEmptyRulesets" => true,
"RemoveEmptyAtBlocks" => true,
"ConvertLevel3Properties" => true,
"Variables" => true,
"RemoveLastDelarationSemiColon" => true
), array
(
"Variables" => true,
"ConvertFontWeight" => true,
"ConvertHslColors" => true,
"ConvertRgbColors" => true,
"ConvertNamedColors" => true,
"CompressColorValues" => true,
"CompressUnitValues" => true,
"CompressExpressionValues" => true
));
var_dump($r);
Original comment by joe.scylla
on 23 Feb 2011 at 9:41
Sorry, i made a mistake.
The problem was on an other file.
The warnig appears if there is a css class without css inside :
example :
body{
}
Original comment by d.dussou...@2n-tech.com
on 23 Feb 2011 at 10:03
Attachments:
Sorry im still not able to reproduce the problem (uning the same code as
above).
Result:
string(377) "#d_erreur{height:200px;width:600px;margin:20px
auto;background-image:url(../img/erreur.png);background-position:top
left;background-repeat:no-repeat;border:1px dashed #f22;padding:20px 20px 20px
150px;font-family:Verdana, Arial, Helvetica,
sans-serif;font-size:24px;font-style:normal;font-weight:700;text-transform:none;
color:#515151;text-decoration:none;background-color:#eee}"
Please post your filter and plugin configuration.
Original comment by joe.scylla
on 23 Feb 2011 at 10:22
I tried with the same code as you :
require("D:/devel/www/_minify/include/cssmin/CssMin.php");
$source = file_get_contents("D:/devel/www/cam/css/erreur.css");
$r = CssMin::minify($source, array
(
"ImportImports" => false,
"RemoveComments" => true,
"RemoveEmptyRulesets" => true,
"RemoveEmptyAtBlocks" => true,
"ConvertLevel3Properties" => true,
"Variables" => true,
"RemoveLastDelarationSemiColon" => true
), array
(
"Variables" => true,
"ConvertFontWeight" => true,
"ConvertHslColors" => true,
"ConvertRgbColors" => true,
"ConvertNamedColors" => true,
"CompressColorValues" => true,
"CompressUnitValues" => true,
"CompressExpressionValues" => true
));
var_dump($r);
Here is the output :
Warning: get_class() expects parameter 1 to be object, null given in
D:\devel\www\_minify\include\cssmin\minifier\filter\CssRemoveEmptyRulesetsMinifi
erFilter.php on line 25 string(377)
"#d_erreur{height:200px;width:600px;margin:20px
auto;background-image:url(../img/erreur.png);background-position:top
left;background-repeat:no-repeat;border:1px dashed #f22;padding:20px 20px 20px
150px;font-family:Verdana, Arial, Helvetica,
sans-serif;font-size:24px;font-style:normal;font-weight:700;text-transform:none;
color:#515151;text-decoration:none;background-color:#eee}"
I'm using PHP 5.3.0 on Win7 x64 with error_reporting = E_ALL | E_STRICT
Original comment by d.dussou...@2n-tech.com
on 23 Feb 2011 at 10:37
Fixed with version 3.0.0.b4.
I did not get the error message because get_class() don't triggers an error (if
the parameter is no object) on PHP versions lower than 5.3 (i'm using PHP
5.2.17)
Original comment by joe.scylla
on 23 Feb 2011 at 11:19
It works.
Thank you !
Original comment by d.dussou...@2n-tech.com
on 23 Feb 2011 at 11:50
Original issue reported on code.google.com by
d.dussou...@2n-tech.com
on 23 Feb 2011 at 9:20Attachments: