Checking in inital code base
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 27 Aug 2005 08:18:58 +0000 (08:18 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 27 Aug 2005 08:18:58 +0000 (08:18 +0000)
includes/imaginary.php [new file with mode: 0644]
includes/init.php [new file with mode: 0644]
includes/repository.php [new file with mode: 0644]
includes/shellcmd.php [new file with mode: 0644]
includes/svnlib.php [new file with mode: 0644]
index.php [new file with mode: 0644]

diff --git a/includes/imaginary.php b/includes/imaginary.php
new file mode 100644 (file)
index 0000000..6fd3ea9
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # ViewSVN [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+/**
+* Mimics functions that will later become the language
+* independence system and error system
+*
+* @pacakge     ViewSVN
+*/
+
+/**
+* Imaginary class that does error reporting and language
+* independence
+*
+* @package     ViewSVN
+* @version     $Id$
+*/
+class Imaginary
+{
+       /**
+       * Mimics the error reporting function
+       *
+       * @access       public
+       *
+       * @param        string  Error
+       *
+       * @return       string  Error
+       */
+       function error($error)
+       {
+               trigger_error($error, E_USER_ERROR);
+       }
+}
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/includes/init.php b/includes/init.php
new file mode 100644 (file)
index 0000000..8dc8f9f
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # ViewSVN [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+error_reporting(E_ALL);
+
+define('ISSO_MT_START', microtime());
+
+// ###################################################################
+// configuration file
+if (!file_exists('./config.php'))
+{
+       echo 'includes/config.php needs to be present!';
+       exit;
+}
+
+require_once('./config.php');
+
+// ###################################################################
+// init isso
+define('ISSO_ESCAPE_STRINGS', 1);
+define('ISSO_CHECK_POST_REFERER', 1);
+
+require_once($issopath . 'kernel.php');
+$viewsvn =& $_isso;
+$viewsvn->application = 'ViewSVN';
+$viewsvn->apppath = $viewsvn->fetch_sourcepath(getcwd());
+$viewsvn->appversion = '[#]version[#]';
+$viewsvn->debug = $debug;
+$viewsvn->sourcepath = $viewsvn->fetch_sourcepath($issopath);
+
+$viewsvn->load('functions');
+$viewsvn->exec_sanitize_data();
+
+// ###################################################################
+// imaginary reporter
+require_once('./imaginary.php');
+$viewsvn->trigger =& new Imaginary();
+
+// ###################################################################
+// load shell subsystem
+require_once('./shellcmd.php');
+$viewsvn->shell =& new Shell();
+
+// ###################################################################
+// setup repository
+require_once('./repository.php');
+$viewsvn->repos =& new Repository($repository, $iscontainer);
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/includes/repository.php b/includes/repository.php
new file mode 100644 (file)
index 0000000..37873c4
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # ViewSVN [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+/**
+* Class that manages repositories and can produce lists of
+* repositories
+*
+* @pacakge     ViewSVN
+*/
+
+/**
+* Repository class that can list repositories and prepare
+* them for use
+*
+* @package     DeskPRO
+* @version     $Id$
+*/
+class Repository
+{
+       /**
+       * Constructor: prepare for repository
+       *
+       * @param        string  Path to repository or container
+       * @param        bool    Whether the path is a container
+       */
+       function Repository($path, $iscontainer)
+       {
+               global $viewsvn;
+               
+               $repos = array();
+               
+               $path = $viewsvn->fetch_sourcepath($path);
+               
+               if ($iscontainer)
+               {
+                       if ($dir = @opendir($path))
+                       {
+                               while (($file = readdir($dir)) !== false)
+                               {
+                                       if (is_dir($path . $file) AND $file{0} != '.'  AND is_dir($path . $file . '/' . 'db'))
+                                       {
+                                               $repos[] = $file;
+                                       }
+                               }
+                               closedir($dir);
+                       }
+               }
+               else
+               {
+                       if (is_dir($path . 'db'))
+                       {
+                               $repos[] = $path;
+                       }
+               }
+               
+               if (count($repos) < 1)
+               {
+                       $viewsvn->trigger->error('no valid repositories');
+               }
+       }
+}
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/includes/shellcmd.php b/includes/shellcmd.php
new file mode 100644 (file)
index 0000000..65b7ac0
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # ViewSVN [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+/**
+* Class that interacts with the command line system
+*
+* @pacakge     ViewSVN
+*/
+
+/**
+* Interacts with the command line via escapes and executions
+*
+* @package     DeskPRO
+* @version     $Id$
+*/
+class Shell
+{
+       /**
+       * Wrapper for escapeshellarg()
+       *
+       * @access       public
+       *
+       * @param        string  The argument
+       *
+       * @return       string  Cleaned argument
+       */
+       function arg($argument)
+       {
+               return escapeshellarg($argument);
+       }
+       
+       /**
+       * Wrapper for escapeshellcmd
+       *
+       * @access       public
+       *
+       * @param        string  Command
+       *
+       * @return       string  Cleaned command
+       */
+       function cmd($command)
+       {
+               return escapeshellcmd($command);
+       }
+       
+       /**
+       * Executes a shell command and returns all the output
+       * as an array
+       *
+       * @access       public
+       *
+       * @param        string  UNIX command
+       *
+       * @return       array   Output
+       */
+       function exec($command)
+       {
+               exec($command, $output);
+               return $output;
+       }
+}
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/includes/svnlib.php b/includes/svnlib.php
new file mode 100644 (file)
index 0000000..1e01b16
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # ViewSVN [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644 (file)
index 0000000..1e01b16
--- /dev/null
+++ b/index.php
@@ -0,0 +1,19 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # ViewSVN [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file