From e46dc069a72673429bd63e09d130a7bcab40789f Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 28 Jan 2006 20:55:23 +0000 Subject: [PATCH] Trying to fix the problem where if the cache is built up, then until you refresh, the old data is still displayed --- global.php | 9 +++++++-- includes/cachev.php | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/global.php b/global.php index 4d101b5..8d2faac 100644 --- a/global.php +++ b/global.php @@ -26,7 +26,6 @@ $dochooser = ((defined('PATH_OVERRIDE') AND PATH_OVERRIDE == 1) ? false : true); if ($dochooser) { $controller = new Controller(Paths::init()); - $viewsvn->maincontrol =& $controller; if (isset($viewsvn->in['rebuild']) AND $viewsvn->in['rebuild'] == 1 AND $viewsvn->get('debug') == true) { @@ -34,8 +33,14 @@ if ($dochooser) } else { - $controller->cachev->exec_build(); + if ($controller->cachev->exec_build()) + { + unset($controller); + $controller = new Controller(Paths::init()); + } } + + $viewsvn->maincontrol =& $controller; } $fetchtemplates[] = 'header'; diff --git a/includes/cachev.php b/includes/cachev.php index 195132b..dbde2d7 100644 --- a/includes/cachev.php +++ b/includes/cachev.php @@ -290,6 +290,8 @@ class cacheV * to make sure that it's up-to-date against the root repository. * * @access public + * + * @return bool Whether or not any part of the cache was (re-)built */ function exec_build() { @@ -312,8 +314,11 @@ class cacheV if ($tree['info']['entry']['revision'] != $this->count) { $this->build($this->count); + return true; } } + + return false; } // ################################################################### -- 2.43.5