public function testContent() { $this->instance = $this->getExisting(); $dir = OC::$SERVERROOT . '/tests/data'; $textFile = $dir . '/lorem.txt'; $this->assertEquals(file_get_contents($textFile), $this->instance->getFile('lorem.txt')); $tmpFile = OCP\Files::tmpFile('.txt'); $this->instance->extractFile('lorem.txt', $tmpFile); $this->assertEquals(file_get_contents($textFile), file_get_contents($tmpFile)); }
public function touch($path, $mtime = null) { if (is_null($mtime)) { $tmpFile = OCP\Files::tmpFile(); $this->archive->extractFile($path, $tmpFile); $this->archive->addfile($path, $tmpFile); } else { return false; //not supported } }
private function toTmpFile($path) { $tmpFile = \OCP\Files::tmpFile(); $this->archive->extractFile($path, $tmpFile); return $tmpFile; }
private function toTmpFile($path) { $tmpFile = OC_Helper::tmpFile($extension); $this->archive->extractFile($path, $tmpFile); return $tmpFile; }