File:  [mozdev] / cdn / www / sources.html
Revision 1.9: download - view: text, annotated - select for diffs - revision graph
Wed Feb 19 19:49:22 2003 UTC (16 years, 7 months ago) by cdn
Branches: MAIN
CVS tags: HEAD
o.o

    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: 
   20: <?php 
   21: 
   22: // $Id: sources.html,v 1.9 2003/02/19 19:49:22 cdn Exp $
   23:   
   24:   require("include/CVS_PATHS");
   25: 
   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: 
   32: //  show_source(COMMIT_PATH.$commit_log);
   33: 
   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);
   57:     } // echo '<pre>' . $contents[0] . '</pre>';
   58:     if (!$contents)
   59:       $contents = file(COMMIT_PATH.$commit_log);
   60:     $len=count($contents);
   61:     $r            = -1;
   62:   
   63:    // echo '<pre style="color: red;">' . $contents[0] . '</pre>';
   64:     
   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" .
   79:           '<tr class="CVS-tr-date">' .
   80:           '<td class="CVS-td-f90">' . "\n" . htmlspecialchars($contents[$i]) .
   81:           "\n</td></tr>\n" .
   82:           "<tr class="CVS-tr-checkins"><td class="CVS-td-checkins">\n";
   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: 
   91:             $result[$r] .= eregi_replace("((https|http|mailto|ftp):\/\/[^[:space:]<>]{1,})", 
   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) {  
  102:     print '<tr><td id="CVS-no-commits">There are no new commits today</td></tr>' . "\n";
  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
  112: ?>

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