Beispiel #1
0
 public function testReadStream()
 {
     $dir = OC::$SERVERROOT . '/tests/data';
     $this->instance = $this->getExisting();
     $fh = $this->instance->getStream('lorem.txt', 'r');
     $this->assertTrue((bool) $fh);
     $content = fread($fh, $this->instance->filesize('lorem.txt'));
     fclose($fh);
     $this->assertEquals(file_get_contents($dir . '/lorem.txt'), $content);
 }
Beispiel #2
0
 public function stat($path)
 {
     $ctime = filectime($this->path);
     $path = $this->stripPath($path);
     if ($path == '') {
         $stat = stat($this->path);
     } else {
         if ($this->is_dir($path)) {
             $stat = array('size' => 0);
             $stat['mtime'] = filemtime($this->path);
         } else {
             $stat = array();
             $stat['mtime'] = $this->archive->mtime($path);
             $stat['size'] = $this->archive->filesize($path);
         }
     }
     $stat['ctime'] = $ctime;
     return $stat;
 }