Re: PEAR::Strip_Comments
| From: | Ignatius Reilly | Date: | Fri, 30 Apr 2004 06:31:08 +0000 |
| Subject: | Re: PEAR::Strip_Comments | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12239@lists.php.net to get a copy of this message | ||
actually this could be a first step to a code scrambler, that would be of
use to those who can not use a PHP encoder:
- remove comments
- rename classes, functions and variables in files from the cgi-bin dir with
meaningless names
- rename files
( I have no idea how to scramble the SQL code...)
by then it is more an application than a component...
Just my 2 Belgian francs
Ignatius
_________________________
"Thorsten Suckow-Homberg" <ts@siteartwork.de> wrote in message
news:20040428200717.71107.qmail@pb1.pair.com...
> Since the PEAR-(Package-)Class-Files get bigger with every comment and
> phpDoc-Code you add to your file, I thought of an automatism that strips
> those comments for the use in a productive environment.
> This would result in a faster access and reducing overhead because of
> loading files which source-code exists to ~60% of comments and
> documentation.
>
> I thought of putting a method into the PEAR.php-file which works like the
> following:
>
> //in PEAR.php (code is simplified)
> function get_stripped($sFileName)
> {
> if (!file_exists($sFileName.".stripped.php")
> || file_mtime($sFileName) > file_mtime($sFileName.".stripped.php"))
{
> delete_all_comments_in_the_file_to_reduce_filesize($sFileName);
> save_the_file_under($sFileName.".stripped.php");
> }
>
> return $sFileName.".stripped";
> }
>
> //and in your code (and the PEAR-classes could/ should use this, too)
> require_once PEAR::get_stripped("greatPEARClass.php");
>
> This would reduce file-size of some classes up to 50%.
>
> What do you think of it? Great performance-improvement or
"useless-to-have"?