summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
authorxue <>2005-12-01 18:51:14 +0000
committerxue <>2005-12-01 18:51:14 +0000
commita142a2e6813d52d999d91cec5fcf743310e5046f (patch)
treeafdd1c2809af0ad73b9a50c388b723bd586a97f5 /framework/Web
parent9b334afcd805d57834ca6504873f5efbb02d47fd (diff)
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/TAssetManager.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index 4dfcdf5b..3e7df967 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -67,6 +67,10 @@ class TAssetManager extends TComponent implements IModule
* @var TApplication application instance
*/
private $_application;
+ /**
+ * @var array published assets
+ */
+ private $_published=array();
/**
* Initializes the module.
@@ -158,7 +162,9 @@ class TAssetManager extends TComponent implements IModule
*/
public function publishFilePath($path,$checkTimestamp=false)
{
- if(($fullpath=realpath($path))===false)
+ if(isset($this->_published[$path]))
+ return $this->_published[$path];
+ else if(($fullpath=realpath($path))===false)
return '';
else if(is_file($fullpath))
{
@@ -171,14 +177,16 @@ class TAssetManager extends TComponent implements IModule
if(!is_file($file) || @filemtime($file)<@filemtime($fullpath))
@copy($fullpath,$file);
}
- return $this->_baseUrl.'/'.$dir.'/'.basename($fullpath);
+ $this->_published[$path]=$this->_baseUrl.'/'.$dir.'/'.basename($fullpath);
+ return $this->_published[$path];
}
else
{
$dir=md5($fullpath);
if(!is_dir($this->_basePath.'/'.$dir) || $checkTimestamp || $this->_application->getMode()!=='Performance')
$this->copyDirectory($fullpath,$this->_basePath.'/'.$dir);
- return $this->_baseUrl.'/'.$dir;
+ $this->_published[$path]=$this->_baseUrl.'/'.$dir;
+ return $this->_published[$path];
}
}