*/
var $svnpath;
+ /**
+ * Common command system
+ * @var object
+ */
+ var $common;
+
/**
* Constructor: validate SVN path
*
$this->svnpath = $viewsvn->shell->cmd($svnpath);
+ $this->common =& new SVNCommon();
+
$access = $viewsvn->shell->exec($this->svnpath . ' --version');
if (!$access)
}
}
+/**
+* Commonly executed SVN commands that return data
+* used in many parts of the system
+*
+* @package ViewSVN
+* @version $Id$
+*/
+class SVNCommon
+{
+ /**
+ * Registry object
+ * @var object
+ */
+ var $registry;
+
+ /**
+ * Constructor: bind with registry
+ */
+ function SVNCommon()
+ {
+ global $viewsvn;
+
+ $this->registry =& $viewsvn;
+ }
+
+ /**
+ * Checks to see if the given universal path is
+ * a directory
+ *
+ * @access public
+ *
+ * @param string Universal path
+ *
+ * @return bool Directory or not
+ */
+ function isdir($path)
+ {
+ $output = $this->registry->svn->cat($this->registry->paths->fetch_repos($path), $this->registry->paths->fetch_path($path), 'HEAD');
+ $output = implode("\n", $output);
+ if (strpos($output, 'svn:') === false)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+}
+
/**
* Annotation/blame system; constructs an array
* that is ready for output