File:  [mozdev] / cdn / www / sources.html
Revision 1.30: download - view: text, annotated - select for diffs - revision graph
Thu Feb 20 21:20:15 2003 UTC (16 years, 6 months ago) by cdn
Branches: MAIN
CVS tags: HEAD
cvs checkin listing with links to files

    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><?php $doNotCapitalise = 1; ?>
   19: 
   20: <?php 
   21: 
   22: // $Id: sources.html,v 1.30 2003/02/20 21:20:15 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:     $_project = $project;
   66:     
   67:     if ( !isset($doNotCapitalise) )
   68:     {
   69:       $_project = PROJECT;
   70:     }
   71:    
   72:     print '<h4 id="CVS-h4">' . "Today's CVS Commits for " . $_project . " Project</h4>\n";
   73:     print '<table border="0" cellpadding="0" cellspacing="2" id="CVS-table">' . "\n";
   74: 
   75:     if($len) {
   76:       for($i=0;$i<$len;$i++) {
   77:         if(ereg("Modified:    www", $contents[$l]) && !$local_conf_commits)
   78:           break;
   79: 
   80:         if(ereg("  Date: $today", $contents[$i])) {
   81:           $r++;
   82:           $result[$r] = 
   83:           '<tr class="CVS-tr-header" valign="top"><td class="CVS-td-900">' . "\n" .
   84:           "<strong>" . htmlspecialchars($contents[$i-1]) . "</strong>\n" .
   85:           "</td></tr>\n" .
   86:           '<tr class="CVS-tr-date">' .
   87:           '<td class="CVS-td-f90">' . "\n" . htmlspecialchars($contents[$i]) .
   88:           "\n</td></tr>\n" .
   89:           '<tr class="CVS-tr-checkins"><td class="CVS-td-checkins">' . "\n";
   90: 
   91:           for($l=$i+1;$l<$len;$l++) {
   92:             if(ereg("  Revision  Changes    Path", $contents[$l]))
   93:               break;
   94: 
   95:             if(ereg("  User:", $contents[$l]))
   96:               break;
   97: 
   98:             $checkins = eregi_replace("((https|http|mailto|ftp):\/\/[^[:space:]<>]{1,})", 
   99:             "<a href='\\1'>\\1</a>", htmlspecialchars($contents[$l]));
  100: 
  101:             // '  Added:       www/img  background.png' 
  102:             // '  Modified:    www      cdn.css' 
  103:             // '  Removed:     www/protected sources.html'
  104:             // '               www/compact index.html' ?
  105: 
  106:             $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // . '/';
  107: 
  108:             if ( ereg("((Added|Modified|Removed):)", $checkins) || eregi("[^[:space:]<>]+/+[^[:space:]<>]", $checkins) )
  109:             {
  110:               $checkins = trim($checkins);
  111: 
  112:               $checkins = ereg_replace('[[:space:]]{1,}', ' ', $checkins);
  113: 
  114:               $checkinsA = explode(' ', $checkins);
  115: 
  116:               unset($checkins);
  117: 
  118:               for($z=0; $z < count($checkinsA); ++$z)
  119:               {
  120:                 $checkinsA[$z] = trim($checkinsA[$z]);
  121:               }
  122: 
  123:               $checkins = $checkinsA[0];
  124: 
  125:               $chkA1 = $checkinsA[1];
  126: 
  127: //              if(eregi("[a-z0-9_-\./]{1,}", $checkinsA[0]))
  128:               if($pigs_can_fly)
  129:               {
  130:                 $checkins = '<a href="' . $webcvs . '/' . $checkinsA[0] . '">' . $checkinsA[0] . '</a>';
  131:                 $chkA1 = $checkinsA[0];
  132:               }
  133: 
  134:               $webcvs .= '/' . $chkA1;
  135: 
  136:               $checkins .= ' <a href="' . $webcvs;
  137:               $checkins .= '">' . $chkA1 . '</a>';
  138: 
  139:              // reset($checkinsA);
  140:               for($y=0; $y < count($checkinsA); ++$y)
  141:               {
  142:               // how can $webcvs not have $chkA1 as part of it ?
  143: 
  144:                 if($y >= 2)
  145:                 {
  146:                   $checkins .= ' <a href="' . $webcvs . '/' . $checkinsA[$y] . '">';
  147:                   $checkins .= $checkinsA[$y] . '</a>';
  148:                 }
  149:               }
  150:             }
  151: 
  152:             $result[$r] .= '<div class="CVS-div-checkins">' . $checkins .
  153:             "</div>\n";
  154:           }
  155: 
  156:           $result[$r]     .= "</td></tr>\n";
  157:         }
  158:       }
  159:     }
  160: 
  161:   if(!$result) {  
  162:     print '<tr><td id="CVS-no-commits">There are no new commits today</td></tr>' . "\n";
  163:   } else {
  164:     $reversed=array_reverse($result);
  165:     for($i=0;$i<count($result);$i++)
  166:       PRINT $reversed[$i];
  167:   }
  168: 
  169:     print "</table>\n\n";
  170: 
  171:   } //END BLOCK
  172: ?>

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