From 66843b23960e17991db0b4f7b01487063b2234bc Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 4 Apr 2006 04:08:48 +0000 Subject: Refactored cache classes with support for cache dependency --- framework/Web/UI/TThemeManager.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI/TThemeManager.php') diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 29b48d90..f2de22f5 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -209,17 +209,20 @@ class TTheme extends TApplicationComponent implements ITheme { $this->_themeUrl=$themeUrl; $this->_name=basename($themePath); + $cacheValid=false; + // TODO: the following needs to be cleaned up (Qiang) if(($cache=$this->getApplication()->getCache())!==null) { $array=$cache->get(self::THEME_CACHE_PREFIX.$themePath); + //print_r($array);die('here'); if(is_array($array)) { list($skins,$cssFiles,$jsFiles,$timestamp)=$array; - $cacheValid=true; if($this->getApplication()->getMode()!==TApplication::STATE_PERFORMANCE) { if(($dir=opendir($themePath))===false) throw new TIOException('theme_path_inexistent',$themePath); + $cacheValid=true; while(($file=readdir($dir))!==false) { if($file==='.' || $file==='..') @@ -240,14 +243,18 @@ class TTheme extends TApplicationComponent implements ITheme } else { + $cacheValid=true; $this->_cssFiles=$cssFiles; $this->_jsFiles=$jsFiles; $this->_skins=$skins; } } } - if($this->_skins===null) + if(!$cacheValid) { + $this->_cssFiles=array(); + $this->_jsFiles=array(); + $this->_skins=array(); if(($dir=opendir($themePath))===false) throw new TIOException('theme_path_inexistent',$themePath); while(($file=readdir($dir))!==false) -- cgit v1.2.3