Lots of documentation updates
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 23:16:56 +0000 (23:16 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 22 Jan 2006 23:16:56 +0000 (23:16 +0000)
includes/controller.php
includes/paths.php
includes/repository.php
includes/shellcmd.php
includes/svncommon.php
includes/svnlib.php

index 9f022fd4261d74991095a6c900fd2d49a7dace64..0a2d475d2513048441b63958e643ec93f67ed087 100644 (file)
@@ -116,7 +116,7 @@ class Controller
        /**
        * Constructor
        *
-       * @access       public
+       * @param        string  The path of the node
        */
        function Controller($nodepath)
        {
@@ -203,41 +203,6 @@ class Controller
                return $this->href_struct($base . ($url[1] ? '?' . $url[1] : ''), $path);
        }
        
-       // ###################################################################
-       /**
-       * Constructs a repository browser link
-       *
-       * @access       public
-       *
-       * @param        string  Base path
-       * @param        string  Browser path, separated using '/'
-       *
-       * @return       string  Link path
-       */
-       function out($base, $addpath = null)
-       {
-               global $viewsvn;
-               
-               if ($addpath === null)
-               {
-                       $addpath = $this->path;
-               }
-               
-               $url = Paths::fetch_arguments($base);
-               $addpath = Paths::sanitize($addpath);
-               
-               // standard URL type
-               if ($this->registry->paths->type == 1)
-               {
-                       return $url[0] . '?path=' . $addpath . ($url[1] ? '&amp;' . $url[1] : '');
-               }
-               // advanced path system
-               else if ($this->registry->paths->type == 2)
-               {
-                       return $url[0] . '/' . $this->repos . ($addpath{0} != '/' ? '/' : '') . $addpath . ($url[1] ? '?' . $url[1] : '');
-               }
-       }
-       
        // ###################################################################
        /**
        * Create path breadcrumb
index 6c9ef0c193d9e36b5be7965d29c94ac8afb4488f..1679ee35da7ea9c0876904678ee6087f5d81a6a2 100644 (file)
@@ -20,8 +20,7 @@
 \*=====================================================================*/
 
 /**
-* Handles the various methods that are used to navigate
-* browser paths
+* Handles the various methods that are used to navigate browser paths
 *
 * @package     ViewSVN
 */
@@ -34,9 +33,8 @@ the string creators may need to go into a static class or something. or not. we'
 */
 
 /**
-* Path managing class that constructs and parses input
-* and output for paths. This is essentially a controller
-* of all current information.
+* This is a utility class that should be accessed in a static fashion. It
+* provides tools for parsing incoming data into variables.
 *
 * @package     ViewSVN
 * @version     $Id$
@@ -77,7 +75,8 @@ class Paths
                
                return $path;
        }
-               
+       
+       // ###################################################################
        /**
        * Returns the name of the repository from a upath
        *
@@ -93,6 +92,7 @@ class Paths
                return $temp[0];
        }
        
+       // ###################################################################
        /**
        * Returns the path without the repository from a upath
        *
@@ -110,6 +110,7 @@ class Paths
                return ($doslash ? '/' : '') . implode('/', $temp);
        }
        
+       // ###################################################################
        /**
        * Fetches any URL parameters a link has
        *
@@ -139,6 +140,7 @@ class Paths
                return $return;
        }
        
+       // ###################################################################
        /**
        * Determines if the root path has been reached
        *
@@ -162,6 +164,7 @@ class Paths
                }
        }
        
+       // ###################################################################
        /**
        * Returns the current sanitized revision
        *
@@ -230,6 +233,7 @@ class Paths
                }
        }
        
+       // ###################################################################
        /**
        * Returns a GET string with sanitized revision data
        *
@@ -255,6 +259,7 @@ class Paths
                }
        }
        
+       // ###################################################################
        /**
        * Sanitizes a path for passing
        *
index 79f30132b8cc23aea7157830546108d2ae3be91c..d62189530868fe7f45715a45223d443159b6ea77 100644 (file)
@@ -56,6 +56,7 @@ class Repository
        */
        var $container;
        
+       // ###################################################################
        /**
        * Constructor: prepare for repository
        *
@@ -99,6 +100,7 @@ class Repository
                }
        }
        
+       // ###################################################################
        /**
        * Returns a list of repositories
        *
@@ -111,6 +113,7 @@ class Repository
                return $this->repositories;
        }
        
+       // ###################################################################
        /**
        * Returns a path to a repository
        *
@@ -139,6 +142,7 @@ class Repository
                }
        }
        
+       // ###################################################################
        /**
        * Verifies a path inside a repository
        *
index 073af5f4f962988431859f0ac2fb86177bdcaea9..ab5bcbf2aa81859624c1ec44bceefbda1ac737d0 100644 (file)
@@ -26,7 +26,8 @@
 */
 
 /**
-* Interacts with the command line via escapes and executions
+* This class is the Xquery interface. It is responsible for doing the
+* actual interaction with the command line.
 *
 * @package     ViewSVN
 * @version     $Id$
@@ -53,6 +54,7 @@ class Shell
                $this->controller =& $controller;
        }
        
+       // ###################################################################
        /**
        * Wrapper for escapeshellarg()
        *
@@ -67,6 +69,7 @@ class Shell
                return escapeshellarg($argument);
        }
        
+       // ###################################################################
        /**
        * Wrapper for escapeshellcmd
        *
@@ -81,6 +84,7 @@ class Shell
                return escapeshellcmd($command);
        }
        
+       // ###################################################################
        /**
        * Executes a shell command and returns all the output
        * as an array
index 82ced3adbe9e9b17267c84f2030426f53af17d35..a0b415acb409276a0a026f1cc2b74371ffbae841 100644 (file)
 */
 
 /**
-* Interacts with the command line subsystem to
-* access SVN information
+* This is a utility class that should be accessed in a static fashion. It
+* is responsbile for various parsing mechanisms, mainly.
 *
 * @package     ViewSVN
 * @version     $Id$
 */
 class SVNCommon
 {
+       // ###################################################################
        /**
        * Prepares data for output
        *
@@ -72,6 +73,7 @@ class SVNCommon
                return $string;
        }
        
+       // ###################################################################
        /**
        * Formats a SVN log message
        *
@@ -151,6 +153,7 @@ class SVNCommon
                return preg_replace('#(....)\-(..)\-(..)T(..):(..):(..).(.*)Z#e', 'gmdate("r", mktime(\4, \5, \6, \2, \3, \1))', $string);
        }
        
+       // ###################################################################
        /**
        * Counts the spaces and replaces two or more ones
        *
@@ -170,6 +173,7 @@ class SVNCommon
                return $thestring;
        }
        
+       // ###################################################################
        /**
        * Prints the file changed list
        *
@@ -227,6 +231,7 @@ class SVNCommon
                return $files;
        }
        
+       // ###################################################################
        /**
        * Generates a clean revision number
        *
index d2b962b60c04869b3255e405b71cc867001667be..13b3e6bc46c57b03a33e6fbe65294ad5071797a0 100644 (file)
 \*=====================================================================*/
 
 /**
-* Command line interface with the SVN commands
+* Command line library and SVN-PHP bridge extension
 *
 * @package     ViewSVN
 */
 
 /**
-* Interacts with the command line subsystem to
-* access SVN information
+* This class acts as the bridge between the command line Xquery class
+* and the various display files. It handles preparation of Xquery
+* code.
 *
 * @package     ViewSVN
 * @version     $Id$
@@ -37,6 +38,7 @@ class SVNLib
        /**
        * Path to the SVN binary
        * @var  string
+       * @access       private
        */
        var $svnpath;
        
@@ -47,6 +49,7 @@ class SVNLib
        */
        var $controller;
        
+       // ###################################################################
        /**
        * Constructor: validate SVN path
        *
@@ -71,6 +74,7 @@ class SVNLib
                }
        }
 
+       // ###################################################################
        /**
        * Executes the SVN binary
        *
@@ -97,8 +101,12 @@ class SVNLib
                return $output;
        }
        
+       // ###################################################################
        /**
-       * SVN Wrapper: standard command system
+       * This function is used to prepare a common command. It sends the
+       * specified command along with the repository path and the current
+       * node. The revision is either fectched from the argument list or
+       * from the node, too.
        *
        * @access       public
        *
@@ -116,42 +124,12 @@ class SVNLib
                return $this->svn($command . ' ' . $this->controller->repospath . $this->controller->path . ($revision !== null ? '@' . $revision : ''));
        }
        
+       // ###################################################################
        /**
-       * SVN Wrapper: blame
-       *
-       * @access       protected
+       * A library complicator function that handles the diff command because
+       * the standard command() system does not work with more complex args.
        *
-       * @param        string  Repository
-       * @param        string  Path
-       * @param        integer Revision
-       *
-       * @return       array   Lines of blame output
-       */
-       function blame($repos, $path, $revision)
-       {
-               return $this->std('blame', $repos, $path, $revision);
-       }
-       
-       /**
-       * SVN Wrapper: cat
-       *
-       * @access       protected
-       *
-       * @param        string  Repository
-       * @param        string  Path
-       * @param        integer Revision
-       *
-       * @return       array   Lines of cat output
-       */
-       function cat($repos, $path, $revision)
-       {       
-               return $this->std('cat', $repos, $path, $revision);
-       }
-       
-       /**
-       * SVN Wrapper: diff
-       *
-       * @access       protected
+       * @access       public
        *
        * @param        integer Lower revision
        * @param        integer Higher revision
@@ -184,10 +162,12 @@ class SVNLib
                return $this->svn('diff -r' . $lorev . ':' . $hirev . ' ' . $this->controller->repospath . $this->controller->path);
        }
        
+       // ###################################################################
        /**
-       * SVN Wrapper: log
+       * A library complicator function to create log output. This is needed
+       * because command() doesn't handle ranged revisions.
        *
-       * @access       protected
+       * @access       public
        *
        * @param        string  Repository
        * @param        string  Path
@@ -196,7 +176,7 @@ class SVNLib
        *
        * @return       array   Lines of log output
        */
-       function log($repos, $path, $lorev, $hirev)
+       function log($lorev, $hirev)
        {
                global $viewsvn;
                
@@ -223,25 +203,10 @@ class SVNLib
                
                return $this->svn('log -v -r' . $hirev . ':' . $lorev . ' ' . $repospath . $path);
        }
-       
-       /**
-       * SVN Wrapper: ls (list)
-       *
-       * @access       public
-       *
-       * @param        object  Controller object
-       *
-       * @return       array   Lines of list output
-       */
-       function ls(&$controller)
-       {
-               return $this->std('list');
-       }
 }
 
 /**
-* Annotation/blame system; constructs an array
-* that is ready for output
+* Annotation/blame system; constructs an array that is ready for output
 *
 * @package     ViewSVN
 * @version     $Id$
@@ -251,21 +216,22 @@ class SVNBlame
        /**
        * Array of blame information
        * @var  array
+       * @access       private
        */
        var $blame = array();
        
        /**
        * Raw "svn blame" output
        * @var  array
+       * @access       private
        */
        var $rawoutput;
        
+       // ###################################################################
        /**
        * Constructor: create blame and store data
        *
-       * @param        string  Repository
-       * @param        string  Path
-       * @param        integer Revision
+       * @param        object  Controller
        */
        function SVNBlame(&$controller)
        {
@@ -273,6 +239,7 @@ class SVNBlame
                $this->process();
        }
        
+       // ###################################################################
        /**
        * Returns blame for display
        *
@@ -285,6 +252,7 @@ class SVNBlame
                return $this->blame;
        }
        
+       // ###################################################################
        /**
        * Parses the blame data
        *
@@ -320,8 +288,7 @@ class SVNBlame
 }
 
 /**
-* Log management system; creates a complex list
-* of SVN log information
+* Log management system; creates a complex list of SVN log information
 *
 * @package     ViewSVN
 * @version     $Id$
@@ -331,22 +298,22 @@ class SVNLog
        /**
        * Array of logs
        * @var  array
+       * @access       private
        */
        var $logs = array();
        
        /**
        * Raw "svn log" output
        * @var  array
+       * @access       private
        */
        var $rawoutput;
        
+       // ###################################################################
        /**
        * Constructor: create log store for the given file
        *
-       * @param        string  Repository
-       * @param        string  Path
-       * @param        integer Lower revision
-       * @param        integer Higher revision
+       * @param        object  Controller
        */
        function SVNLog(&$controller)
        {
@@ -354,6 +321,7 @@ class SVNLog
                $this->process();
        }
        
+       // ###################################################################
        /**
        * Returns logs for display
        *
@@ -366,6 +334,7 @@ class SVNLog
                return $this->logs;
        }
        
+       // ###################################################################
        /**
        * Splits up the raw output into a usable log
        *
@@ -425,6 +394,7 @@ class SVNLog
                }
        }
        
+       // ###################################################################
        /**
        * Trims the last dash line off a message
        *
@@ -441,30 +411,32 @@ class SVNLog
 }
 
 /**
-* Diff system; constructs a diff array that
-* is ready for output
+* Diff system; constructs a diff array that is ready for output
 *
 * @package     ViewSVN
+* @version     $Id$
 */
 class SVNDiff
 {
        /**
        * Array of diff information
        * @var  array
+       * @access       private
        */
        var $diff = array();
        
        /**
        * Raw "svn diff" output
        * @var  array
+       * @access       private
        */
        var $rawoutput;
        
+       // ###################################################################
        /**
        * Constructor: create and store diff data
        *
-       * @param        string  Repository
-       * @param        string  Path
+       * @param        object  Controller
        * @param        integer Lower revision
        * @param        integer Higher revision
        */
@@ -474,6 +446,7 @@ class SVNDiff
                $this->process();
        }
        
+       // ###################################################################
        /**
        * Returns diffs for display
        *
@@ -486,6 +459,7 @@ class SVNDiff
                return $this->diff;
        }
        
+       // ###################################################################
        /**
        * Processes and prepares diff data
        *
@@ -653,9 +627,9 @@ class SVNDiff
                }
        }
        
+       // ###################################################################
        /**
-       * Returns the amount of change that occured
-       * between two lines
+       * Returns the amount of change that occured between two lines
        *
        * @access       private
        *