From 32c7c8673a697e35de768126404933d30efd2c11 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 Jan 2006 03:25:22 +0000 Subject: [PATCH] Construct cacheV tables for each repository --- index.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index b016e86..4808d61 100644 --- a/index.php +++ b/index.php @@ -32,9 +32,34 @@ require_once('./global.php'); $nodes = ''; +$tables = $db->query("SHOW TABLES"); +while ($table = $db->fetch_array($tables)) +{ + $value = array_values($table); + $tablelist[] = $value[0]; +} + foreach ($viewsvn->repos->fetch_list() AS $repos) { - $link = $viewsvn->paths->out('browse.php', $repos . '/'); + if (!in_array($hash = md5($viewsvn->repos->fetch_path($repos)), $tablelist)) + { + $viewsvn->debug("creating new cacheV: $repos"); + $db->query(" + CREATE TABLE $hash + ( + path MEDIUMTEXT NOT NULL DEFAULT '', + uuid VARCHAR(40) NOT NULL DEFAULT '', + revision INT(20) NOT NULL DEFAULT 0, + node VARCHAR(50) NOT NULL DEFAULT '', + author VARCHAR(255) NOT NULL DEFAULT '', + dateline VARCHAR(100) NOT NULL DEFAULT '', + files MEDIUMTEXT NOT NULL DEFAULT '', + message MEDIUMTEXT NOT NULL DEFAULT '' + )" + ); + } + + $link = $viewsvn->paths->out('browse.php', $repos . '/'); eval('$nodes .= "' . $template->fetch('index_node') . '";'); } -- 2.43.5