aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-27 12:04:04 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-27 12:04:42 +0100
commitcef230c141897f587dd732860cca6568fd6edc2c (patch)
tree7e112628dd41a985477f3aadd59a658ad4c6e913 /lib/helper.php
parent4eb9a69bd87f5118dbbef1df2988916b42b1139b (diff)
downloadnextcloud-server-cef230c141897f587dd732860cca6568fd6edc2c.tar.gz
nextcloud-server-cef230c141897f587dd732860cca6568fd6edc2c.zip
extend filestorage common and provide test implementation
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php
index 60af4e376b1..525a096947d 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -398,4 +398,21 @@ class OC_Helper {
}
return false;
}
+
+ /**
+ * copy the contents of one stream to another
+ * @param resource source
+ * @param resource target
+ * @return int the number of bytes copied
+ */
+ public static function streamCopy($source,$target){
+ if(!$source or !$target){
+ return false;
+ }
+ $count=0;
+ while(!feof($source)){
+ $count+=fwrite($target,fread($source,8192));
+ }
+ return $count;
+ }
}