From cec0615182c5a825c9e8752602280f0b271b9fd1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 22 Jan 2006 23:16:56 +0000 Subject: [PATCH] Lots of documentation updates --- includes/controller.php | 37 +------------ includes/paths.php | 17 ++++-- includes/repository.php | 4 ++ includes/shellcmd.php | 6 +- includes/svncommon.php | 9 ++- includes/svnlib.php | 118 ++++++++++++++++------------------------ 6 files changed, 74 insertions(+), 117 deletions(-) diff --git a/includes/controller.php b/includes/controller.php index 9f022fd..0a2d475 100644 --- a/includes/controller.php +++ b/includes/controller.php @@ -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] ? '&' . $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 diff --git a/includes/paths.php b/includes/paths.php index 6c9ef0c..1679ee3 100644 --- a/includes/paths.php +++ b/includes/paths.php @@ -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 * diff --git a/includes/repository.php b/includes/repository.php index 79f3013..d621895 100644 --- a/includes/repository.php +++ b/includes/repository.php @@ -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 * diff --git a/includes/shellcmd.php b/includes/shellcmd.php index 073af5f..ab5bcbf 100644 --- a/includes/shellcmd.php +++ b/includes/shellcmd.php @@ -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 diff --git a/includes/svncommon.php b/includes/svncommon.php index 82ced3a..a0b415a 100644 --- a/includes/svncommon.php +++ b/includes/svncommon.php @@ -26,14 +26,15 @@ */ /** -* 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 * diff --git a/includes/svnlib.php b/includes/svnlib.php index d2b962b..13b3e6b 100644 --- a/includes/svnlib.php +++ b/includes/svnlib.php @@ -20,14 +20,15 @@ \*=====================================================================*/ /** -* 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 * -- 2.22.5