summaryrefslogtreecommitdiff
path: root/framework/Web/TAssetManager.php
diff options
context:
space:
mode:
authorxue <>2005-11-19 02:42:35 +0000
committerxue <>2005-11-19 02:42:35 +0000
commitbc1a7e1e3a67537189d30013ea6d5fa4bf98e8e4 (patch)
treecf4505fc457292ed5499b16d2412bd00ab14a0bd /framework/Web/TAssetManager.php
parentc2b0b3123d351e1ec96203eb099e35c6d5c6bdc9 (diff)
Diffstat (limited to 'framework/Web/TAssetManager.php')
-rw-r--r--framework/Web/TAssetManager.php17
1 files changed, 15 insertions, 2 deletions
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,
+ * <module id="asset" BasePath="Application.assets" BaseUrl="/assets" />
+ * 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 <qiang.xue@gmail.com>
* @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);
+ }
}
/**