Re: basic issue with ScriptReorganizer and pharize

From: Date: Tue, 31 May 2005 17:29:26 +0000
Subject: Re: basic issue with ScriptReorganizer and pharize
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37905@lists.php.net to get a copy of this message
One more thing to point out: <?php echo <<<EOL TXT; EOL; ?> is simply not valid. - Davey Stefano F. Rausch wrote:
On Fri, 20 May 2005 23:21:12 +0200, Greg Beaver <greg@chiaraquartet.net> wrote:
Reducing code size will not make any real difference - PHP_Archive is 12k, and should be used to bundle large applications (single file, small applications simply don't need to be pharred).
Same principle as with ScriptReorganizer ;-)
What you lose when you start cutting line endings, renaming variables and other optimizations of size is very important: you lose the ability to easily debug the application. Instead of "Notice on line 293, use of undeclared variable $longname" you will get "Notice on line 1, use of undeclared variable $v12"
Point taken Greg and thanks for reminding me of this issue. ScriptReorganizer now by default will only reduce multiple consecutive PHP_EOLs to a single one, so that lines are "somehow preserved", without affecting to much the packing. Only with the optional $oneLiner set to true at instantiation time, all end of lines will be stripped off. In the documentation this is being stated as a warning to be aware of!
I'm not saying that there is anything wrong with using ScriptReorganizer, but I do think it would be a *very* good idea to mention this drawback in the documentation, so that people can make the intelligent choice and run ScriptReorganizer prior to and separate from pharring. This will give the immediate benefit that you can test the files outside the phar when attempting to reproduce a bug, and will be able to quickly cross-reference bugs reported by endusers.
As with PHP_Archive, ScriptReorganizer should be used only for deployment and is added value to a PHAR, if used in combination. Therefore, the p r e c o n d i t i o n is that all (valid) scripts involved have been throughout tested (not only unit tested)! I will release ScriptReorganizer 0.2.0 later today and I will *update* the proposal respectively. -- Stefano


« previous php.pear.dev (#37905) next »