Vote: PEAR::Strip_Comments
| From: | Thorsten Suckow-Homberg | Date: | Wed, 28 Apr 2004 20:07:18 +0000 |
| Subject: | Vote: PEAR::Strip_Comments | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12190@lists.php.net to get a copy of this message | ||
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"?