public function getContent() { /* @var $pwe PWECore */ $pwe = $this->config->getPWE(); $dlCtrl = new FileDownloads($pwe); return $dlCtrl->getFileBlock($this->wikiContentArr[0], $this->wikiContentArr[1]); }
public function getContent() { if ($this->config instanceof PWEConnected) { /* @var $pwe PWECore */ $pwe = $this->config->getPWE(); $dlCtrl = new FileDownloads($pwe); return $dlCtrl->getDirectoryBlock($this->wikiContentArr[0]); } else { throw new RuntimeException("Not applicable"); } }
public function test_directory_sorted() { $pwe = new UnitTestPWECore(); $pwe->setURL('/'); $tmp = $pwe->getTempDirectory(); $pwe->setRootDirectory($tmp); $pwe->setTempDirectory($tmp); PWELogger::info("Create dir " . $tmp); file_put_contents($tmp . '/first', time()); file_put_contents($tmp . '/second', time()); PWELogger::debug("File 1 " . file_get_contents($tmp . '/first')); PWELogger::debug("File 2 " . file_get_contents($tmp . '/second')); $node =& $pwe->getNode(); $node['!a']['files_base'] = '.'; $obj = new FileDownloads($pwe); $res = $obj->getDirectoryBlock('.'); PWELogger::debug("DIR: " . $res); $this->assertGreaterThan(strpos($res, 'second'), strpos($res, 'first')); }