예제 #1
0
 /**
  * @see FileBackendStore::streamFile()
  * @param array $params
  * @return StatusValue
  */
 protected function doStreamFile(array $params)
 {
     $status = $this->newStatus();
     $flags = 0;
     $flags |= !empty($params['headless']) ? HTTPFileStreamer::STREAM_HEADLESS : 0;
     $flags |= !empty($params['allowOB']) ? HTTPFileStreamer::STREAM_ALLOW_OB : 0;
     $fsFile = $this->getLocalReference($params);
     if ($fsFile) {
         $streamer = new HTTPFileStreamer($fsFile->getPath(), ['obResetFunc' => $this->obResetFunc, 'streamMimeFunc' => $this->streamMimeFunc]);
         $res = $streamer->stream($params['headers'], true, $params['options'], $flags);
     } else {
         $res = false;
         HTTPFileStreamer::send404Message($params['src'], $flags);
     }
     if (!$res) {
         $status->fatal('backend-fail-stream', $params['src']);
     }
     return $status;
 }
예제 #2
0
 /**
  * Send out a standard 404 message for a file
  *
  * @param string $fname Full name and path of the file to stream
  * @param integer $flags Bitfield of STREAM_* constants
  * @since 1.24
  */
 public static function send404Message($fname, $flags = 0)
 {
     HTTPFileStreamer::send404Message($fname, $flags);
 }