cvs: smarty /docs/scripts revcheck.php

"Nuno Lopes" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsnlopess1121269040@cvsserver>
nlopess		Wed Jul 13 11:37:20 2005 EDT

  Modified files:              
    /smarty/docs/scripts	revcheck.php 
  Log:
  sync revcheck script with phpdoc (this adds a very usefull link to no-whitespace diff)
  
http://cvs.php.net/diff.php/smarty/docs/scripts/revcheck.php?r1=1.6&r2=1.7&ty=u
Index: smarty/docs/scripts/revcheck.php
diff -u smarty/docs/scripts/revcheck.php:1.6 smarty/docs/scripts/revcheck.php:1.7
--- smarty/docs/scripts/revcheck.php:1.6	Sun Jul  3 04:49:02 2005
+++ smarty/docs/scripts/revcheck.php	Wed Jul 13 11:37:19 2005
@@ -26,7 +26,7 @@
 the actual english xml files, and print statistics
 
   Usage:
-  <?=$argv[0]?> <language-code> [<maintainer>] [><revcheck.html>]
+  <?php echo $argv[0]; ?> <language-code> [<maintainer>] [><revcheck.html>]
 
   <language-code> must be a valid language code used
   in the repository
@@ -189,7 +189,7 @@
     if (!@file_exists($trans_file)) {
         $files_by_mark[REV_NOTRANS]++;
         $trans_name = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1);
-        $size = round(filesize($file)/1024, 1);
+        $size = intval(filesize($file)/1024);
         $missing_files[$trans_name] = array( $size );
         $file_sizes_by_mark[REV_NOTRANS] += $size;
         // compute en-tags just if they're needed in the WIP-Table
@@ -355,6 +355,7 @@
 
 } // get_dir_status() function end
 
+
 // Check for files removed in the EN tree, but still living in the translation
 function get_old_files($dir)
 {
@@ -429,6 +430,7 @@
 
 } // get_old_files() function end
 
+
 // =========================================================================
 // Functions to read in the translation.xml file and process contents
 // =========================================================================
@@ -548,18 +550,6 @@
 } // parse_translation() function end()
 
 // =========================================================================
-// Debug functions for all the functions and code on this page
-// =========================================================================
-
-// Print preformatted (debug function)
-function print_pre($var)
-{
-    print("<pre>");
-    print_r($var);
-    print("</pre>");
-} // print_pre() function end
-
-// =========================================================================
 // Start of the program execution
 // =========================================================================
 
@@ -839,31 +829,38 @@
         // If we have a 'numeric' revision diff and it is not zero,
         // make a link to the CVS repository's diff script
         if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) {
-            $file["short_name"] = "<a href=\"http://cvs.php.net/diff.php/" .
-                                  preg_replace( "'^".$DOCDIR."'", "smarty/docs/", $file["full_name"]) .
-                                  "?r1=" . $file["revision"][1] . 
-                                  "&amp;r2=" . $file["revision"][0] .
-                                  CVS_OPT . "\">" . $file["short_name"] . "</a>";
+            $url = 'http://cvs.php.net/diff.php/' .
+                   preg_replace( "'^".$DOCDIR."'", 'smarty/docs/', $file['full_name']) .
+                   '?r1=' . $file['revision'][1] . 
+                   '&amp;r2=' . $file['revision'][0] .
+                   CVS_OPT;
+            $url_ws = $url . '&amp;ws=0';
+
+            $file['short_name'] = '<a href="' . $url . '">'. $file["short_name"] . '</a> '.
+                                  '<a href="' . $url_ws . '">[NoWS]</a>';
         }
     
         // Guess the new directory from the full name of the file
         $new_dir = dirname($file["full_name"]);
         
-        // If this is a new directory, put out dir headline
-        if ($new_dir != $prev_dir) {
-            
-            // Drop out the unneeded parts from the dirname...
-            $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full_name"]));
-            
-            // Print out directory header
-            print "<tr class=blue><th colspan=12>$display_dir</th></tr>\n";
-            
+        // If this is a new directory, put out old dir lines
+        if ($new_dir != $prev_dir && isset($lines)) {
+            echo $prev_diplay_dir;
+            echo " ($line_number)</th></tr>";
+    	echo $lines;
+    	
+    	$lines = '';
+    	$line_number = 0;
+
             // Store the new actual directory
             $prev_dir = $new_dir;
         }
+        // Drop out the unneeded parts from the dirname...
+        $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full_name"]));
+        $prev_diplay_dir = "<tr class=blue><th colspan=12>$display_dir";
         
-        // Write out the line for the current file (get file name shorter)
-        print "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}</td>".
+        // Save the line for the current file (get file name shorter)
+        $lines .= "<tr class={$CSS[$file['mark']]}><td>{$file['short_name']}</td>".
               "<td> {$file['revision'][0]}</td>" .
               "<td> {$file['revision'][1]}</td>".
               "<td class=rb>{$file['revision'][2]} </td>".
@@ -875,9 +872,14 @@
               "<td class=rb>{$file['date'][2]} </td>".
               "<td class=c>{$file['maintainer']}</td>".
               "<td class=c>".trim($file['status'])."</td></tr>\n";
+         $line_number++;
     
     }
     
+    // echo the last dir and $lines
+    echo "$prev_diplay_dir ($line_number)</th></tr>";
+    echo $lines;
+
     print("</table>\n<p>&nbsp;</p>\n$navbar<p>&nbsp;</p>\n");
 
 }
@@ -1048,7 +1050,8 @@
     print "</table>\n<p>&nbsp;</p>\n$navbar<p>&nbsp;</p>\n";
 }
 
+
 // All OK, end the file
 print "</body>\n</html>\n";
 
-?>
\ No newline at end of file
+?>

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.