phpcvsview-cvs-updates Mailing List for PHP CVS Repository Viewer (Page 5)
Status: Pre-Alpha
Brought to you by:
bcheesem
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(1) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(43) |
Nov
|
Dec
(19) |
2005 |
Jan
(28) |
Feb
(85) |
Mar
|
Apr
(16) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
(14) |
Oct
|
Nov
(16) |
Dec
|
2006 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian C. <bch...@us...> - 2005-02-04 04:51:22
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28319/Themes/Default Modified Files: theme.php Log Message: Enabled download package support for Modules. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** theme.php 4 Feb 2005 04:21:51 -0000 1.13 --- theme.php 4 Feb 2005 04:51:09 -0000 1.14 *************** *** 198,207 **** function addModules($ModPath, $Modules) { ! global $RowClass, $ModuleIcon, $env; foreach ($Modules as $Key => $Val) { // Add the row data here. $HREF = str_replace("//", "/", $env['script_name']."?mp=$ModPath/".$Val."/"); echo "<tr class=\"$RowClass\">"; ! echo "<td class=\"min\"> </td>"; echo "<td class=\"min\"><a href=\"$HREF\"><img alt=\"MOD\" src=\"".$env['script_path']."/$ModuleIcon\" /></a></td>"; echo "<td class=\"min\"><a href=\"$HREF\">".$Key."</a></td>"; --- 198,211 ---- function addModules($ModPath, $Modules) { ! global $RowClass, $DownloadIcon, $ModuleIcon, $env; foreach ($Modules as $Key => $Val) { // Add the row data here. $HREF = str_replace("//", "/", $env['script_name']."?mp=$ModPath/".$Val."/"); echo "<tr class=\"$RowClass\">"; ! if ($Val != "CVSROOT" && $Val != "Attic") { ! echo "<td class=\"min\"><a href=\"$HREF&dp\"><img alt=\"D/L\" src=\"".$env['script_path']."/$DownloadIcon\" /></a></td>"; ! } else { ! echo "<td class=\"min\"> </td>"; ! } echo "<td class=\"min\"><a href=\"$HREF\"><img alt=\"MOD\" src=\"".$env['script_path']."/$ModuleIcon\" /></a></td>"; echo "<td class=\"min\"><a href=\"$HREF\">".$Key."</a></td>"; |
From: Brian C. <bch...@us...> - 2005-02-04 04:45:03
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27103 Modified Files: func_ArchiveDownload.php Log Message: Added the forgotten cleanup of the temporary location. Index: func_ArchiveDownload.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_ArchiveDownload.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** func_ArchiveDownload.php 4 Feb 2005 04:21:52 -0000 1.1 --- func_ArchiveDownload.php 4 Feb 2005 04:44:47 -0000 1.2 *************** *** 58,61 **** --- 58,89 ---- } + function rmdirr($dirname) + { + // Sanity check + if (!file_exists($dirname)) { + return false; + } + + // Simple delete for a file + if (is_file($dirname)) { + return unlink($dirname); + } + + // Loop through the folder + $dir = dir($dirname); + while (false !== $entry = $dir->read()) { + // Skip pointers + if ($entry == '.' || $entry == '..') { + continue; + } + + // Recurse + rmdirr("$dirname/$entry"); + } + + // Clean up + $dir->close(); + return rmdir($dirname); + } function DownloadArchive() { *************** *** 90,94 **** // Dump the contents of the file to the client. fpassthru($tarfile); ! } --- 118,122 ---- // Dump the contents of the file to the client. fpassthru($tarfile); ! rmdirr($jobpath); } |
From: Brian C. <bch...@us...> - 2005-02-04 04:22:02
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22893 Modified Files: cvsview.php phpcvs.php Added Files: func_ArchiveDownload.php Log Message: Added package download capability for folders within the CVS repository. Need to look at ways to improve the performance, as it takes a while to export the source and then generate the .tar.gz file. I can see issues with php runtime timeouts. --- NEW FILE: func_ArchiveDownload.php --- <?php /** * This source code is distributed under the terms as layed out in the * GNU General Public License. * * Purpose: To provide Archive Downloads. * * @author Brian A Cheeseman <bch...@us...> * @version $Id: func_ArchiveDownload.php,v 1.1 2005/02/04 04:21:52 bcheesem Exp $ * @copyright 2003-2005 Brian A Cheeseman **/ require_once("Archive/Tar.php"); function DAProcessDirectory($ReposLoc, $BasePath) { global $env; // Create our CVS connection object and set the required properties. $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Connect to the CVS server. if ($CVSServer->Connect() === true) { // Authenticate against the server. $Response = $CVSServer->Authenticate(); if ($Response !== true) { return; } // Create the folder for the BasePath. @mkdir($BasePath, 0700); // Get a RLOG of the module path specified in $ReposLoc. $CVSServer->RLog($ReposLoc); $Folders = $CVSServer->FOLDERS; $Files = $CVSServer->FILES; foreach ($Folders as $folder) { if ($folder["Name"] != "Attic") { DAProcessDirectory($ReposLoc.$folder["Name"]."/", $BasePath."/".$folder["Name"]); } } foreach ($Files as $file) { $CVSServer->ExportFile($ReposLoc.$file["Name"], time()); $filehandle = fopen($BasePath."/".$file["Name"], "wb"); fwrite($filehandle, $CVSServer->FILECONTENTS); fclose($filehandle); } $CVSServer->Disconnect(); // When we leave this function the contents should be in the File System. } } function DownloadArchive() { global $config, $env, $lang; // Get a unique string to create a directory for storing this request. $jobpath = $config['TempFileLocation']."/".md5(uniqid(rand(), true)); mkdir($jobpath, 0700); $buildpath = $jobpath."/".$config['CVSROOT']; mkdir($buildpath, 0700); $ReposFolders = explode("/", $env['mod_path']); if (count($ReposFolders) > 0 && $ReposFolders[count($ReposFolders) - 2] != "") { $buildpath .= "/".$ReposFolders[count($ReposFolders) - 2]; } // Export the source tree. DAProcessDirectory($env['mod_path'], $buildpath); // Create the tar file. $FileName = $jobpath."/".$config['CVSROOT'].".tar.gz"; $tar = new Archive_Tar($FileName, "gz"); $cwd = getcwd(); chdir($jobpath); $tar->create($config['CVSROOT']); chdir($cwd); header('Content-Type: application/x-tar'); header("Content-Disposition: attachment; filename=\"".$config['CVSROOT'].".tar.gz\""); header("Content-Length: " . filesize($FileName)); $tarfile = fopen($FileName, "rb"); // Dump the contents of the file to the client. fpassthru($tarfile); } ?> Index: cvsview.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/cvsview.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** cvsview.php 3 Feb 2005 23:47:29 -0000 1.23 --- cvsview.php 4 Feb 2005 04:21:52 -0000 1.24 *************** *** 72,75 **** --- 72,76 ---- require_once 'func_FileDownload.php'; require_once 'func_DiffFile.php'; + require_once 'func_ArchiveDownload.php'; *************** *** 93,97 **** DisplayFileDiff($_GET["r1"], $_GET["r2"]); } else { ! DisplayDirListing(); } } --- 94,102 ---- DisplayFileDiff($_GET["r1"], $_GET["r2"]); } else { ! if (isset($_GET["dp"])) { ! DownloadArchive(); ! } else { ! DisplayDirListing(); ! } } } Index: phpcvs.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/phpcvs.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** phpcvs.php 2 Feb 2005 07:14:49 -0000 1.22 --- phpcvs.php 4 Feb 2005 04:21:52 -0000 1.23 *************** *** 1056,1059 **** --- 1056,1061 ---- $this->INITIALISED = true; } + + $this->FILECONTENTS = ""; if (strncmp($FileName, "/", 1) == 0) { |
From: Brian C. <bch...@us...> - 2005-02-04 04:22:02
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22893/Themes/Default Modified Files: theme.php Log Message: Added package download capability for folders within the CVS repository. Need to look at ways to improve the performance, as it takes a while to export the source and then generate the .tar.gz file. I can see issues with php runtime timeouts. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** theme.php 3 Feb 2005 23:47:29 -0000 1.12 --- theme.php 4 Feb 2005 04:21:51 -0000 1.13 *************** *** 16,19 **** --- 16,20 ---- $ParentIcon = "Themes/".$config['theme']."/Images/parent.png"; $ModuleIcon = "Themes/".$config['theme']."/Images/module.png"; + $DownloadIcon = "Themes/".$config['theme']."/Images/download.png"; function GetPageHeader($Title="", $Heading="") { *************** *** 143,147 **** echo "<hr />"; echo "<table>"; ! echo "<tr class=\"head\"><th> </th><th>".$lang['file']."</th><th>".$lang['rev']."</th><th>".$lang['age']."</th><th>".$lang['author']."</th><th>".$lang['last_log']."</th></tr>"; $RowClass = "row1"; } --- 144,148 ---- echo "<hr />"; echo "<table>"; ! echo "<tr class=\"head\"><th> </th><th> </th><th>".$lang['file']."</th><th>".$lang['rev']."</th><th>".$lang['age']."</th><th>".$lang['author']."</th><th>".$lang['last_log']."</th></tr>"; $RowClass = "row1"; } *************** *** 158,161 **** --- 159,163 ---- $HREF = str_replace("//", "/", $env['script_name']."?mp=".substr($ModPath, 0, strrpos(substr($ModPath, 0, -1), "/"))."/"); echo "<tr class=\"$RowClass\">"; + echo "<td class=\"min\"> </td>"; echo "<td class=\"min\"><a href=\"$HREF\"><img alt=\"parent\" src=\"".$env['script_path']."/$ParentIcon\" /></a></td>"; echo "<td class=\"min\"><a href=\"$HREF\">".$lang['up_folder']."</a></td>"; *************** *** 170,177 **** function addFolders($ModPath, $Folders) { ! global $RowClass, $FolderIcon, $env; foreach ($Folders as $Folder) { $HREF = str_replace("//", "/", $env['script_name']."?mp=$ModPath/".$Folder["Name"]."/"); echo "<tr class=\"$RowClass\">"; echo "<td class=\"min\"><a href=\"$HREF\"><img alt=\"DIR\" src=\"".$env['script_path']."/$FolderIcon\" /></a></td>"; echo "<td class=\"min\"><a href=\"$HREF\">".$Folder["Name"]."</a></td>"; --- 172,184 ---- function addFolders($ModPath, $Folders) { ! global $RowClass, $DownloadIcon, $FolderIcon, $env; foreach ($Folders as $Folder) { $HREF = str_replace("//", "/", $env['script_name']."?mp=$ModPath/".$Folder["Name"]."/"); echo "<tr class=\"$RowClass\">"; + if ($Folder["Name"] != "CVSROOT" && $Folder["Name"] != "Attic") { + echo "<td class=\"min\"><a href=\"$HREF&dp\"><img alt=\"D/L\" src=\"".$env['script_path']."/$DownloadIcon\" /></a></td>"; + } else { + echo "<td class=\"min\"> </td>"; + } echo "<td class=\"min\"><a href=\"$HREF\"><img alt=\"DIR\" src=\"".$env['script_path']."/$FolderIcon\" /></a></td>"; echo "<td class=\"min\"><a href=\"$HREF\">".$Folder["Name"]."</a></td>"; *************** *** 196,199 **** --- 203,207 ---- $HREF = str_replace("//", "/", $env['script_name']."?mp=$ModPath/".$Val."/"); echo "<tr class=\"$RowClass\">"; + echo "<td class=\"min\"> </td>"; echo "<td class=\"min\"><a href=\"$HREF\"><img alt=\"MOD\" src=\"".$env['script_path']."/$ModuleIcon\" /></a></td>"; echo "<td class=\"min\"><a href=\"$HREF\">".$Key."</a></td>"; *************** *** 219,222 **** --- 227,231 ---- $AGE = CalculateDateDiff($DateTime, strtotime(gmdate("M d Y H:i:s"))); echo "<tr class=\"$RowClass\">"; + echo "<td class=\"min\"> </td>"; echo "<td align=\"center\"><a href=\"$HREF&fh\"><img alt=\"FILE\" src=\"".$env['script_path']."/$FileIcon\" /></a></td>"; echo "<td><a href=\"$HREF&fh\">".$File["Name"]."</a></td>"; |
From: Brian C. <bch...@us...> - 2005-02-03 23:51:53
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1968 Modified Files: phpcvsview.js Log Message: Added support for multiple CVS repositories. Index: phpcvsview.js =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/phpcvsview.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** phpcvsview.js 2 Feb 2005 11:56:18 -0000 1.5 --- phpcvsview.js 3 Feb 2005 23:51:41 -0000 1.6 *************** *** 29,32 **** --- 29,47 ---- } + function postBackReposChange(form) + { + var ddRepos=form.reposSelect.value; + var hfRequest=form.URLRequest.value; + if (hfRequest.indexOf("?") == -1) + { + newlocation=hfRequest+'?cr='+ddRepos; + } + else + { + newlocation=hfRequest+'&cr='+ddRepos; + } + location=newlocation; + } + function postBackDiffRequest(form) { |
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1606 Modified Files: func_DiffFile.php func_DirListing.php func_FileAnnotation.php func_FileDownload.php func_FileHistory.php func_FileView.php Log Message: Changed access to CVS details to support multiple CVS repositories. Index: func_FileDownload.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileDownload.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** func_FileDownload.php 1 Feb 2005 15:11:01 -0000 1.2 --- func_FileDownload.php 3 Feb 2005 23:50:36 -0000 1.3 *************** *** 21,25 **** // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Connect to the CVS server. --- 21,25 ---- // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Connect to the CVS server. Index: func_FileHistory.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileHistory.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** func_FileHistory.php 2 Feb 2005 11:56:18 -0000 1.10 --- func_FileHistory.php 3 Feb 2005 23:50:36 -0000 1.11 *************** *** 21,28 **** // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Start the output process. ! echo GetPageHeader($config['html_title'], $config['html_header']); // Connect to the CVS server. --- 21,28 ---- // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Start the output process. ! echo GetPageHeader($env['CVSSettings']['html_title'], $env['CVSSettings']['html_header']); // Connect to the CVS server. Index: func_DirListing.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_DirListing.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** func_DirListing.php 1 Feb 2005 15:11:01 -0000 1.9 --- func_DirListing.php 3 Feb 2005 23:50:36 -0000 1.10 *************** *** 17,24 **** // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Start the output process. ! echo GetPageHeader($config['html_title'], $config['html_header']); // Connect to the CVS server. --- 17,24 ---- // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Start the output process. ! echo GetPageHeader($env['CVSSettings']['html_title'], $env['CVSSettings']['html_header']); // Connect to the CVS server. Index: func_DiffFile.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_DiffFile.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** func_DiffFile.php 3 Feb 2005 07:29:50 -0000 1.2 --- func_DiffFile.php 3 Feb 2005 23:50:36 -0000 1.3 *************** *** 23,30 **** // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Start the output process. ! echo GetPageHeader($config['html_title'], $config['html_header']); // Connect to the CVS server. --- 23,30 ---- // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Start the output process. ! echo GetPageHeader($env['CVSSettings']['html_title'], $env['CVSSettings']['html_header']); // Connect to the CVS server. Index: func_FileView.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileView.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** func_FileView.php 1 Feb 2005 15:11:01 -0000 1.13 --- func_FileView.php 3 Feb 2005 23:50:36 -0000 1.14 *************** *** 25,32 **** // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Start the output process. ! echo GetPageHeader($config['html_title'], $config['html_header']); // Connect to the CVS server. --- 25,32 ---- // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Start the output process. ! echo GetPageHeader($env['CVSSettings']['html_title'], $env['CVSSettings']['html_header']); // Connect to the CVS server. Index: func_FileAnnotation.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileAnnotation.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** func_FileAnnotation.php 1 Feb 2005 15:11:01 -0000 1.8 --- func_FileAnnotation.php 3 Feb 2005 23:50:36 -0000 1.9 *************** *** 21,28 **** // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Start the output process. ! echo GetPageHeader($config['html_title'], $config['html_header']); // Connect to the CVS server. --- 21,28 ---- // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($env['CVSSettings']['cvsroot'], $env['CVSSettings']['server'], $env['CVSSettings']['username'], $env['CVSSettings']['password']); // Start the output process. ! echo GetPageHeader($env['CVSSettings']['html_title'], $env['CVSSettings']['html_header']); // Connect to the CVS server. |
From: Brian C. <bch...@us...> - 2005-02-03 23:49:44
|
Update of /cvsroot/phpcvsview/phpcvsview/languages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1228/languages Modified Files: en.php Log Message: Added support for multiple CVS repositories. Index: en.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/languages/en.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** en.php 1 Feb 2005 15:19:57 -0000 1.1 --- en.php 3 Feb 2005 23:49:20 -0000 1.2 *************** *** 23,37 **** // customization options $lang['language'] = 'English'; ! $lang['theme'] = 'Change Theme:'; // quick link bar listing ! $lang['change_theme'] = 'Change Theme:'; ! $lang['change_lang'] = 'Language:'; $lang['up_folder'] = 'Up one folder'; $lang['rev_history'] = 'Revision history for: '; $lang['code_view'] = 'Code view for: '; $lang['navigate_to'] = 'Navigate to: '; ! $lang['file_ext'] = 'File Extension:'; ! $lang['mime_type'] = 'Mime Type is:'; // time and date related --- 23,38 ---- // customization options $lang['language'] = 'English'; ! $lang['theme'] = 'Change Theme: '; // quick link bar listing ! $lang['change_theme'] = 'Change Theme: '; ! $lang['change_lang'] = 'Language: '; ! $lang['change_cvsroot'] = 'CVS Repository: '; $lang['up_folder'] = 'Up one folder'; $lang['rev_history'] = 'Revision history for: '; $lang['code_view'] = 'Code view for: '; $lang['navigate_to'] = 'Navigate to: '; ! $lang['file_ext'] = 'File Extension: '; ! $lang['mime_type'] = 'Mime Type is: '; // time and date related |
From: Brian C. <bch...@us...> - 2005-02-03 23:48:42
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv959 Modified Files: utils.php Log Message: Fixed an error where we would get weekss output for timeframes greater than 1 year. Index: utils.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/utils.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** utils.php 2 Feb 2005 07:14:49 -0000 1.6 --- utils.php 3 Feb 2005 23:48:34 -0000 1.7 *************** *** 84,90 **** $Result .= ', '.$date['weeks'].' '; $Result .= ($date['weeks'] > 1)? $lang['weeks'] : $lang['week']; - if ($date['weeks'] > 1) { - $Result .= "s"; - } } } --- 84,87 ---- |
From: Brian C. <bch...@us...> - 2005-02-03 23:47:38
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv756 Modified Files: config.php cvsview.php Log Message: Added support for multiple CVS repositories. Index: config.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/config.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** config.php 1 Feb 2005 15:13:00 -0000 1.11 --- config.php 3 Feb 2005 23:47:29 -0000 1.12 *************** *** 12,32 **** **/ ! // The CVSROOT path to access as it is on the server, ie for this projects ! // repository the value should be "/cvsroot/phpcvsview" ! $config['cvsroot'] = "/cvsroot/phpcvsview"; ! ! // The hostname (or IP Address) of the server providing the PServer services. ! $config['pserver'] = "cvs.sourceforge.net"; ! ! // The username to pass to the PServer for authentication purposes. ! $config['username'] = "anonymous"; ! // The password associated with the username above for authentication process. ! $config['password'] = ""; ! // The HTMLTitle and HTMLHeading are used purely for the generation of the ! // resultant web pages. ! $config['html_title'] = "phpCVSView Source Code Library"; ! $config['html_header'] = "phpCVSView Source Code Library"; // The default theme --- 12,38 ---- **/ ! // CVSROOT configuration. ! /* phpCVSView Source Repository */ ! $config['cvs']['phpCVSView']['server'] = "cvs.sourceforge.net"; ! $config['cvs']['phpCVSView']['cvsroot'] = "/cvsroot/phpcvsview"; ! $config['cvs']['phpCVSView']['username'] = "anonymous"; ! $config['cvs']['phpCVSView']['password'] = ""; ! $config['cvs']['phpCVSView']['mode'] = "pserver"; ! $config['cvs']['phpCVSView']['description'] = "PHP based CVS Repository Viewer"; ! $config['cvs']['phpCVSView']['html_title'] = "phpCVSView Source Code Library"; ! $config['cvs']['phpCVSView']['html_header'] = "phpCVSView Source Code Library"; ! /* phpCVSView Source Repository */ ! $config['cvs']['RPak']['server'] = "bcheese.homeip.net"; ! $config['cvs']['RPak']['cvsroot'] = "/cvsroot/mstsrpak"; ! $config['cvs']['RPak']['username'] = "anonymous"; ! $config['cvs']['RPak']['password'] = ""; ! $config['cvs']['RPak']['mode'] = "pserver"; ! $config['cvs']['RPak']['description'] = "MS Train Sim Route Packaging System"; ! $config['cvs']['RPak']['html_title'] = "RPak Source Code Library"; ! $config['cvs']['RPak']['html_header'] = "RPak Source Code Library"; ! // Default CVSROOT configuration to use. ! $config['default_cvs'] = "phpCVSView"; // The default theme *************** *** 41,43 **** --- 47,52 ---- $config['language'] = "en"; + // Settings for TAR creation. + $config['TempFileLocation'] = "/tmp"; + ?> Index: cvsview.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/cvsview.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** cvsview.php 2 Feb 2005 07:15:34 -0000 1.22 --- cvsview.php 3 Feb 2005 23:47:29 -0000 1.23 *************** *** 41,44 **** --- 41,53 ---- $config['theme'] = (in_array($config['theme'], GetThemeList(), false)) ? $config['theme'] : 'Default'; + // Determine the CVSROOT settings required for this instance. + $env['CVSROOT'] = (empty($_COOKIE['config']['CVSROOT'])) ? $config['default_cvs'] : $_COOKIE['config']['CVSROOT']; + if (isset($_GET["cr"])) { + $env['CVSROOT'] = $_GET["cr"]; + // Set cookie with theme info. This cookie is set to expire 1 year from today. + setcookie("config[CVSROOT]", $env['CVSROOT'], time()+31536000, "/"); + } + $env['CVSSettings'] = $config['cvs'][$env['CVSROOT']]; + if (isset($_GET["tm"])) { $config['theme'] = $_GET["tm"]; |
From: Brian C. <bch...@us...> - 2005-02-03 23:47:37
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv756/Themes/Default Modified Files: theme.css theme.php Log Message: Added support for multiple CVS repositories. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** theme.php 2 Feb 2005 11:56:16 -0000 1.11 --- theme.php 3 Feb 2005 23:47:29 -0000 1.12 *************** *** 35,38 **** --- 35,49 ---- $PageHead .= $lang['message']; $PageHead .= "<form class=\"themechanger\">"; + + $PageHead .= ' '.$lang['change_cvsroot'].' <select name="reposSelect" class="reposchanger" onchange="postBackReposChange(this.form)">'; + foreach($config['cvs'] as $key => $value){ + $PageHead .= '<option value="'.$key.'"'; + if ($key == $env['CVSROOT']) { + $PageHead .= ' selected="selected"'; + } + $PageHead .= '>'.$value['description'].'</option>'; + } + $PageHead .= '</select><br />'; + $PageHead .= $lang['change_theme'].' <select name="ThemeSelect" class="themechanger" onchange="postBackThemeChange(this.form)">'; foreach (GetThemeList() as $key=>$value) Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.css,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** theme.css 2 Feb 2005 11:56:16 -0000 1.11 --- theme.css 3 Feb 2005 23:47:29 -0000 1.12 *************** *** 62,65 **** --- 62,72 ---- margin: 0px; } + .reposchanger + { + font-size: 8pt; + text-align: left; + padding: 0px; + margin: 0px; + } .title { |
From: Brian C. <bch...@us...> - 2005-02-03 08:22:06
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Yellow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6364/Themes/Yellow Modified Files: theme.css Log Message: Updated themes with code for support of DIFF Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Yellow/theme.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.css 1 Feb 2005 15:04:27 -0000 1.2 --- theme.css 3 Feb 2005 08:21:57 -0000 1.3 *************** *** 102,103 **** --- 102,139 ---- font-weight: normal; } + + div.normal + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffffff; + } + + div.added + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ddffdd; + } + + div.removed + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffdddd; + } |
From: Brian C. <bch...@us...> - 2005-02-03 08:22:06
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Red In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6364/Themes/Red Modified Files: theme.css Log Message: Updated themes with code for support of DIFF Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Red/theme.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.css 1 Feb 2005 15:04:26 -0000 1.2 --- theme.css 3 Feb 2005 08:21:57 -0000 1.3 *************** *** 102,103 **** --- 102,139 ---- font-weight: normal; } + + div.normal + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffffff; + } + + div.added + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ddffdd; + } + + div.removed + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffdddd; + } |
From: Brian C. <bch...@us...> - 2005-02-03 08:22:05
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Green In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6364/Themes/Green Modified Files: theme.css Log Message: Updated themes with code for support of DIFF Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Green/theme.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.css 1 Feb 2005 15:04:24 -0000 1.2 --- theme.css 3 Feb 2005 08:21:56 -0000 1.3 *************** *** 102,103 **** --- 102,139 ---- font-weight: normal; } + + div.normal + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffffff; + } + + div.added + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ddffdd; + } + + div.removed + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffdddd; + } |
From: Brian C. <bch...@us...> - 2005-02-03 08:22:05
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Blue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6364/Themes/Blue Modified Files: theme.css Log Message: Updated themes with code for support of DIFF Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Blue/theme.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.css 1 Feb 2005 15:04:22 -0000 1.2 --- theme.css 3 Feb 2005 08:21:56 -0000 1.3 *************** *** 102,103 **** --- 102,139 ---- font-weight: normal; } + + div.normal + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffffff; + } + + div.added + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ddffdd; + } + + div.removed + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffdddd; + } |
From: Brian C. <bch...@us...> - 2005-02-03 07:29:59
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30827 Modified Files: func_DiffFile.php Log Message: Fixed the fault where more lines were removed than added when the DIFF specifies a change ('c'). Index: func_DiffFile.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_DiffFile.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** func_DiffFile.php 2 Feb 2005 11:56:18 -0000 1.1 --- func_DiffFile.php 3 Feb 2005 07:29:50 -0000 1.2 *************** *** 109,116 **** for ($LineCounter = 0; $LineCounter < $InsertLength; $LineCounter++) { ! $linenumber++; ! $TempLine = array('mode' => "+", 'text' => substr($DiffLines[$linenumber], 2)); ! InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+$LineOffset); ! $LineOffset++; $FilePatching[$InsertLocation[0]-2+$LineCounter+$LineOffset]['mode'] = '-'; } --- 109,118 ---- for ($LineCounter = 0; $LineCounter < $InsertLength; $LineCounter++) { ! if ($LineCounter < $NewLineLength) { ! $linenumber++; ! $TempLine = array('mode' => "+", 'text' => substr($DiffLines[$linenumber], 2)); ! InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+$LineOffset); ! $LineOffset++; ! } $FilePatching[$InsertLocation[0]-2+$LineCounter+$LineOffset]['mode'] = '-'; } |
From: Brian C. <bch...@us...> - 2005-02-02 11:57:02
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Blue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8812/Themes/Blue Modified Files: theme.php Log Message: Added Colored DIFF functionality to the project. Still have problems with the script running under MS IIS. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Blue/theme.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.php 1 Feb 2005 15:02:44 -0000 1.2 --- theme.php 2 Feb 2005 11:56:15 -0000 1.3 *************** *** 223,225 **** --- 223,248 ---- } + function GetDiffForm() + { + global $CVSServer, $env; + $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); + + $DiffForm = "<form class=\"diffform\">"; + $DiffForm .= "Diff between: <select name=\"DiffRev1\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select> and <select name=\"DiffRev2\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select><input type=\"hidden\" name=\"URLDiffReq\" value=\"".$HREF."\">"; + $DiffForm .= "<input type=\"button\" value=\"Get Diff\" onclick=\"postBackDiffRequest(this.form)\">"; + $DiffForm .= "</form>"; + + return $DiffForm; + } + ?> |
From: Brian C. <bch...@us...> - 2005-02-02 11:57:02
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8812/Themes/Default Modified Files: theme.css theme.php Log Message: Added Colored DIFF functionality to the project. Still have problems with the script running under MS IIS. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** theme.php 1 Feb 2005 15:02:46 -0000 1.10 --- theme.php 2 Feb 2005 11:56:16 -0000 1.11 *************** *** 223,225 **** --- 223,248 ---- } + function GetDiffForm() + { + global $CVSServer, $env; + $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); + + $DiffForm = "<form class=\"diffform\">"; + $DiffForm .= "Diff between: <select name=\"DiffRev1\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select> and <select name=\"DiffRev2\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select><input type=\"hidden\" name=\"URLDiffReq\" value=\"".$HREF."\">"; + $DiffForm .= "<input type=\"button\" value=\"Get Diff\" onclick=\"postBackDiffRequest(this.form)\">"; + $DiffForm .= "</form>"; + + return $DiffForm; + } + ?> Index: theme.css =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Default/theme.css,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** theme.css 1 Feb 2005 15:04:23 -0000 1.10 --- theme.css 2 Feb 2005 11:56:16 -0000 1.11 *************** *** 102,103 **** --- 102,140 ---- font-weight: normal; } + + div.normal + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffffff; + } + + div.added + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ddffdd; + } + + div.removed + { + font-family: courier; + color: #000000; + font-size: 10pt; + border: 0px none; + width: 100%; + border-spacing: 0px 0px; + border-collapse: collapse; + background-color: #ffdddd; + } + |
From: Brian C. <bch...@us...> - 2005-02-02 11:56:29
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Red In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8812/Themes/Red Modified Files: theme.php Log Message: Added Colored DIFF functionality to the project. Still have problems with the script running under MS IIS. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Red/theme.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.php 1 Feb 2005 15:02:48 -0000 1.2 --- theme.php 2 Feb 2005 11:56:16 -0000 1.3 *************** *** 223,225 **** --- 223,247 ---- } + function GetDiffForm() + { + global $CVSServer, $env; + $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); + + $DiffForm = "<form class=\"diffform\">"; + $DiffForm .= "Diff between: <select name=\"DiffRev1\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select> and <select name=\"DiffRev2\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select><input type=\"hidden\" name=\"URLDiffReq\" value=\"".$HREF."\">"; + $DiffForm .= "<input type=\"button\" value=\"Get Diff\" onclick=\"postBackDiffRequest(this.form)\">"; + $DiffForm .= "</form>"; + + return $DiffForm; + } ?> |
From: Brian C. <bch...@us...> - 2005-02-02 11:56:28
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8812 Modified Files: func_FileHistory.php phpcvsview.js Added Files: func_DiffFile.php Log Message: Added Colored DIFF functionality to the project. Still have problems with the script running under MS IIS. --- NEW FILE: func_DiffFile.php --- <?php /** * This source code is distributed under the terms as layed out in the * GNU General Public License. * * Purpose: To provide File Diff Page. * * @author Brian A Cheeseman <bch...@us...> * @version $Id: func_DiffFile.php,v 1.1 2005/02/02 11:56:18 bcheesem Exp $ * @copyright 2003-2005 Brian A Cheeseman **/ function DisplayFileDiff($Rev1, $Rev2) { global $config, $env; // Calculate the path from the $env['script_name'] variable. $env['script_path'] = substr($env['script_name'], 0, strrpos($env['script_name'], "/")); if ($env['script_path'] == "") { $env['script_path'] = "/"; } // Create our CVS connection object and set the required properties. $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); // Start the output process. echo GetPageHeader($config['html_title'], $config['html_header']); // Connect to the CVS server. if ($CVSServer->Connect() === true) { // Authenticate against the server. $Response = $CVSServer->Authenticate(); if ($Response !== true) { return; } // Add the quick link navigation bar. echo GetQuickLinkBar($env['mod_path'], "Revision Diff for: ", true, true, ""); echo "<hr />"; // Get the DIFF from the server. $DiffLines = explode("\n", $CVSServer->getFileDiff($env['mod_path'], $Rev1, $Rev2)); // echo "<pre>".implode("\n", $DiffLines)."</pre>"; // Get a RLOG of the module path specified in $env['mod_path']. $CVSServer->RLog($env['mod_path']); $DateOfFile = 0; foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) { if ($Revision["Revision"] == $Rev1) { $DateOfFile = strtotime($Revision["date"]); } } $CVSServer->Disconnect(); $CVSServer = new CVS_PServer($config['cvsroot'], $config['pserver'], $config['username'], $config['password']); $CVSServer->Connect(); $CVSServer->Authenticate(); if ($CVSServer->ExportFile($env['mod_path'], $DateOfFile) !== true) { return; } $FilePatching = array(); $FileContents = $CVSServer->FILECONTENTS; if ($FileContents === false) { echo "<pre>ERROR Getting Revision $Rev1 of file</pre>"; } $Lines = explode("\n", $FileContents); foreach ($Lines as $Line) { $FilePatching[] = array('mode' => "o", 'text' => $Line); } $linenumber = 0; while(strpos($DiffLines[$linenumber], "diff") === false) { $linenumber++; } // while $linenumber++; // We now have the line which starts the diff output. $LineOffset = 0; while($linenumber < count($DiffLines)) { if (strpos($DiffLines[$linenumber], "a") !== false) { // We have added a line or lines. $Parts = explode("a", $DiffLines[$linenumber]); $InsertLocation = explode(",", $Parts[0]); $NewLineLocation = explode(",", $Parts[1]); $InsertLength = count($NewLineLocation) == 2 ? $NewLineLocation[1]-$NewLineLocation[0]+1 : 1; for ($LineCounter = 0; $LineCounter < $InsertLength; $LineCounter++) { $TempLine = array('mode' => "+", 'text' => substr($DiffLines[++$linenumber], 2)); InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+1); $LineOffset++; } } else if (strpos($DiffLines[$linenumber], "c") !== false) { // We have changed a line or lines. $Parts = explode("c", $DiffLines[$linenumber]); $InsertLocation = explode(",", $Parts[0]); $InsertLength = count($InsertLocation) == 2 ? $InsertLocation[1]-$InsertLocation[0]+1 : 1; $linenumber += $InsertLength + 1; $NewFileLocation = explode(",", $Parts[1]); $NewLineLength = count($NewFileLocation) == 2 ? $NewFileLocation[1]-$NewFileLocation[0]+1 : 1; for ($LineCounter = 0; $LineCounter < $InsertLength; $LineCounter++) { $linenumber++; $TempLine = array('mode' => "+", 'text' => substr($DiffLines[$linenumber], 2)); InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+$LineOffset); $LineOffset++; $FilePatching[$InsertLocation[0]-2+$LineCounter+$LineOffset]['mode'] = '-'; } for ($LineCounter = $InsertLength; $LineCounter < $NewLineLength; $LineCounter++) { $linenumber++; $TempLine = array('mode' => "+", 'text' => substr($DiffLines[$linenumber], 2)); InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+$LineOffset); } } else if (strpos($DiffLines[$linenumber], "d") !== false) { // we have removed a line or lines. $Parts = explode("d", $DiffLines[$linenumber]); $DeleteLocation = explode(",", $Parts[0]); $OldLineLocation = explode(",", $Parts[1]); $DeleteLength = count($DeleteLocation) == 2 ? $DeleteLocation[1]-$DeleteLocation[0]+1 : 1; for ($LineCounter = 0; $LineCounter < $DeleteLength; $LineCounter++) { $FilePatching[$OldLineLocation[0]+$LineCounter+$LineOffset]['mode'] = '-'; $LineOffset++; $linenumber++; } } $linenumber++; } // while echo "<table><tr><td>"; $search = array("<", ">", "\n", "\t", " "); $replace = array("<", ">", "", " ", " "); foreach ($FilePatching as $Line) { echo "<div class=\""; switch($Line['mode']){ case '+': echo "added"; break; case '-': echo "removed"; break; default: echo "normal"; } // switch echo "\">".str_replace($search, $replace, $Line['text'])." </div>\n"; } echo "</td></tr></table><hr />"; $CVSServer->Disconnect(); } else { echo "Connection Failed."; } echo GetPageFooter(); } ?> Index: func_FileHistory.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileHistory.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** func_FileHistory.php 2 Feb 2005 09:31:58 -0000 1.9 --- func_FileHistory.php 2 Feb 2005 11:56:18 -0000 1.10 *************** *** 14,18 **** function DisplayFileHistory() { ! global $config, $env, $lang; // Calculate the path from the $env['script_name'] variable. --- 14,18 ---- function DisplayFileHistory() { ! global $config, $env, $lang, $CVSServer; // Calculate the path from the $env['script_name'] variable. *************** *** 68,77 **** echo '<hr />'."\n"; ! $CVSServer->Disconnect(); } else { echo $lang['err_connect']; } - echo GetDiffForm(); echo GetPageFooter(); } --- 68,77 ---- echo '<hr />'."\n"; ! ! echo GetDiffForm(); $CVSServer->Disconnect(); } else { echo $lang['err_connect']; } echo GetPageFooter(); } Index: phpcvsview.js =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/phpcvsview.js,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** phpcvsview.js 1 Feb 2005 15:06:46 -0000 1.4 --- phpcvsview.js 2 Feb 2005 11:56:18 -0000 1.5 *************** *** 47,51 **** { var dfDiffReq=form.URLDiffReq.value; - alert('Redirecting to: '+dfDiffReq+'&r1='+ddRev1+'&r2='+ddRev2+'&df'); location=dfDiffReq+'&r1='+ddRev1+'&r2='+ddRev2+'&df'; } --- 47,50 ---- |
From: Brian C. <bch...@us...> - 2005-02-02 11:56:27
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Green In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8812/Themes/Green Modified Files: theme.php Log Message: Added Colored DIFF functionality to the project. Still have problems with the script running under MS IIS. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Green/theme.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.php 1 Feb 2005 15:02:48 -0000 1.2 --- theme.php 2 Feb 2005 11:56:16 -0000 1.3 *************** *** 223,225 **** --- 223,248 ---- } + function GetDiffForm() + { + global $CVSServer, $env; + $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); + + $DiffForm = "<form class=\"diffform\">"; + $DiffForm .= "Diff between: <select name=\"DiffRev1\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select> and <select name=\"DiffRev2\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select><input type=\"hidden\" name=\"URLDiffReq\" value=\"".$HREF."\">"; + $DiffForm .= "<input type=\"button\" value=\"Get Diff\" onclick=\"postBackDiffRequest(this.form)\">"; + $DiffForm .= "</form>"; + + return $DiffForm; + } + ?> |
From: Brian C. <bch...@us...> - 2005-02-02 11:56:27
|
Update of /cvsroot/phpcvsview/phpcvsview/Themes/Yellow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8812/Themes/Yellow Modified Files: theme.php Log Message: Added Colored DIFF functionality to the project. Still have problems with the script running under MS IIS. Index: theme.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/Themes/Yellow/theme.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** theme.php 1 Feb 2005 15:02:49 -0000 1.2 --- theme.php 2 Feb 2005 11:56:17 -0000 1.3 *************** *** 223,225 **** --- 223,247 ---- } + function GetDiffForm() + { + global $CVSServer, $env; + $HREF = str_replace("//", "/", $env['script_name']."?mp=".$env['mod_path']); + + $DiffForm = "<form class=\"diffform\">"; + $DiffForm .= "Diff between: <select name=\"DiffRev1\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select> and <select name=\"DiffRev2\" class=\"diffform\">"; + foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) + { + $DiffForm .= "<option value=\"".$Revision["Revision"]."\">".$Revision["Revision"]."</option>"; + } + $DiffForm .= "</select><input type=\"hidden\" name=\"URLDiffReq\" value=\"".$HREF."\">"; + $DiffForm .= "<input type=\"button\" value=\"Get Diff\" onclick=\"postBackDiffRequest(this.form)\">"; + $DiffForm .= "</form>"; + + return $DiffForm; + } ?> |
From: Brian C. <bch...@us...> - 2005-02-02 09:32:07
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11885 Modified Files: func_FileHistory.php Log Message: Commit after merging language changes with DIFF changes. Index: func_FileHistory.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileHistory.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** func_FileHistory.php 1 Feb 2005 15:11:01 -0000 1.8 --- func_FileHistory.php 2 Feb 2005 09:31:58 -0000 1.9 *************** *** 51,56 **** echo ' (<a href="'.$HREF.'&fd&dt='.$DateTime.'">'.$lang['download'].'</a>)'; if ($Revision["PrevRevision"] != '') { ! echo ' (<a href="'.$HREF.'&df&r1='.$Revision["Revision"].'&r2='; ! echo $Revision["PrevRevision"].'">'.$lang['diff'].'</a>)'; } echo ' (<a href="'.$HREF.'&fa='.$Revision["Revision"].'">'.$lang['annotate'].'</a>)<br />'."\n"; --- 51,56 ---- echo ' (<a href="'.$HREF.'&fd&dt='.$DateTime.'">'.$lang['download'].'</a>)'; if ($Revision["PrevRevision"] != '') { ! echo ' (<a href="'.$HREF.'&df&r1='.$Revision["PrevRevision"].'&r2='; ! echo $Revision["Revision"].'">'.$lang['diff'].'</a>)'; } echo ' (<a href="'.$HREF.'&fa='.$Revision["Revision"].'">'.$lang['annotate'].'</a>)<br />'."\n"; |
From: Brian C. <bch...@us...> - 2005-02-02 07:15:43
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15942 Modified Files: cvsview.php Log Message: Added autodetection support for language, it will fall back to the users cookie setting, and at worst case back to the site administrators setting in the configuration file. Index: cvsview.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/cvsview.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** cvsview.php 2 Feb 2005 06:12:29 -0000 1.21 --- cvsview.php 2 Feb 2005 07:15:34 -0000 1.22 *************** *** 17,20 **** --- 17,29 ---- global $config, $env; + if (phpversion() <= "4.1.0") { + global $HTTP_ENV_VARS; + $_ENVIRON = $HTTP_ENV_VARS; + } + else + { + $_ENVIRON = $_ENV; + } + $REPOS = ""; $env['script_name'] = $_SERVER['PHP_SELF']; *************** *** 26,31 **** // check if cookie exist, if so use cookie, otherwise use config value // then verify that config value is a valid entry ! $config['language'] = (empty($_COOKIE['config']['lang'])) ? $config['language'] : $_COOKIE['config']['lang']; ! $config['language'] = (in_array($config['language'], GetLanguagesList(), false)) ? $config['language'] : 'en'; $config['theme'] = (empty($_COOKIE['config']['theme'])) ? $config['theme'] : $_COOKIE['config']['theme']; --- 35,40 ---- // check if cookie exist, if so use cookie, otherwise use config value // then verify that config value is a valid entry ! $config['language'] = (empty($_COOKIE['config']['lang'])) ? SetDefaultLanguage() : $_COOKIE['config']['lang']; ! $config['language'] = (in_array($config['language'], GetLanguagesList(), false)) ? $config['language'] : "en"; $config['theme'] = (empty($_COOKIE['config']['theme'])) ? $config['theme'] : $_COOKIE['config']['theme']; |
From: Brian C. <bch...@us...> - 2005-02-02 07:15:00
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15782 Modified Files: phpcvs.php utils.php Log Message: Added autodetection support for language, it will fall back to the users cookie setting, and at worst case back to the site administrators setting in the configuration file. Index: utils.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/utils.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** utils.php 2 Feb 2005 06:24:41 -0000 1.5 --- utils.php 2 Feb 2005 07:14:49 -0000 1.6 *************** *** 147,150 **** --- 147,164 ---- } + function SetDefaultLanguage() + { + global $env, $config, $_ENVIRON; + // en_AU:en_GB:en + $PreferredLangs = explode(":", $_ENVIRON['LANGUAGE']); + foreach ($PreferredLangs as $Lang) { + $FileToCheck = $env['language_path']."$Lang.php"; + if (file_exists($FileToCheck)) { + return $Lang; + } + } + return $config['language']; + } + function InsertIntoArray(&$Array, $Value, $Position) { *************** *** 156,158 **** ?> - --- 170,171 ---- Index: phpcvs.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/phpcvs.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** phpcvs.php 1 Feb 2005 07:22:30 -0000 1.21 --- phpcvs.php 2 Feb 2005 07:14:49 -0000 1.22 *************** *** 417,428 **** // Return Value: boolean - Successfully sent. // *************************************************************************** ! function processResponse() { $this->MESSAGE_CONTENT = ""; $this->STDERR = ""; $KeepGoing = true; while($KeepGoing){ $ResponseLine = $this->SOCKET->readLine(); $Response = explode(" ", $ResponseLine); if ($Response[0] != "") { $Func = $this->ALLOWED_RESPONSES[$Response[0]]; --- 417,434 ---- // Return Value: boolean - Successfully sent. // *************************************************************************** ! function processResponse($Debug = false) { $this->MESSAGE_CONTENT = ""; $this->STDERR = ""; $KeepGoing = true; + if ($Debug) { + echo "<pre>"; + } while($KeepGoing){ $ResponseLine = $this->SOCKET->readLine(); $Response = explode(" ", $ResponseLine); + if ($Debug) { + echo $ResponseLine."\n"; + } if ($Response[0] != "") { $Func = $this->ALLOWED_RESPONSES[$Response[0]]; *************** *** 432,435 **** --- 438,444 ---- } } + if ($Debug) { + echo "</pre>"; + } } *************** *** 704,707 **** --- 713,748 ---- } + // *************************************************************************** + // Function: sendCO() + // Author: Brian A Cheeseman. + // Parameters: None. + // Return Value: boolean - Successfully sent. + // *************************************************************************** + function sendCO() + { + if ($this->ALLOWED_REQUESTS["co"] == true) { + if ($this->SOCKET->write("co\n") != true) { + return false; + } + } + $this->processResponse(); + + // Here the first line is the length, the remaining (upto the 'ok') + // is the content of the file. + if ($this->FINAL_RESPONSE) { + $ContentLength = $this->SOCKET->readLine(); + $CharsToGo = $ContentLength; + while($CharsToGo > 0){ + $Buffer = $this->SOCKET->read($CharsToGo); + $this->FILECONTENTS .= $Buffer; + $CharsToGo -= strlen($Buffer); + } + $ReadLine = $this->SOCKET->readLine(); + return true; + } else { + return false; + } + } + /** * Helper Methods. |
From: Brian C. <bch...@us...> - 2005-02-02 06:24:53
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5408 Modified Files: utils.php Log Message: - Commit after merging language changes with DIFF changes. - Re-added check for CVS folder when listing theme dirs and language files. Index: utils.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/utils.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** utils.php 1 Feb 2005 15:14:28 -0000 1.4 --- utils.php 2 Feb 2005 06:24:41 -0000 1.5 *************** *** 115,119 **** while (false !== ($file = readdir($handle))) { // do not list . and .. ! if ($file != "." && $file != "..") { // add directory to an array array_push($theme, $file); --- 115,119 ---- while (false !== ($file = readdir($handle))) { // do not list . and .. ! if ($file != "." && $file != ".." && $file != "CVS") { // add directory to an array array_push($theme, $file); *************** *** 137,141 **** while (false !== ($file = readdir($handle))) { // do not list . and .. ! if ($file != "." && $file != "..") { // strip filename and add to an array array_push($lang, rtrim($file, '.php')); --- 137,141 ---- while (false !== ($file = readdir($handle))) { // do not list . and .. ! if ($file != "." && $file != ".." && $file != "CVS") { // strip filename and add to an array array_push($lang, rtrim($file, '.php')); *************** *** 147,149 **** --- 147,158 ---- } + function InsertIntoArray(&$Array, $Value, $Position) + { + if (!is_array($Array)) return false; + $Last = array_splice($Array, $Position); + $Array[] = $Value; + $Array = array_merge($Array, $Last); + } + ?> + |