Hi Ingo,
Hi.
After yesterday’s SVN update of the trunk version, I noticed that
eGroupware is now using minify. While this is probably a good idea, it
does not work on my server.
I get fatal errors in PHP: Argument b supplied is not valid (or similar)
resulting in no CSS being loaded and a scrambled page.
I request string is something like https://xyz/min.php?b=?g=something.
So b is empty, which is invalid. It probably should be b=/
I patched minify to change b="/" and minify started working again,
You are saying, if EGw is installed direct in docroot, b=/ and otherwise
unchanged minify sources works for you? To be more specific copying minify
calls from our html source to a browser and just adding a slash after b=
gives you js or css content.
The original URL:
https://mydomain.tld/phpgwapi/inc/min/?b=&f=phpgwapi/templates/idots/css/traditional.css,phpgwapi/templates/idots/css/idots.css,phpgwapi/templates/idots/print.css&1350974659
produces nothing but a fatal PHP error
[Tue Oct 23 20:07:12 2012] [error] [client 122.57.203.142] GET param ‘b’ was
invalid, referer: https://mydomain.tld/admin/index.php
[Tue Oct 23 20:07:12 2012] [error] [client 122.57.203.142] PHP Fatal error:
Uncaught exception ‘Exception’ with message ‘GET param ‘b’ was invalid’ in
/usr/share/egroupware/egroupware/phpgwapi/inc/min/lib/Minify/Logger.php:40
whereas
https://mydomain.tld/phpgwapi/inc/min/?f=phpgwapi/templates/idots/css/traditional.css,phpgwapi/templates/idots/css/idots.css,phpgwapi/templates/idots/print.css&1350974659
loads the desired CSS
So yes, egw is installed in docroot. Note the missing b= in the working URL
however the loading time for the “minified” page is 5 times longer than
the non-minified page. I am running egroupware as a family server on an
old P4@2.4GHz.
I assume that minifying takes a lot of PHP execution time, much more
time than bandwidth time.
So if I cannot get it a) working and b) faster, then I would rather like
to switch it off.
There’s a new switch in Admin >> Site configuration to switch minifying off.
Cool, found it.
First request is always a lot slower as sources have to be minified, after
that it got a lot quicker for me, specially with the many javascript files
in Trunk
True, I did a speed omparison. Funny enough, the transferred size chnages
dramatically, from 140KB to 42KB, however timing did not change too much, only
500ms.
This is however in the intranet, so I guess it would make a difference over the
internet. So I decided to leave it switched on.
But I had to patch it with unset($_GET[‘b’])!
The cleaner option is to modify ./min/lib/Controller/MinApp.php:
Change
if (isset($_GET['b'])) {
// check for validity
if (preg_match('@^[^/]+(?:/[^/]+)*$@', $_GET['b'])
&& false === strpos($_GET['b'], '..')
&& $_GET['b'] !== '.') {
// valid base
$base = "/{$_GET['b']}/";
} else {
$this->log("GET param 'b' was invalid");
return $options;
}
} else {
$base = '/';
}
into
$base = '/';
if (isset($_GET['b'])) {
// check for validity
if (preg_match('@^[^/]+(?:/[^/]+)*$@', $_GET['b'])
&& false === strpos($_GET['b'], '..')
&& $_GET['b'] !== '.') {
// valid base
$base = "/{$_GET['b']}/";
}
}
Or of course to change egroupwa NOT to supply b= when egroupware is in the
docroot. But no idea where you have built that in. Had no time to hunt.
So I guess you need some adjustments for docroot installations. BTW for those
situations your rewrite rules do not work either and needed adjustment.
But I am a lazy person and hate excessive typing… 
Cheers,
Ingo
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
eGroupWare-users mailing list
eGroupWare-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-users