Merge "filebackend: Use HTTPFileStreamer::send404Message() in caller instead"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 13 Sep 2019 02:33:15 +0000 (02:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 13 Sep 2019 02:33:15 +0000 (02:33 +0000)
includes/StreamFile.php
includes/libs/filebackend/SwiftFileBackend.php

index 04a4ca6..2afd651 100644 (file)
  */
 class StreamFile {
        // Do not send any HTTP headers unless requested by caller (e.g. body only)
+       /** @deprecated since 1.34 */
        const STREAM_HEADLESS = HTTPFileStreamer::STREAM_HEADLESS;
        // Do not try to tear down any PHP output buffers
+       /** @deprecated since 1.34 */
        const STREAM_ALLOW_OB = HTTPFileStreamer::STREAM_ALLOW_OB;
 
        /**
index edea75f..5632d5e 100644 (file)
@@ -1083,11 +1083,11 @@ class SwiftFileBackend extends FileBackendStore {
        protected function doStreamFile( array $params ) {
                $status = $this->newStatus();
 
-               $flags = !empty( $params['headless'] ) ? StreamFile::STREAM_HEADLESS : 0;
+               $flags = !empty( $params['headless'] ) ? HTTPFileStreamer::STREAM_HEADLESS : 0;
 
                list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
                if ( $srcRel === null ) {
-                       StreamFile::send404Message( $params['src'], $flags );
+                       HTTPFileStreamer::send404Message( $params['src'], $flags );
                        $status->fatal( 'backend-fail-invalidpath', $params['src'] );
 
                        return $status;
@@ -1095,7 +1095,7 @@ class SwiftFileBackend extends FileBackendStore {
 
                $auth = $this->getAuthentication();
                if ( !$auth || !is_array( $this->getContainerStat( $srcCont ) ) ) {
-                       StreamFile::send404Message( $params['src'], $flags );
+                       HTTPFileStreamer::send404Message( $params['src'], $flags );
                        $status->fatal( 'backend-fail-stream', $params['src'] );
 
                        return $status;
@@ -1104,7 +1104,7 @@ class SwiftFileBackend extends FileBackendStore {
                // If "headers" is set, we only want to send them if the file is there.
                // Do not bother checking if the file exists if headers are not set though.
                if ( $params['headers'] && !$this->fileExists( $params ) ) {
-                       StreamFile::send404Message( $params['src'], $flags );
+                       HTTPFileStreamer::send404Message( $params['src'], $flags );
                        $status->fatal( 'backend-fail-stream', $params['src'] );
 
                        return $status;