[phpcvsview-cvs-updates] phpcvsview cvsview.php,1.14,1.15 func_DirListing.php,1.5,1.6 func_FileAnnot
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Sijis A. <si...@us...> - 2004-10-05 17:46:27
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28741 Modified Files: cvsview.php func_DirListing.php func_FileAnnotation.php func_FileHistory.php func_FileView.php Log Message: - changed statements to handle configuration data in array format - minor cosmetic changes Index: func_FileView.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileView.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** func_FileView.php 4 Oct 2004 11:46:37 -0000 1.4 --- func_FileView.php 5 Oct 2004 17:45:36 -0000 1.5 *************** *** 12,34 **** **/ ! function DisplayFileContents($File, $Revision = "") { ! global $ModPath, $CVSROOT, $PServer, $UserName, $Password, $ScriptName, ! $HTMLTitle, $HTMLHeading, $HTMLTblHdBg, $HTMLTblCell1, $HTMLTblCell2; // Calculate the path from the $ScriptName variable. $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); ! if ($ScriptPath == "") { $ScriptPath = "/"; } ! // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($CVSROOT, $PServer, $UserName, $Password); ! // Start the output process. ! echo GetPageHeader($HTMLTitle, $HTMLHeading); ! // Connect to the CVS server. if ($CVSServer->Connect() === true) { ! // Authenticate against the server. $Response = $CVSServer->Authenticate(); --- 12,34 ---- **/ ! function DisplayFileContents($File, $Revision = "") ! { ! global $config; // Calculate the path from the $ScriptName variable. $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); ! if ($ScriptPath == ""){ $ScriptPath = "/"; } ! // 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(); *************** *** 36,43 **** return; } ! ! // Get a RLOG of the module path specified in $ModPath. ! $CVSServer->RLog($ModPath); ! // "Export" the file. $Response = $CVSServer->ExportFile($File, $Revision); --- 36,43 ---- return; } ! ! // Get a RLOG of the module path specified in $config['mod_path']. ! $CVSServer->RLog($config['mod_path']); ! // "Export" the file. $Response = $CVSServer->ExportFile($File, $Revision); *************** *** 45,65 **** return; } ! // Add the quick link navigation bar. ! echo GetQuickLinkBar($ModPath, "Code view for: ", true, true, $Revision); ! // Display the file contents. echo "<hr />\n"; ! $search = array('<', '>', '\n', '\t'); ! $replace = array("<", ">", "", " "); echo "<pre>\n"; echo str_replace($search, $replace, $CVSServer->FILECONTENTS)."\n"; echo "</pre>\n"; ! // Close the connection. $CVSServer->Disconnect(); ! } ! else ! { echo "ERROR: Could not connect to the PServer.<br>\n"; } --- 45,63 ---- return; } ! // Add the quick link navigation bar. ! echo GetQuickLinkBar($config['mod_path'], "Code view for: ", true, true, $Revision); ! // Display the file contents. echo "<hr />\n"; ! $search = array('<', '>', '\n', '\t'); ! $replace = array("<", ">", "", " "); echo "<pre>\n"; echo str_replace($search, $replace, $CVSServer->FILECONTENTS)."\n"; echo "</pre>\n"; ! // Close the connection. $CVSServer->Disconnect(); ! } else { echo "ERROR: Could not connect to the PServer.<br>\n"; } *************** *** 67,70 **** } ! ! ?> \ No newline at end of file --- 65,67 ---- } ! ?> Index: cvsview.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/cvsview.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cvsview.php 4 Oct 2004 11:52:39 -0000 1.14 --- cvsview.php 5 Oct 2004 17:45:36 -0000 1.15 *************** *** 12,44 **** **/ - /** - * - * phpCVSView Configuration Parameters. - * - **/ require_once 'config.php'; ! global $CVSROOT, $PServer, $UserName, $Password, $HTMLTitle, $HTMLHeading, $HTMLTblHdBg, $HTMLTblCell1, $HTMLTblCell2; ! ! /** ! * * End of phpCVSView Configuration Parameters. ! * ! **/ $REPOS = ""; $ScriptName = $_SERVER['PHP_SELF']; $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); if ($ScriptPath == "") { $ScriptPath = "/"; } ! if (isset($_GET["tm"])) { $ThemeName = $_GET["tm"]; ! } ! else ! { $ThemeName = "Default"; } ! require_once "Themes/$ThemeName/theme.php"; require_once 'phpcvs.php'; --- 12,33 ---- **/ require_once 'config.php'; ! global $config; $REPOS = ""; $ScriptName = $_SERVER['PHP_SELF']; $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); + if ($ScriptPath == "") { $ScriptPath = "/"; } ! if (isset($_GET["tm"])) { $ThemeName = $_GET["tm"]; ! } else { $ThemeName = "Default"; } ! require_once "Themes/$ThemeName/theme.php"; require_once 'phpcvs.php'; *************** *** 50,77 **** require_once 'func_FileView.php'; ! // Check for a module path if (isset($_GET["mp"])) { ! $ModPath = $_GET["mp"]; ! } else { // Else of if (isset($_GET["CVSROOT"])) ! $ModPath = "/"; ! } // End of if (isset($_GET["CVSROOT"])) ! $ModPath = str_replace("//", "/", $ModPath); if (isset($_GET["fh"])) { DisplayFileHistory(); ! } ! else ! { if (isset($_GET["fa"])) { ! DisplayFileAnnotation($ModPath, $_GET["fa"]); ! } ! else ! { if (isset($_GET["fv"])) { ! DisplayFileContents($ModPath, $_GET["dt"]); ! } ! else ! { DisplayDirListing(); } --- 39,61 ---- require_once 'func_FileView.php'; ! // Check for a module path if (isset($_GET["mp"])) { ! $config['mod_path'] = $_GET["mp"]; ! } else { ! $config['mod_path'] = "/"; ! } ! ! $config['mod_path'] = str_replace("//", "/", $config['mod_path']); if (isset($_GET["fh"])) { DisplayFileHistory(); ! } else { if (isset($_GET["fa"])) { ! DisplayFileAnnotation($config['mod_path'], $_GET["fa"]); ! } else { if (isset($_GET["fv"])) { ! DisplayFileContents($config['mod_path'], $_GET["dt"]); ! } else { DisplayDirListing(); } Index: func_FileAnnotation.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileAnnotation.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** func_FileAnnotation.php 4 Oct 2004 11:50:31 -0000 1.5 --- func_FileAnnotation.php 5 Oct 2004 17:45:36 -0000 1.6 *************** *** 12,18 **** **/ ! function DisplayFileAnnotation($File, $Revision = "") { ! global $ModPath, $CVSROOT, $PServer, $UserName, $Password, $ScriptName, ! $HTMLTitle, $HTMLHeading, $HTMLTblHdBg, $HTMLTblCell1, $HTMLTblCell2; // Calculate the path from the $ScriptName variable. --- 12,18 ---- **/ ! function DisplayFileAnnotation($File, $Revision = "") ! { ! global $config; // Calculate the path from the $ScriptName variable. *************** *** 21,34 **** $ScriptPath = "/"; } ! // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($CVSROOT, $PServer, $UserName, $Password); ! // Start the output process. ! echo GetPageHeader($HTMLTitle, $HTMLHeading); ! // Connect to the CVS server. if ($CVSServer->Connect() === true) { ! // Authenticate against the server. $Response = $CVSServer->Authenticate(); --- 21,34 ---- $ScriptPath = "/"; } ! // 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(); *************** *** 36,40 **** return; } ! // Annotate the file. $Response = $CVSServer->Annotate($File, $Revision); --- 36,40 ---- return; } ! // Annotate the file. $Response = $CVSServer->Annotate($File, $Revision); *************** *** 42,46 **** return; } ! // Start the output for the table. echo "<hr />\n"; --- 42,46 ---- return; } ! // Start the output for the table. echo "<hr />\n"; *************** *** 48,63 **** $RowClass = "row1"; ! $search = array('<', '>', '\n'); ! $replace = array("<", ">", ""); $PrevRev = ""; $FirstLine = true; ! foreach ($CVSServer->ANNOTATION as $Annotation) ! { if (strcmp($PrevRev, $Annotation["Revision"]) != 0) { if (!$FirstLine) { "</pre></td></tr>\n"; ! } ! else ! { $FirstLine = false; } --- 48,60 ---- $RowClass = "row1"; ! $search = array('<', '>', '\n'); ! $replace = array("<", ">", ""); $PrevRev = ""; $FirstLine = true; ! foreach ($CVSServer->ANNOTATION as $Annotation) { if (strcmp($PrevRev, $Annotation["Revision"]) != 0) { if (!$FirstLine) { "</pre></td></tr>\n"; ! } else { $FirstLine = false; } *************** *** 66,77 **** if ($RowClass == "row1") { $RowClass = "row2"; ! } ! else ! { $RowClass = "row1"; } ! } ! else ! { echo "\n".str_replace($search, $replace, $Annotation["Line"]); } --- 63,70 ---- if ($RowClass == "row1") { $RowClass = "row2"; ! } else { $RowClass = "row1"; } ! } else{ echo "\n".str_replace($search, $replace, $Annotation["Line"]); } *************** *** 79,88 **** } echo "</table><hr />\n"; ! // Close the connection. $CVSServer->Disconnect(); ! } ! else ! { echo "ERROR: Could not connect to the PServer.<br />\n"; } --- 72,79 ---- } echo "</table><hr />\n"; ! // Close the connection. $CVSServer->Disconnect(); ! } else{ echo "ERROR: Could not connect to the PServer.<br />\n"; } *************** *** 90,93 **** } ! ! ?> \ No newline at end of file --- 81,83 ---- } ! ?> Index: func_DirListing.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_DirListing.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** func_DirListing.php 4 Oct 2004 11:51:32 -0000 1.5 --- func_DirListing.php 5 Oct 2004 17:45:36 -0000 1.6 *************** *** 12,28 **** **/ ! function DisplayDirListing() { ! global $ModPath, $CVSROOT, $PServer, $UserName, $Password, $ScriptName, ! $HTMLTitle, $HTMLHeading, $FolderIcon, $FileIcon, $RowClass; // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($CVSROOT, $PServer, $UserName, $Password); ! // Start the output process. ! echo GetPageHeader($HTMLTitle, $HTMLHeading); ! // Connect to the CVS server. if ($CVSServer->Connect() === true) { ! // Authenticate against the server. $Response = $CVSServer->Authenticate(); --- 12,28 ---- **/ ! function DisplayDirListing() ! { ! global $config; // 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(); *************** *** 30,65 **** return; } ! ! // Get a RLOG of the module path specified in $ModPath. ! $CVSServer->RLog($ModPath); ! // Add the quick link navigation bar. ! echo GetQuickLinkBar($ModPath); ! // Start the output for the table. startDirList(); ! // Do we need the "Back" operation. ! if (strlen($ModPath) > 1) { ! addParentDirectory($ScriptName, $ScriptPath, $ModPath); } // Display the folders within the table. ! addFolders($ModPath, $CVSServer->FOLDERS); // Display the files within the table. ! addFiles($ModPath, $CVSServer->FILES); ! // Close off our HTML table. endDirList(); $CVSServer->Disconnect(); ! } else { // Else of if ($Response !== true) echo "Connection Failed."; ! } // End of if ($Response !== true) echo GetPageFooter(); ! } // End of function DisplayDirListing() ! ! ! ?> \ No newline at end of file --- 30,63 ---- return; } ! ! // Get a RLOG of the module path specified in $config['mod_path']. ! $CVSServer->RLog($config['mod_path']); ! // Add the quick link navigation bar. ! echo GetQuickLinkBar($config['mod_path']); ! // Start the output for the table. startDirList(); ! // Do we need the "Back" operation. ! if (strlen($config['mod_path']) > 1) { ! addParentDirectory($ScriptName, $ScriptPath, $config['mod_path']); } // Display the folders within the table. ! addFolders($config['mod_path'], $CVSServer->FOLDERS); // Display the files within the table. ! addFiles($config['mod_path'], $CVSServer->FILES); ! // Close off our HTML table. endDirList(); $CVSServer->Disconnect(); ! } else { echo "Connection Failed."; ! } echo GetPageFooter(); ! } ! ?> Index: func_FileHistory.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_FileHistory.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** func_FileHistory.php 4 Oct 2004 11:48:12 -0000 1.4 --- func_FileHistory.php 5 Oct 2004 17:45:36 -0000 1.5 *************** *** 14,20 **** function DisplayFileHistory() { ! global $ModPath, $CVSROOT, $PServer, $UserName, $Password, $ScriptName, ! $HTMLTitle, $HTMLHeading, $HTMLTblHdBg, $HTMLTblCell1, $HTMLTblCell2; ! // Calculate the path from the $ScriptName variable. $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); --- 14,19 ---- function DisplayFileHistory() { ! global $config; ! // Calculate the path from the $ScriptName variable. $ScriptPath = substr($ScriptName, 0, strrpos($ScriptName, "/")); *************** *** 22,35 **** $ScriptPath = "/"; } ! // Create our CVS connection object and set the required properties. ! $CVSServer = new CVS_PServer($CVSROOT, $PServer, $UserName, $Password); ! // Start the output process. ! echo GetPageHeader($HTMLTitle, $HTMLHeading); ! // Connect to the CVS server. if ($CVSServer->Connect() === true) { ! // Authenticate against the server. $Response = $CVSServer->Authenticate(); --- 21,34 ---- $ScriptPath = "/"; } ! // 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(); *************** *** 37,52 **** return; } ! ! // Get a RLOG of the module path specified in $ModPath. ! $CVSServer->RLog($ModPath); $Files = $CVSServer->FILES; ! // Add the quick link navigation bar. ! echo GetQuickLinkBar($ModPath, "Revision History for: ", false, true, ""); ! foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) ! { ! $HREF = str_replace("//", "/", "$ScriptName?mp=$ModPath"); $DateTime = strtotime($Revision["date"]); echo "<hr /><p><a id=\"rd$DateTime\" />\n"; --- 36,50 ---- return; } ! ! // Get a RLOG of the module path specified in $config['mod_path']. ! $CVSServer->RLog($config['mod_path']); $Files = $CVSServer->FILES; ! // Add the quick link navigation bar. ! echo GetQuickLinkBar($config['mod_path'], "Revision History for: ", false, true, ""); ! foreach ($CVSServer->FILES[0]["Revisions"] as $Revision) { ! $HREF = str_replace("//", "/", "$ScriptName?mp=".$config['mod_path']); $DateTime = strtotime($Revision["date"]); echo "<hr /><p><a id=\"rd$DateTime\" />\n"; *************** *** 68,82 **** echo "<b>Log Message:</b></p><pre>".$Revision["LogMessage"]."</pre>\n"; } ! echo "<hr />\n"; ! $CVSServer->Disconnect(); ! } else { // Else of if ($CVSServer->Connect() === true) echo "Connection Failed."; ! } // End of if ($CVSServer->Connect() === true) echo GetPageFooter(); } ! ! ! ?> \ No newline at end of file --- 66,78 ---- echo "<b>Log Message:</b></p><pre>".$Revision["LogMessage"]."</pre>\n"; } ! echo "<hr />\n"; ! $CVSServer->Disconnect(); ! } else { echo "Connection Failed."; ! } echo GetPageFooter(); } ! ?> |