From 54456f722932c977ec861d7adde357e6f7ce79ae Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 13 Jan 2006 04:53:10 +0000 Subject: [PATCH] I love breaking things. Refactoring big time. --- includes/init.php | 5 --- includes/node.php | 85 +++++++++++++++++++++++++++++++++++++++++++ includes/shellcmd.php | 24 ++++++++++-- 3 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 includes/node.php diff --git a/includes/init.php b/includes/init.php index e28b28a..b62c088 100644 --- a/includes/init.php +++ b/includes/init.php @@ -69,11 +69,6 @@ $template->set('extension', 'tpl'); require_once('./includes/imaginary.php'); $viewsvn->trigger =& new Imaginary(); -// ################################################################### -// load shell subsystem -require_once('./includes/shellcmd.php'); -$viewsvn->shell =& new Shell(); - // ################################################################### // setup repository require_once('./includes/repository.php'); diff --git a/includes/node.php b/includes/node.php new file mode 100644 index 0000000..003913e --- /dev/null +++ b/includes/node.php @@ -0,0 +1,85 @@ +registry =& $viewsvn; + + require_once('./includes/shellcmd.php'); + $this->xquery = new Shell($this); + + require_once('./includes/svnlib.php'); + $this->library = new SVNLib($this); + } +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file diff --git a/includes/shellcmd.php b/includes/shellcmd.php index fd6edb5..b7ae6b1 100644 --- a/includes/shellcmd.php +++ b/includes/shellcmd.php @@ -33,6 +33,26 @@ */ class Shell { + /** + * Controller + * @var object + * @access private + */ + var $controller = null; + + // ################################################################### + /** + * Constructor + * + * @access public + * + * @param object Controller + */ + function Shell(&$contoller) + { + $this->controller =& $controller; + } + /** * Wrapper for escapeshellarg() * @@ -73,13 +93,11 @@ class Shell */ function exec($command) { - global $viewsvn; - $start = microtime(); exec($command, $output); - $viewsvn->debug("exec(" . $viewsvn->funct->fetch_microtime_diff($start) . "): $command"); + $this->controller->registry->debug("exec(" . $this->controller->registry->funct->fetch_microtime_diff($start) . "): $command"); return $output; } -- 2.43.5