Esempio n. 1
0
 function open()
 {
     if (!$this->is_open()) {
         parent::open();
         if (file_exists($this->path) && is_file($this->path)) {
             $this->fd = fopen($this->path, 'r+');
         } else {
             if (!file_exists($this->path)) {
                 $this->fd = fopen($this->path, 'x+');
             }
         }
         if ($this->mode & READ) {
             $this->contents = file_get_contents_emulate($this->path);
             $this->lines = explode("\n", $this->contents);
         }
     }
 }
Esempio n. 2
0
 function open()
 {
     parent::open();
     $this->files = $this->folders = array();
     if ($dh = @opendir($this->path)) {
         while (!is_bool($fse_name = readdir($dh))) {
             if ($fse_name == '.' || $fse_name == '..') {
                 continue;
             }
             if (is_file($this->path . '/' . $fse_name)) {
                 $this->files[] = new File($this->path . '/' . $fse_name);
             } else {
                 $this->folders[] = new Folder($this->path . '/' . $fse_name);
             }
         }
         closedir($dh);
     }
 }