We now have a working index.php again:
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 9 Apr 2007 00:24:01 +0000 (00:24 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 9 Apr 2007 00:24:01 +0000 (00:24 +0000)
- Switched to ISSO3 trunk
- Starting to migrate to PHP5-native code

global.php
includes/init.php
includes/repository.php
index.php
templates/default/headinclude.tpl
templates/default/index_node.tpl

index d920725483065933904be9903530924dc3e9dc87..7ef6af3a7fd26b645234526720718dadeb1beee3 100644 (file)
 require_once('./includes/init.php');
 require_once('./includes/controller.php');
 
-$dochooser = ((defined('PATH_OVERRIDE') AND PATH_OVERRIDE == 1) ? false : true);
-if ($dochooser)
-{
-       $controller = new Controller(Paths::init());
-       
-       if (isset($viewsvn->in['rebuild']) AND $viewsvn->in['rebuild'] == 1 AND $viewsvn->get('debug') == true)
-       {
-               $controller->cachev->build(null);
-       }
-       else
-       {
-               if ($controller->cachev->exec_build())
-               {
-                       unset($controller);
-                       $controller = new Controller(Paths::init());
-               }
-       }
-       
-       $viewsvn->maincontrol =& $controller;
-}
+$input->in['rev'] = $input->clean(substr($input->in['path'], strpos($input->in['path'], '@') + 1), TYPE_UINT);
+$input->in['path'] = substr($input->in['path'], 0, strpos($input->in['path'], '@'));
 
 $fetchtemplates[] = 'header';
 $fetchtemplates[] = 'footer';
index fb3622b5fa8ee751c5be4a95faec29e2d81d7357..140fe13b50be73611fbe510ce0baf96f88d60b12 100644 (file)
@@ -20,7 +20,7 @@
 \*=====================================================================*/
 
 error_reporting(E_ALL & ~E_NOTICE);
-//error_reporting(E_ALL);
+// error_reporting(E_ALL);
 
 define('ISSO_MT_START', microtime());
 
@@ -36,37 +36,29 @@ require_once('./includes/config.php');
 
 // ###################################################################
 // init isso
-define('ISSO_ESCAPE_STRINGS', 1);
-define('ISSO_CHECK_POST_REFERER', 1);
 
-require_once('./framework/kernel.php');
-$viewsvn = new ISSO();
-$viewsvn->set('application',   'ViewSVN');
-$viewsvn->set('apppath',               getcwd());
-$viewsvn->set('appversion',            '[#]version[#]');
-$viewsvn->set('debug',                 $debug);
+ini_set('include_path', ini_get('include_path') . ':' . dirname(dirname(__FILE__)) . '/framework');
 
-$viewsvn->load('functions', 'funct', true);
+require_once('ISSO/Register.php');
+require_once('ISSO/Functions.php');
+require_once('ISSO/Xml.php');
 
-define('ISSO_DB_LAYER', 'db_mysql');
-$viewsvn->load('db_mysql', 'db', true);
+BSRegister::Register('db', $db = BSRegister::LoadModule('DbMySql'));
 $db->connect($conf['db']['server'], $conf['db']['user'], $conf['db']['pass'], $conf['db']['name'], 0);
 
-$viewsvn->load('xml', 'xml', true);
-
-// ###################################################################
-// localization stystem
-$viewsvn->load('localize', 'lang', true);
+BSRegister::Register('input', $input = BSRegister::LoadModule('Input'));
 
 // ###################################################################
 // handle template system
-$viewsvn->load('template_fs', 'template', true);
-$template->set('templatedir',  './templates/' . $conf['paths']['templateset']);
-$template->set('extension',            'tpl');
+
+BSRegister::Register('template', $template = BSRegister::LoadModule('Template'));
+
+$template->setTemplateDirectory('./templates/' . $conf['paths']['templateset']);
+$template->setExtension('tpl');
 
 // ###################################################################
 // load options
-$viewsvn->svnpath = $conf['paths']['svn'];
+BSRegister::Register('svnpath', $conf['paths']['svn']);
 
 require_once('./includes/svncommon.php');
 
@@ -78,12 +70,12 @@ $viewsvn->trigger =& new Imaginary();
 // ###################################################################
 // setup repository
 require_once('./includes/repository.php');
-$viewsvn->repos =& new Repository($conf['repository']['path'], $conf['repository']['iscontainer']);
+BSRegister::Register('repos', $repos = new Repository($conf['repository']['path'], $conf['repository']['iscontainer']));
 
 // ###################################################################
 // path manager
 require_once('./includes/paths.php');
-$viewsvn->path = $conf['paths']['web'];
+BSRegister::Register('webpath', $conf['paths']['web']);
 
 /*=====================================================================*\
 || ###################################################################
index d62189530868fe7f45715a45223d443159b6ea77..90da906760c1e8ff0c267791d03c952bb28926ae 100644 (file)
@@ -30,7 +30,7 @@
 * Repository class that can list repositories and prepare
 * them for use
 *
-* @package     DeskPRO
+* @package     ViewSVN
 * @version     $Id$
 */
 class Repository
@@ -38,23 +38,20 @@ class Repository
        /**
        * Array of valid repositories
        * @var  array
-       * @access       private
        */
-       var $repositories = array();
+       private $repositories = array();
        
        /**
        * Root path to the repository
        * @var string
-       * @access       private
        */
-       var $path;
+       private $path;
        
        /**
        * Whether or not the path is a container
        * @var  bool
-       * @access       private
        */
-       var $container;
+       private $container;
        
        // ###################################################################
        /**
@@ -63,11 +60,11 @@ class Repository
        * @param        string  Path to repository or container
        * @param        bool    Whether the path is a container
        */
-       function Repository($path, $iscontainer)
+       function __construct($path, $iscontainer)
        {
                global $viewsvn;
                
-               $this->path = $viewsvn->fetch_sourcepath($path);
+               $this->path = BSFunctions::FetchSourcePath($path);
                $this->container = (bool)$iscontainer;
                
                if ($this->container)
@@ -104,11 +101,9 @@ class Repository
        /**
        * Returns a list of repositories
        *
-       * @access       public
-       *
        * @return       array   List of repositories
        */
-       function fetch_list()
+       public function fetchList()
        {
                return $this->repositories;
        }
index 3e0628fd1a868596d83c8d6b87f01758fa6a8822..acb8ba4e18de65961fea96b23dbdd4e786743070 100644 (file)
--- a/index.php
+++ b/index.php
@@ -32,44 +32,8 @@ require_once('./global.php');
 
 $nodes = '';
 
-$tables = $db->query("SHOW TABLES");
-while ($table = $db->fetch_array($tables))
+foreach ($repos->fetchList() AS $repos)
 {
-       $value = array_values($table);
-       $tablelist[] = $value[0];
-}
-
-foreach ($viewsvn->repos->fetch_list() AS $repos)
-{
-       if (!in_array('c' . ($hash = md5($viewsvn->repos->fetch_path($repos))) . '_revs', $tablelist))
-       {
-               $viewsvn->debug("creating new cacheV: $repos");
-               $db->query("
-                       CREATE TABLE c{$hash}_revs
-                       (
-                               revision INT(20) UNSIGNED NOT NULL DEFAULT 0,
-                               author VARCHAR(255) NOT NULL DEFAULT '',
-                               dateline VARCHAR(100) NOT NULL DEFAULT '',
-                               files MEDIUMTEXT NOT NULL DEFAULT '',
-                               message MEDIUMTEXT NOT NULL DEFAULT '',
-                               PRIMARY KEY (revision)
-                       )"
-               );
-               
-               $db->query("
-                       CREATE TABLE c{$hash}_nodes
-                       (
-                               name VARCHAR(255) NOT NULL DEFAULT '',
-                               node VARCHAR(50) NOT NULL DEFAULT '',
-                               revision INT(20) UNSIGNED NOT NULL DEFAULT 0,
-                               history MEDIUMTEXT NOT NULL DEFAULT '',
-                               properties MEDIUMTEXT NOT NULL DEFAULT '',
-                               PRIMARY KEY (name)
-                       )"
-               );
-       }
-       
-       $link = 'browse.php/' . $repos . '/';   
        eval('$nodes .= "' . $template->fetch('index_node') . '";');
 }
 
index 619df9ddc7fa946bc976f33e0abab576e3500e13..aec625b54b4d6a51a8b58da2995fb39a5fa35a88 100644 (file)
@@ -1 +1 @@
-       <link rel="stylesheet" href="$viewsvn->path/templates/default/main.css" media="screen" />
\ No newline at end of file
+       <link rel="stylesheet" href="{BSRegister::Get('webpath')}/templates/default/main.css" media="screen" />
\ No newline at end of file
index e44d75ca7280a9891b311514afe0c5d7f3f4f832..8a184a6d305d95adb8e3648a4d86eecc484c62fe 100644 (file)
@@ -1 +1 @@
-                       <li><a href="$viewsvn->path/$link">$repos</a></li>
+                       <li><a href="{BSRegister::Get('webpath')}/browse/$repos:">$repos</a></li>