Re: Vote: PEAR::Strip_Comments

From: Date: Thu, 29 Apr 2004 00:21:48 +0000
Subject: Re: Vote: PEAR::Strip_Comments
References: 1  Groups: php.pear.general php.pear.general 
Request: Send a blank email to pear-general+get-12205@lists.php.net to get a copy of this message
This is a mute issue.. - if you are concerned about performance, and are not using a cache.. (which solves this isssue) - its a bit like building a house with only a spoon... Regards Alan Thorsten Suckow-Homberg wrote:
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"?


« previous php.pear.general (#12205) next »