Annotation of cdn/www/sources.html, revision 1.10

1.9       cdn         1: <!-- MAIN CONTENT -->
                      2: <h5 class="page-header">Source Code</h5>
                      3: 
                      4: <p>
                      5:   The cdn source code can be accessed in either of the following ways:
                      6: </p>
                      7: 
                      8: <ul>
                      9: <li>View the source using the CVS <a href="http://www.mozdev.org/source/browse/cdn/">web interface</a></li>
                     10: <li>Check out the source using anonymous CVS with the following commands (password is guest):
                     11: 
                     12: <pre>
                     13: cvs -d :pserver:guest@mozdev.org:/cvs login
                     14: cvs -d :pserver:guest@mozdev.org:/cvs co cdn
                     15: </pre>
                     16: 
                     17: </li>
                     18: </ul>
                     19: 
1.2       cdn        20: <?php 
1.1       cdn        21: 
1.5       cdn        22: // $Id: sources.html,v 1.4 2003/02/19 18:19:49 cdn Exp $
1.2       cdn        23:   
                     24:   require("include/CVS_PATHS");
1.1       cdn        25: 
1.2       cdn        26:   define(MAX_READ_SIZE, 500000);
                     27:   define(MAX_READ, 100000);
                     28: 
                     29:   $today              = date("y/m/d"); 
                     30:   $commit_log         = "cvs@$project.mozdev.org";
                     31: 
1.8       cdn        32: //  show_source(COMMIT_PATH.$commit_log);
1.7       cdn        33: 
1.2       cdn        34:   if(!$local_conf_commits) 
                     35:     print '<span id="CVS-local-conf-commits">' . $local_conf_commits_msg . "</span>\n";
                     36: 
                     37:   //BEGIN BLOCK
                     38:   if(file_exists(COMMIT_PATH.$commit_log) && $local_conf_commits) { 
                     39: 
                     40:     $size = filesize(COMMIT_PATH.$commit_log);
                     41:     $contents = array();
                     42:     if ($size > MAX_READ_SIZE) {
                     43:       // print "<!-- Log File is greater than 500K -->\n";
                     44: 
                     45:       $fp = fopen (COMMIT_PATH.$commit_log, "r");
                     46:       fseek($fp, $size - MAX_READ);
                     47:       if ($contents) {
                     48:         print "$contents\n";
                     49:         exit;
                     50:       }
                     51:       $tok = strtok(fread($fp, MAX_READ),"\n");
                     52:       while ($tok) {
                     53:         array_push($contents, $tok);
                     54:         $tok = strtok("\n");
                     55:       }
                     56:       fclose($fp);
1.7       cdn        57:     } // echo '<pre>' . $contents[0] . '</pre>';
1.2       cdn        58:     if (!$contents)
                     59:       $contents = file(COMMIT_PATH.$commit_log);
                     60:     $len=count($contents);
                     61:     $r            = -1;
                     62:   
1.9       cdn        63:    // echo '<pre style="color: red;">' . $contents[0] . '</pre>';
1.5       cdn        64:     
1.2       cdn        65:     print '<h4 id="CVS-h4">' . "Today's CVS Commits for " . ucwords($project) . " Project</h4>\n";
                     66:     print '<table border="0" cellpadding="0" cellspacing="2" id="CVS-table">' . "\n";
                     67: 
                     68:     if($len) {
                     69:       for($i=0;$i<$len;$i++) {
                     70:         if(ereg("Modified:    www", $contents[$l]) && !$local_conf_commits)
                     71:           break;
                     72: 
                     73:         if(ereg("  Date: $today", $contents[$i])) {
                     74:           $r++;
                     75:           $result[$r] = 
                     76:           '<tr class="CVS-tr-header" valign="top"><td class="CVS-td-900">' . "\n" .
                     77:           "<strong>" . htmlspecialchars($contents[$i-1]) . "</strong>\n" .
                     78:           "</td></tr>\n" .
1.9       cdn        79:           '<tr class="CVS-tr-date">' .
1.4       cdn        80:           '<td class="CVS-td-f90">' . "\n" . htmlspecialchars($contents[$i]) .
1.2       cdn        81:           "\n</td></tr>\n" .
1.10    ! cdn        82:           '<tr class="CVS-tr-checkins"><td class="CVS-td-checkins">' . "\n";
1.2       cdn        83: 
                     84:           for($l=$i+1;$l<$len;$l++) {
                     85:             if(ereg("  Revision  Changes    Path", $contents[$l]))
                     86:               break;
                     87: 
                     88:             if(ereg("  User:", $contents[$l]))
                     89:               break;
                     90: 
1.9       cdn        91:             $result[$r] .= eregi_replace("((https|http|mailto|ftp):\/\/[^[:space:]<>]{1,})", 
1.2       cdn        92:             "<a href='\\1'>\\1</a>", htmlspecialchars($contents[$l])) .
                     93:             "<br>\n";
                     94:           }
                     95: 
                     96:           $result[$r]     .= "</td></tr>\n";
                     97:         }
                     98:       }
                     99:     }
                    100: 
                    101:   if(!$result) {  
1.3       cdn       102:     print '<tr><td id="CVS-no-commits">There are no new commits today</td></tr>' . "\n";
1.2       cdn       103:   } else {
                    104:     $reversed=array_reverse($result);
                    105:     for($i=0;$i<count($result);$i++)
                    106:       PRINT $reversed[$i];
                    107:   }
                    108: 
                    109:     print "</table>\n\n";
                    110: 
                    111:   } //END BLOCK
1.1       cdn       112: ?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>