Hi, after installation of the 2.4.0 RC1 i get one error :
Parse error: syntax error, unexpected '"', expecting ')' in /mnt/171/sdb/6/c/brunogallerie/include/cssmin.class.php on line 34
Some investigations conduct me at this class in cssmin.class.php
class CssCompressUnitValuesMinifierPlugin extends aCssMinifierPlugin { private $re = array ( "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}.\${2}\${4}", "/(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}0", "/(^0\s0\s0\s0)|(^0\s0\s0$)|(^0\s0$)/iS" => "0" ); private $reMatch = "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)|(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)|(^0\s0\s0\s0$)|(^0\s0\s0$)|(^0\s0$)/iS"; public function apply(aCssToken &$token) { if (preg_match($this->reMatch, $token->Value)) { foreach ($this->re as $reMatch => $reReplace) { $token->Value = preg_replace($reMatch, $reReplace, $token->Value); } } return false; } public function getTriggerTokens() { return array ( "CssAtFontFaceDeclarationToken", "CssAtPageDeclarationToken", "CssRulesetDeclarationToken" ); } }
For some reason that I didn't understand, there is a parse error here in last member of array $re and in the $reMatch
Theses regex look OK for me ...
By changing double quotes by single quote here, the parsing error doesn't occur ...
See changes here :
class CssCompressUnitValuesMinifierPlugin extends aCssMinifierPlugin { private $re = array ( "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}.\${2}\${4}", "/(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}0", '/(^0\s0\s0\s0)|(^0\s0\s0$)|(^0\s0$)/iS' => "0" ); private $reMatch = '/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)|(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)|(^0\s0\s0\s0$)|(^0\s0\s0$)|(^0\s0$)/iS'; public function apply(aCssToken &$token) { if (preg_match($this->reMatch, $token->Value)) { foreach ($this->re as $reMatch => $reReplace) { $token->Value = preg_replace($reMatch, $reReplace, $token->Value); } } return false; } public function getTriggerTokens() { return array ( "CssAtFontFaceDeclarationToken", "CssAtPageDeclarationToken", "CssRulesetDeclarationToken" ); } }
But after this modification the compression of CSS doesn't work ... and I get a website with no css at all (the css compression process return blank css)
Then I bypass the compression in template.class.php :
1368 : //$css = CssMin::minify($css, array('Variables'=>false));
... and all works fine (at the cost of full css)
Bruno.
Offline
Hi Brouno,
Are your correctly running PHP 5? (you can see your PHP version on Piwigo administration home page)
Offline
Yep :
Environnement
Système d'exploitation: Linux
PHP: 5.1.3RC4-dev (Montrer les informations) [2012-03-14 12:10:55]
mysql: 5.0.83 [2012-03-14 12:10:55]
Bibliothèque graphique: GD bundled (2.0.28 compatible)
Base de données
13958 photos (première photo ajoutée le Mercredi 05 Avril 2006)
347 albums dont 288 physiques et 59 virtuels (14689 associations)
9 tags (26 associations)
37 utilisateurs
8 groupes
26 commentaires
51 rates
Offline
On the same hosting, does a Piwigo 2.3.3 works fine?
Offline
yes, right before the migration
Offline