summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorknut <>2007-06-18 20:25:38 +0000
committerknut <>2007-06-18 20:25:38 +0000
commit840d142703025927bd2fc5ffd70fcf62b0dccb76 (patch)
treec44b5c8d0772bee0463efb1d5c9273b406649945 /framework
parentfe75acc9c6bfc76ce70e5e892cbf59c94f374ac5 (diff)
fixed #654
Diffstat (limited to 'framework')
-rw-r--r--framework/Exceptions/messages.txt1
-rw-r--r--framework/Web/TAssetManager.php24
2 files changed, 15 insertions, 10 deletions
diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt
index da022afe..e2fc5dce 100644
--- a/framework/Exceptions/messages.txt
+++ b/framework/Exceptions/messages.txt
@@ -79,6 +79,7 @@ assetmanager_baseurl_unchangeable = TAssetManager.BaseUrl cannot be modified af
assetmanager_filepath_invalid = TAssetManager is publishing an invalid file '{0}'.
assetmanager_tarchecksum_invalid = TAssetManager is publishing a tar file with invalid checksum '{0}'.
assetmanager_tarfile_invalid = TAssetManager is publishing an invalid tar file '{0}'.
+assetmanager_source_directory_invalid = TAssetManager is copying an invalid directory '{0}'.
cache_primary_duplicated = At most one primary cache module is allowed. {0} is trying to register as another primary cache.
sqlitecache_extension_required = TSqliteCache requires SQLite PHP extension.
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index d0769a0a..c71ea449 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -258,20 +258,24 @@ class TAssetManager extends TModule
@mkdir($dst);
@chmod($dst, PRADO_CHMOD);
}
- $folder=@opendir($src);
- while($file=@readdir($folder))
+ if($folder=@opendir($src))
{
- if($file==='.' || $file==='..' || $file==='.svn')
- continue;
- else if(is_file($src.'/'.$file))
+ while($file=@readdir($folder))
{
- if(@filemtime($dst.'/'.$file)<@filemtime($src.'/'.$file))
- @copy($src.'/'.$file,$dst.'/'.$file);
+ if($file==='.' || $file==='..' || $file==='.svn')
+ continue;
+ else if(is_file($src.'/'.$file))
+ {
+ if(@filemtime($dst.'/'.$file)<@filemtime($src.'/'.$file))
+ @copy($src.'/'.$file,$dst.'/'.$file);
+ }
+ else
+ $this->copyDirectory($src.'/'.$file,$dst.'/'.$file);
}
- else
- $this->copyDirectory($src.'/'.$file,$dst.'/'.$file);
+ closedir($folder);
+ } else {
+ throw new TInvalidDataValueException('assetmanager_source_directory_invalid', $src);
}
- closedir($folder);
}
/**