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';
\*=====================================================================*/
error_reporting(E_ALL & ~E_NOTICE);
-//error_reporting(E_ALL);
+// error_reporting(E_ALL);
define('ISSO_MT_START', microtime());
// ###################################################################
// 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');
// ###################################################################
// 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']);
/*=====================================================================*\
|| ###################################################################
* Repository class that can list repositories and prepare
* them for use
*
-* @package DeskPRO
+* @package ViewSVN
* @version $Id$
*/
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;
// ###################################################################
/**
* @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)
/**
* Returns a list of repositories
*
- * @access public
- *
* @return array List of repositories
*/
- function fetch_list()
+ public function fetchList()
{
return $this->repositories;
}
$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') . '";');
}
- <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
- <li><a href="$viewsvn->path/$link">$repos</a></li>
+ <li><a href="{BSRegister::Get('webpath')}/browse/$repos:">$repos</a></li>