From bab3222907764537687d0ca1cc717e33fb9acd9c Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Thu, 18 Apr 2013 15:29:30 -0400 Subject: [PATCH] Added doc. --- framework/web/AssetBundle.php | 7 ++++++- framework/web/AssetManager.php | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/framework/web/AssetBundle.php b/framework/web/AssetBundle.php index 5b04637..76d901f 100644 --- a/framework/web/AssetBundle.php +++ b/framework/web/AssetBundle.php @@ -85,6 +85,11 @@ class AssetBundle extends Object * @var array list of the bundle names that this bundle depends on */ public $depends = array(); + /** + * @var array the options to be passed to [[AssetManager::publish()]] when the asset bundle + * is being published. + */ + public $publishOption = array(); /** * Initializes the bundle. @@ -114,7 +119,7 @@ class AssetBundle extends Object } if ($this->sourcePath !== null) { - list ($this->basePath, $this->baseUrl) = $am->publish($this->sourcePath); + list ($this->basePath, $this->baseUrl) = $am->publish($this->sourcePath, $this->publishOption); } foreach ($this->js as $js => $options) { diff --git a/framework/web/AssetManager.php b/framework/web/AssetManager.php index 9f01173..5375d08 100644 --- a/framework/web/AssetManager.php +++ b/framework/web/AssetManager.php @@ -164,6 +164,10 @@ class AssetManager extends Component * Note, in case $forceCopy is false the method only checks the existence of the target * directory to avoid repetitive copying (which is very expensive). * + * By default, when publishing a directory, subdirectories and files whose name starts with a dot "." + * will NOT be published. If you want to change this behavior, you may specify the "beforeCopy" option + * as explained in the `$options` parameter. + * * Note: On rare scenario, a race condition can develop that will lead to a * one-time-manifestation of a non-critical problem in the creation of the directory * that holds the published assets. This problem can be avoided altogether by 'requesting'