diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-01 15:25:00 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-01 15:25:00 +0100 |
commit | a69d3c3346b7b254e3e0ab6766f40842a4ad3878 (patch) | |
tree | 51db578eb892b87099b65c38abc11891a257020c /lib/filecache.php | |
parent | 12681e92b06aaea79a2004a2bf078f4e7fb62a13 (diff) | |
download | nextcloud-server-a69d3c3346b7b254e3e0ab6766f40842a4ad3878.tar.gz nextcloud-server-a69d3c3346b7b254e3e0ab6766f40842a4ad3878.zip |
only show what folder we are scanning to save bandwith
Diffstat (limited to 'lib/filecache.php')
-rw-r--r-- | lib/filecache.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/filecache.php b/lib/filecache.php index b4cafe8b311..a67ac669a76 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -303,7 +303,7 @@ class OC_FileCache{ * @param bool $onlyChilds * @param OC_EventSource $enventSource */ - public static function scan($path,$onlyChilds,$eventSource){ + public static function scan($path,$onlyChilds=false,$eventSource=false,&$count=0){ $dh=OC_Filesystem::opendir($path); $stat=OC_Filesystem::stat($path); $mimetype=OC_Filesystem::getMimeType($path); @@ -319,15 +319,16 @@ class OC_FileCache{ if($filename != '.' and $filename != '..'){ $file=$path.'/'.$filename; if(OC_Filesystem::is_dir($file)){ - self::scan($file,true,$eventSource); + if($eventSource){ + $eventSource->send('scanning',array('file'=>$file,'count'=>$count)); + } + self::scan($file,true,$eventSource,$count); }else{ $stat=OC_Filesystem::stat($file); $mimetype=OC_Filesystem::getMimeType($file); $stat['mimetype']=$mimetype; self::put($file,$stat); - if($eventSource){ - $eventSource->send('scanned',$file); - } + $count++; $totalSize+=$stat['size']; } } |