Exemplo n.º 1
0
 /**
  * Sends the contents of $filePath to default output
  *
  * @param string $filePath File path
  * @param int $startOffset Starting offset
  * @param bool|int $length Length to transmit, false means everything
  * @return bool true, or false if operation failed
  */
 public function passthrough($filePath, $startOffset = 0, $length = false)
 {
     return eZFile::downloadContent($this->makeDFSPath($filePath), $startOffset, $length);
 }
 /**
  * Outputs file contents to the browser
  * Note: does not handle headers. eZFile::downloadHeaders() can be used for this
  *
  * @param int $offset Transfer start offset
  * @param int $length Transfer length, in bytes
  */
 function passthrough($offset = 0, $length = false)
 {
     eZDebugSetting::writeDebug('kernel-clustering', "fs::passthrough( '{$this->filePath}' )", __METHOD__);
     eZDebug::accumulatorStart('dbfile', false, 'dbfile');
     eZFile::downloadContent($this->filePath, $offset, $length);
     eZDebug::accumulatorStop('dbfile');
 }
Exemplo n.º 3
0
 public function testDownloadNoFile()
 {
     ob_start();
     $this->assertFalse(eZFile::downloadContent("unexisting.txt"));
     $this->assertEquals("", ob_get_clean());
 }