Re: Proposal for name of new package phpDocumentor
| From: | Analysis & Solutions | Date: | Sat, 23 Nov 2002 22:45:50 +0000 |
| Subject: | Re: Proposal for name of new package phpDocumentor | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11031@lists.php.net to get a copy of this message | ||
Greg (et al):
On Fri, Nov 22, 2002 at 01:09:50PM -0500, Greg Beaver wrote:
> This release doesn't follow PEAR coding standards religiously, but tries to
> avoid any namespace issues.
You've got a great program going.
The one place where y'all really need to change the coding standard is
where you're using tabs instead of spaces for nesting. See the following
for an explanation: http://pear.php.net/manual/en/faq.tabs-vs-spaces.php
Also, your docblock comment indenting isn't standard either.
Below, is a copy of a script that cleans up both these issues
automatically...
Might I also suggest... many of your comments scroll long past the
80 column mark.
I'm sorry for being so pedantic. Following these standards makes life for
everyone using and contributing your program.
Enjoy,
--Dan
PS: I'm giving our offlist discussion regarding tags and DocBook some
thought and have some ideas which I'll relay later...
--
Bush's proposed Department of Homeland Security would be exempt from:
* the Freedom of Information Act * procurement rules
* labor collective bargaining * whistle blower protection
The real goal? Eliminating government accountability.
http://www.senate.gov/general/contact_information/senators_cfm.cfm
#! /cygdrive/f/progra~1/php/php -q
<?php
# PHPDocumentor Clean Up Script
#
# This script recursively goes through each file
# in the directory tree named in the $Start variable
# and changes all tabs to four spaces and formats the
# docblock indentation according to the JavaDoc standard.
#
# That last part meaning, this:
# /**
# * note
# */
#
# Is changed to this:
# /**
# * note
# */
# Directory to start in.
$Start = './PHPDocumentor';
# Files to leave alone...
$NoTouch[] = 'example.inc';
set_time_limit(0);
function Recursor($DirName) {
global $NoTouch, $Files, $Directories;
$DirNameHandle=opendir($DirName);
while ($FileName = readdir($DirNameHandle)) {
switch ($FileName) {
case '.':
case '..':
break;
default:
if ( !in_array(strtolower("$DirName/$FileName"), $NoTouch) ) {
if (is_dir("$DirName/$FileName")) {
$Directories[] = "$DirName/$FileName";
Recursor("$DirName/$FileName");
} else {
echo "$DirName/$FileName\n";
$Data = implode('', file("$DirName/$FileName") );
$Data = preg_replace('/\t/', ' ', $Data);
# This is the JavaDoc liner-upper
$Data = preg_replace('/^(\s*)\*/m', '\\1 *', $Data);
$Data = trim($Data);
$File = fopen("$DirName/$FileName", 'w');
fputs($File, $Data);
fclose($File);
}
}
}
}
}
Recursor($Start);
echo "\n\n-- Done --\n";
?>