summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TThemeManager.php
diff options
context:
space:
mode:
authorxue <>2006-04-04 04:08:48 +0000
committerxue <>2006-04-04 04:08:48 +0000
commit66843b23960e17991db0b4f7b01487063b2234bc (patch)
treedd4432597cc7d4f416da1fb3602daaee23778313 /framework/Web/UI/TThemeManager.php
parentccd3c322df4ac2e19e415ff53c9717ff87164102 (diff)
Refactored cache classes with support for cache dependency
Diffstat (limited to 'framework/Web/UI/TThemeManager.php')
-rw-r--r--framework/Web/UI/TThemeManager.php11
1 files changed, 9 insertions, 2 deletions
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)