summaryrefslogtreecommitdiff
path: root/framework/Web/TAssetManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/TAssetManager.php')
-rw-r--r--framework/Web/TAssetManager.php36
1 files changed, 9 insertions, 27 deletions
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index 3b2131a5..b48fed79 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -23,11 +23,11 @@
* the URL for accessing the base path.
*
* By default, TAssetManager will not publish a file or directory if it already
- * exists in the publishing directory. You may require a timestamp checking by
- * setting CheckTimestamp to true (which is false by default). You may also require
- * so when calling {@link publishFilePath}. This is usually
- * very useful during development. In production sites, the timestamp checking
- * should be turned off to improve performance.
+ * exists in the publishing directory and has an older modification time.
+ * If the application mode is set as 'Performance', the modification time check
+ * will be skipped. You can explicitly require a modification time check
+ * with the function {@link publishFilePath}. This is usually
+ * very useful during development.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
@@ -56,6 +56,9 @@ class TAssetManager extends TComponent implements IModule
* @var boolean whether to use timestamp checking to ensure files are published with up-to-date versions.
*/
private $_checkTimestamp=false;
+ /**
+ * @var TApplication application instance
+ */
private $_application;
/**
@@ -108,9 +111,7 @@ class TAssetManager extends TComponent implements IModule
{
if($this->_initialized)
throw new TInvalidOperationException('assetmanager_basepath_unchangeable');
- else if(is_dir($value))
- $this->_basePath=realpath($value);
- else
+ else if(($this->_basePath=realpath($value))===false)
throw new TInvalidDataValueException('assetmanage_basepath_invalid',$value);
}
@@ -135,25 +136,6 @@ class TAssetManager extends TComponent implements IModule
}
/**
- * @return boolean whether file modify time should be used to ensure a published file is latest. Defaults to false.
- */
- public function getCheckTimestamp()
- {
- return $this->_checkTimestamp;
- }
-
- /**
- * @param boolean whether file modify time should be used to ensure a published file is latest. Defaults to false.
- */
- public function setCheckTimestamp($value)
- {
- if($this->_initialized)
- throw new TInvalidOperationException('pageservice_checktimestamp_unchangeable');
- else
- $this->_checkTimestamp=TPropertyValue::ensureBoolean($value);
- }
-
- /**
* Publishes a file or a directory (recursively).
* This method will copy the content in a directory (recursively) to
* a web accessible directory and returns the URL for the directory.