I love breaking things. Refactoring big time.
authorRobert Sesek <rsesek@bluestatic.org>
Fri, 13 Jan 2006 04:53:10 +0000 (04:53 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Fri, 13 Jan 2006 04:53:10 +0000 (04:53 +0000)
includes/init.php
includes/node.php [new file with mode: 0644]
includes/shellcmd.php

index e28b28a200c2f05f998eccfab7668ef5ba84faff..b62c088235144bac20010db12e1453f5466866a6 100644 (file)
@@ -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 (file)
index 0000000..003913e
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # ViewSVN [#]version[#]
+|| # Copyright ©2002-[#]year[#] Iris Studios, Inc.
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+/**
+* Node Controller
+*
+* This class represents one node in SVN. For each node that you need
+* to display information about, create a new instance of this class.
+* Generally, however, this one instance should be able to handle
+* the needs of the entire class.
+*
+* @author              Iris Studios, Inc.
+* @copyright   Copyright ©2002 - [#]year[#], Iris Studios, Inc.
+* @version             $Revision$
+* @package             ViewSVN
+* 
+*/
+class Node_Controller
+{
+       /**
+       * Registry class
+       * @var  object
+       * @access       private
+       */
+       var $registry = null;
+       
+       /**
+       * Xquery layer
+       * @var  object
+       * @access       private
+       */
+       var $xquery = null;
+       
+       /**
+       * Xquery method library
+       * @var  object
+       * @access       private
+       */
+       var $library = null;
+       
+       // ###################################################################
+       /**
+       * Constructor
+       *
+       * @access       public
+       */
+       function Node_Controller()
+       {
+               global $viewsvn;
+               
+               $this->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
index fd6edb50c48cd5ffdb3010cc3f97ee0e8d877ef2..b7ae6b14ca55d36e56dace927bab36eff3af0c28 100644 (file)
 */
 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;
        }