goba Mon Apr 15 15:18:25 2002 EDT
Modified files:
/phpdoc/scripts revcheck.php
Log:
Some modifications for the new system:
a) Ignore the old functions directory for revchecks
b) Find Revision headers in the first 500 chars not the first 200
(this finds rev headers after all the comments added by the autosplit code)
c) Use the basename of files for printouts (we have directory headers
with directory names, the filenames are not absolutely but quite unique).
$Revision CVS tags are missing from EN function files, so the revcheck output
it still not too meaningful (but huge).
We need to add some ideas about how it can be made much smaller. One method
is to keep all translations up to date and translate any modifications
from the english tree immediately ;)) That would result in a small revcheck
file.
But in reality, we need to do something about the size. It's 1,1M for the
hu tree. Something like a revcheck.html.gz file would do more for now. Zipping
this up with Winzip results in a 37Kb file, so GZ should be more enough ;)))
Index: phpdoc/scripts/revcheck.php
diff -u phpdoc/scripts/revcheck.php:1.23 phpdoc/scripts/revcheck.php:1.24
--- phpdoc/scripts/revcheck.php:1.23 Fri Mar 29 13:48:02 2002
+++ phpdoc/scripts/revcheck.php Mon Apr 15 15:18:25 2002
@@ -103,10 +103,10 @@
function get_tag($file, $val = "en-rev")
{
- // Read the first 200 chars. The comment should be at
+ // Read the first 500 chars. The comment should be at
// the begining of the file
$fp = @fopen($file, "r") or die ("Unable to read $file.");
- $line = fread($fp, 200);
+ $line = fread($fp, 500);
fclose($fp);
// Check for English CVS revision tag (. is for $ in the preg!),
@@ -144,10 +144,10 @@
// Grab CREDITS tag, the place to store previous credits
function get_credits ($file) {
- // Read the first 300 chars, the comment should be at
+ // Read the first 500 chars, the comment should be at
// the begining of the file, if it is there
$fp = @fopen($file, "r") or die ("Unable to read $file.");
- $line = fread($fp, 300);
+ $line = fread($fp, 500);
fclose($fp);
// Try to find credits info in file, let more credits
@@ -394,7 +394,12 @@
// The English directory is passed to this function to check
function get_dir_status($dir, $DOCDIR, $LANG)
{
-
+ // If this is an old "functions" directory
+ // (not under reference) then do not travers
+ if (preg_match("!/en/functions!", $dir)) {
+ return array();
+ }
+
// Collect files and diretcories in these arrays
$directories = array();
$files = array();
@@ -862,7 +867,10 @@
preg_replace( "'^".$DOCDIR."'", "phpdoc/",
$file["full_name"]) .
"?r1=" . $file["revision"][1] .
"&r2=" . $file["revision"][0] .
- CVS_OPT . "\">" . $file["short_name"] . "</a>";
+ CVS_OPT . "\">" . basename($file["short_name"]) .
+"</a>";
+ } else {
+ // Else just shorten the filename (we have directory headers)
+ $file["short_name"] = basename($file["short_name"]);
}
// Guess the new directory from the full name of the file
@@ -884,7 +892,7 @@
// Style attribute for all the cells
$style = 'style="' . $CSS[$file["mark"]] . '"';
- // Write out the line for the current file
+ // Write out the line for the current file (get file name shorter)
print "<tr>\n <td $style>{$file['short_name']}</td>\n".
" <td $style> {$file['revision'][0]}</td>" .
" <td $style> {$file['revision'][1]}</td>\n".