Update of /cvsroot/phpcvsview/phpcvsview
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12024
Modified Files:
phpcvs.php
Log Message:
Added DIFF support to the core phpcvs class.
Index: phpcvs.php
===================================================================
RCS file: /cvsroot/phpcvsview/phpcvsview/phpcvs.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** phpcvs.php 23 Jan 2005 00:55:22 -0000 1.20
--- phpcvs.php 1 Feb 2005 07:22:30 -0000 1.21
***************
*** 449,452 ****
--- 449,466 ----
// ***************************************************************************
+ // Function: sendCASE()
+ // Author: Brian A Cheeseman.
+ // Parameters: None.
+ // Return Value: boolean - Successfully sent.
+ // ***************************************************************************
+ function sendCASE()
+ {
+ if ($this->SOCKET->write("Case\n") != true) {
+ return false;
+ }
+ return true;
+ }
+
+ // ***************************************************************************
// Function: sendValidResponses()
// Author: Brian A Cheeseman.
***************
*** 1092,1095 ****
--- 1106,1180 ----
// ***************************************************************************
+ // Function: getFileDiff()
+ // Author: Brian Cheeseman.
+ // Parameters: string - Name of file to diff.
+ // int - Revision 1.
+ // int - Revision 2.
+ // Return Value: void - none.
+ // ***************************************************************************
+ function getFileDiff($FileName, $Revision1, $Revision2)
+ {
+ if (!($this->INITIALISED)) {
+ $this->sendValidResponses();
+ $this->sendValidRequests();
+ $this->INITIALISED = true;
+ }
+
+ if (!$this->sendUseUnchanged()) {
+ return false;
+ }
+
+ if (!$this->sendCVSROOT()) {
+ return false;
+ }
+
+ if (!$this->sendArgument("-r")) {
+ return false;
+ }
+
+ if (!$this->sendArgument($Revision1)) {
+ return false;
+ }
+
+ if (!$this->sendArgument("-r")) {
+ return false;
+ }
+
+ if (!$this->sendArgument($Revision2)) {
+ return false;
+ }
+
+ if (!$this->sendArgument("--")) {
+ return false;
+ }
+
+ $dir = substr($FileName, 0, strrpos($FileName, "/"));
+ $file = substr($FileName, strrpos($FileName, "/")+1);
+ if (!$this->sendDirectory($dir)) {
+ return false;
+ }
+
+ if (!$this->sendEntry($file, $Revision2, "", "", "")) {
+ return false;
+ }
+
+ if (!$this->sendUnchanged($file)) {
+ return false;
+ }
+
+ if (!$this->sendArgument($file)) {
+ return false;
+ }
+
+ if ($this->SOCKET->write("diff\n") != true) {
+ return false;
+ }
+
+ $this->processResponse();
+
+ return $this->MESSAGE_CONTENT;
+ }
+
+ // ***************************************************************************
// Function: debug()
// Author: Sijis Aviles.
|