*/
var $path;
+ /**
+ * The current revision number
+ * @var integer
+ * @access public
+ */
+ var $revnum;
+
+ /**
+ * The current revision as a string argument
+ * @var string
+ * @access public
+ */
+ var $revstr;
+
// ###################################################################
/**
* Constructor
$this->repospath = $this->registry->repos->fetch_path($this->repos);
+ $this->revnum = Paths::fetch_rev_num();
+ $this->revstr = Paths::fetch_rev_str();
+
require_once('./includes/shellcmd.php');
$this->xquery = new Shell($this);
*/
class Paths
{
+ // ###################################################################
/**
- * Path manager type
- * @var integer
- */
- var $type;
-
- /**
- * The universal path that is currently being browsed
- * @var string
- */
- var $path;
-
- /**
- * Current repository that we're in
- * @var string
- */
- var $repos;
-
- /**
- * Current internal path inside the repository
- * @var string
- */
- var $relpath;
-
- /**
- * The current revision number
- * @var integer
- */
- var $revnum;
-
- /**
- * The current revision as a string argument
- * @var string
- */
- var $revstr;
-
- /**
- * Constructor: determine the type of linking to use
- *
- * @param integer Path management type
- */
- function Paths($type)
- {
- global $viewsvn;
-
- if ($type < 1 OR $type > 2)
- {
- $viewsvn->trigger->error($viewsvn->lang->string('Invalid path management type specified in [includes/config.php]'));
- }
-
- $this->type = (int)$type;
-
- $this->path = $this->parse();
- $this->revnum = $this->revnum;
- $this->revstr = $this->revstr;
- }
-
- /**
- * Parses an incoming path with the various methods
- * and returns a universal form
+ * Parses the incoming path variables and returns a sanitized path that
+ * is used to init the Node_Controller
*
* @access public
*
* @return string Universal path, separated using '/'
*/
- function parse()
+ function init()
{
global $viewsvn;
return;
}
- // standard URL type
- if ($this->type == 1)
+ if (@$_SERVER['PATH_INFO'])
{
- $path = $viewsvn->in['path'];
+ $path = $viewsvn->sanitize($_SERVER['PATH_INFO']);
}
- // advanced path system
- else if ($this->type == 2)
+ else
{
- if (@$_SERVER['PATH_INFO'])
- {
- $path = $viewsvn->sanitize($_SERVER['PATH_INFO']);
- }
- else
- {
- $viewsvn->trigger->error($viewsvn->lang->string('Your server does not support type-2 path management'));
- }
+ $viewsvn->trigger->error($viewsvn->lang->string('Your server does not support type-2 path management'));
}
if (!$path)
$viewsvn->trigger->error($viewsvn->lang->string('Invalid path sent'));
}
- if (!$viewsvn->repos->verify($this->repos = $this->fetch_repos($path), $this->relpath = $this->fetch_path($path)))
- {
- $viewsvn->trigger->error($viewsvn->lang->string('The path specified could not be verified'));
- }
-
return $path;
}
*/
function fetch_rev_str($highlow = false, $high = null, $low = null)
{
- $rev = $this->fetch_rev_num($highlow, $high, $low);
+ $rev = Paths::fetch_rev_num($highlow, $high, $low);
if ($highlow)
{