summaryrefslogtreecommitdiff
path: root/inc/io.php
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-15 22:47:35 +0200
committerandi <andi@splitbrain.org>2005-04-15 22:47:35 +0200
commitb625487d2258a6f1f875813206adc9a5857dab24 (patch)
treed58871efbfeb198ad4634add0e496b5cb890b655 /inc/io.php
parent4826ab45befb9eb1c664b5d8c8a0f03a7b750b8b (diff)
downloadrpg-b625487d2258a6f1f875813206adc9a5857dab24.tar.gz
rpg-b625487d2258a6f1f875813206adc9a5857dab24.tar.bz2
new parser: more hacking, RSS readded
darcs-hash:20050415204735-9977f-613d9b007452d538dcb8fce4ade5cbec389c4415.gz
Diffstat (limited to 'inc/io.php')
-rw-r--r--inc/io.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/inc/io.php b/inc/io.php
index 81247a590..b0b834f9d 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -201,6 +201,28 @@ function io_mkdir_ftp($dir){
}
/**
+ * downloads a file from the net and saves it to the given location
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @todo Add size limit
+ */
+function io_download($url,$file){
+ $fp = @fopen($url,"rb");
+ if(!$fp) return false;
+
+ while(!feof($fp)){
+ $cont.= fread($fp,1024);
+ }
+ fclose($fp);
+
+ $fp2 = @fopen($file,"w");
+ if(!$fp2) return false;
+ fwrite($fp2,$cont);
+ fclose($fp2);
+ return true;
+}
+
+/**
* Runs an external command and returns it's output as string
*
* @author Harry Brueckner <harry_b@eml.cc>