From bc1a7e1e3a67537189d30013ea6d5fa4bf98e8e4 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 19 Nov 2005 02:42:35 +0000 Subject: --- framework/Web/TAssetManager.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'framework/Web/TAssetManager.php') diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php index b48fed79..fa9e649e 100644 --- a/framework/Web/TAssetManager.php +++ b/framework/Web/TAssetManager.php @@ -29,6 +29,13 @@ * with the function {@link publishFilePath}. This is usually * very useful during development. * + * TAssetManager may be configured in application configuration file within + * page service element as follows, + * + * where {@link getBasePath BasePath} and {@link getBaseUrl BaseUrl} are + * configurable properties of TAssetManager. Make sure that BasePath is a namespace + * pointing to a valid directory writable by the Web server process. + * * @author Qiang Xue * @version $Revision: $ $Date: $ * @package System.Web @@ -104,6 +111,8 @@ class TAssetManager extends TComponent implements IModule } /** + * Sets the root directory storing published asset files. + * The directory must be in namespace format. * @param string the root directory storing published asset files * @throws TInvalidOperationException if the service is initialized already */ @@ -111,8 +120,12 @@ class TAssetManager extends TComponent implements IModule { if($this->_initialized) throw new TInvalidOperationException('assetmanager_basepath_unchangeable'); - else if(($this->_basePath=realpath($value))===false) - throw new TInvalidDataValueException('assetmanage_basepath_invalid',$value); + else + { + $this->_basePath=Prado::getPathOfAlias($value); + if($this->_basePath===null || !is_dir($this->_basePath) || !is_writable($this->_basePath)) + throw new TInvalidDataValueException('assetmanage_basepath_invalid',$value); + } } /** -- cgit v1.2.3