/**
* Constructor
*
- * @access public
+ * @param string The path of the node
*/
function Controller($nodepath)
{
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
\*=====================================================================*/
/**
-* Handles the various methods that are used to navigate
-* browser paths
+* Handles the various methods that are used to navigate browser paths
*
* @package ViewSVN
*/
*/
/**
-* 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$
return $path;
}
-
+
+ // ###################################################################
/**
* Returns the name of the repository from a upath
*
return $temp[0];
}
+ // ###################################################################
/**
* Returns the path without the repository from a upath
*
return ($doslash ? '/' : '') . implode('/', $temp);
}
+ // ###################################################################
/**
* Fetches any URL parameters a link has
*
return $return;
}
+ // ###################################################################
/**
* Determines if the root path has been reached
*
}
}
+ // ###################################################################
/**
* Returns the current sanitized revision
*
}
}
+ // ###################################################################
/**
* Returns a GET string with sanitized revision data
*
}
}
+ // ###################################################################
/**
* Sanitizes a path for passing
*
*/
/**
-* 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
*
return $string;
}
+ // ###################################################################
/**
* Formats a SVN log message
*
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
*
return $thestring;
}
+ // ###################################################################
/**
* Prints the file changed list
*
return $files;
}
+ // ###################################################################
/**
* Generates a clean revision number
*
\*=====================================================================*/
/**
-* 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$
/**
* Path to the SVN binary
* @var string
+ * @access private
*/
var $svnpath;
*/
var $controller;
+ // ###################################################################
/**
* Constructor: validate SVN path
*
}
}
+ // ###################################################################
/**
* Executes the SVN binary
*
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
*
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
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
*
* @return array Lines of log output
*/
- function log($repos, $path, $lorev, $hirev)
+ function log($lorev, $hirev)
{
global $viewsvn;
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$
/**
* 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)
{
$this->process();
}
+ // ###################################################################
/**
* Returns blame for display
*
return $this->blame;
}
+ // ###################################################################
/**
* Parses the blame data
*
}
/**
-* 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$
/**
* 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)
{
$this->process();
}
+ // ###################################################################
/**
* Returns logs for display
*
return $this->logs;
}
+ // ###################################################################
/**
* Splits up the raw output into a usable log
*
}
}
+ // ###################################################################
/**
* Trims the last dash line off a message
*
}
/**
-* 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
*/
$this->process();
}
+ // ###################################################################
/**
* Returns diffs for display
*
return $this->diff;
}
+ // ###################################################################
/**
* Processes and prepares diff data
*
}
}
+ // ###################################################################
/**
- * Returns the amount of change that occured
- * between two lines
+ * Returns the amount of change that occured between two lines
*
* @access private
*