diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-15 20:19:48 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-21 20:48:48 +0100 |
commit | 325858e9e239b726a207ac150404863df509935c (patch) | |
tree | 7f2480657001a03a2ac5d6ae3120886a9a025b5e /lib/fakedirstream.php | |
parent | c121a1a1e7d9ae554005b8438d8ad999cdacc601 (diff) | |
download | nextcloud-server-325858e9e239b726a207ac150404863df509935c.tar.gz nextcloud-server-325858e9e239b726a207ac150404863df509935c.zip |
add stream wrapper for in-memory files and dont use global variables for the fakedir stream wrapper
Diffstat (limited to 'lib/fakedirstream.php')
-rw-r--r-- | lib/fakedirstream.php | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/fakedirstream.php b/lib/fakedirstream.php deleted file mode 100644 index fa3e64da62c..00000000000 --- a/lib/fakedirstream.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -global $FAKEDIRS; -$FAKEDIRS=array(); - -class fakeDirStream{ - private $name; - private $data; - private $index; - - public function dir_opendir($path,$options){ - global $FAKEDIRS; - $url=parse_url($path); - $this->name=substr($path,strlen('fakedir://')); - $this->index=0; - if(isset($FAKEDIRS[$this->name])){ - $this->data=$FAKEDIRS[$this->name]; - }else{ - $this->data=array(); - } - return true; - } - - public function dir_readdir(){ - if($this->index>=count($this->data)){ - return false; - } - $filename=$this->data[$this->index]; - $this->index++; - return $filename; - } - - public function dir_closedir() { - $this->data=false; - $this->name=''; - return true; - } - - public function dir_rewinddir() { - $this->index=0; - return true; - } -} - -stream_wrapper_register("fakedir", "fakeDirStream"); - |