Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git] / includes / StreamFile.php
index a7522ea..8d0b8f1 100644 (file)
@@ -38,15 +38,15 @@ class StreamFile {
         * @throws MWException
         * @return bool Success
         */
-       public static function stream( $fname, $headers = array(), $sendErrors = true ) {
+       public static function stream( $fname, $headers = [], $sendErrors = true ) {
 
                if ( FileBackend::isStoragePath( $fname ) ) { // sanity
                        throw new MWException( __FUNCTION__ . " given storage path '$fname'." );
                }
 
-               wfSuppressWarnings();
+               MediaWiki\suppressWarnings();
                $stat = stat( $fname );
-               wfRestoreWarnings();
+               MediaWiki\restoreWarnings();
 
                $res = self::prepareForStream( $fname, $stat, $headers, $sendErrors );
                if ( $res == self::NOT_MODIFIED ) {
@@ -74,11 +74,11 @@ class StreamFile {
         * @return int|bool READY_STREAM, NOT_MODIFIED, or false on failure
         */
        public static function prepareForStream(
-               $path, $info, $headers = array(), $sendErrors = true
+               $path, $info, $headers = [], $sendErrors = true
        ) {
                if ( !is_array( $info ) ) {
                        if ( $sendErrors ) {
-                               HttpStatus::header( 404  );
+                               HttpStatus::header( 404 );
                                header( 'Cache-Control: no-cache' );
                                header( 'Content-Type: text/html; charset=utf-8' );
                                $encFile = htmlspecialchars( $path );