summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TAssetManager.php
diff options
context:
space:
mode:
authorxue <>2005-12-28 20:17:54 +0000
committerxue <>2005-12-28 20:17:54 +0000
commite8b60312037e54c34a06d6f57d7c21946cf3cd1f (patch)
treea6f35f5d4bb921998ca306602a33fc03ba47c4b5 /framework/Web/UI/TAssetManager.php
parent930c51a6d618d487105cd46c517f36c3b1fe3b44 (diff)
Modified the way to access application singleton.
IService and IModule interfaces are also adjusted accordingly.
Diffstat (limited to 'framework/Web/UI/TAssetManager.php')
-rw-r--r--framework/Web/UI/TAssetManager.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/framework/Web/UI/TAssetManager.php b/framework/Web/UI/TAssetManager.php
index f9a9dcb8..d15e4788 100644
--- a/framework/Web/UI/TAssetManager.php
+++ b/framework/Web/UI/TAssetManager.php
@@ -71,14 +71,13 @@ class TAssetManager extends TModule
/**
* Initializes the module.
* This method is required by IModule and is invoked by application.
- * @param TApplication application
* @param TXmlElement module configuration
*/
- public function init($application,$config)
+ public function init($config=null)
{
- parent::init($application,$config);
+ parent::init($config);
- $this->_application=$application;
+ $application=$this->getApplication();
if($this->_basePath===null)
$this->_basePath=dirname($application->getRequest()->getPhysicalApplicationPath()).'/'.self::DEFAULT_BASEPATH;
if(!is_writable($this->_basePath) || !is_dir($this->_basePath))
@@ -152,7 +151,7 @@ class TAssetManager extends TModule
{
$dir=$this->hash(dirname($fullpath));
$file=$this->_basePath.'/'.$dir.'/'.basename($fullpath);
- if(!is_file($file) || $checkTimestamp || $this->_application->getMode()!==TApplication::STATE_PERFORMANCE)
+ if(!is_file($file) || $checkTimestamp || $this->getApplication()->getMode()!==TApplication::STATE_PERFORMANCE)
{
if(!is_dir($this->_basePath.'/'.$dir))
@mkdir($this->_basePath.'/'.$dir);
@@ -165,7 +164,7 @@ class TAssetManager extends TModule
else
{
$dir=$this->hash($fullpath);
- if(!is_dir($this->_basePath.'/'.$dir) || $checkTimestamp || $this->_application->getMode()!==TApplication::STATE_PERFORMANCE)
+ if(!is_dir($this->_basePath.'/'.$dir) || $checkTimestamp || $this->getApplication()->getMode()!==TApplication::STATE_PERFORMANCE)
$this->copyDirectory($fullpath,$this->_basePath.'/'.$dir);
$this->_published[$path]=$this->_baseUrl.'/'.$dir;
return $this->_published[$path];