Merge "Add config for serving main Page from the domain root"
[lhc/web/wiklou.git] / maintenance / copyFileBackend.php
index 1142325..9e36742 100644 (file)
@@ -260,7 +260,7 @@ class CopyFileBackend extends Maintenance {
                        // Note: prepare() is usually fast for key/value backends
                        $status = $dst->prepare( [ 'dir' => dirname( $dstPath ), 'bypassReadOnly' => 1 ] );
                        if ( !$status->isOK() ) {
-                               $this->error( print_r( Status::wrap( $status )->getWikiText(), true ) );
+                               $this->error( Status::wrap( $status )->getMessage( false, false, 'en' )->text() );
                                $this->fatalError( "$domainId: Could not copy $srcPath to $dstPath." );
                        }
                        $ops[] = [ 'op' => 'store',
@@ -277,7 +277,7 @@ class CopyFileBackend extends Maintenance {
                }
                $elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
                if ( !$status->isOK() ) {
-                       $this->error( print_r( Status::wrap( $status )->getWikiText(), true ) );
+                       $this->error( Status::wrap( $status )->getMessage( false, false, 'en' )->text() );
                        $this->fatalError( "$domainId: Could not copy file batch." );
                } elseif ( count( $copiedRel ) ) {
                        $this->output( "\n\tCopied these file(s) [{$elapsed_ms}ms]:\n\t" .
@@ -314,7 +314,7 @@ class CopyFileBackend extends Maintenance {
                }
                $elapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
                if ( !$status->isOK() ) {
-                       $this->error( print_r( Status::wrap( $status )->getWikiText(), true ) );
+                       $this->error( Status::wrap( $status )->getMessage( false, false, 'en' )->text() );
                        $this->fatalError( "$domainId: Could not delete file batch." );
                } elseif ( count( $deletedRel ) ) {
                        $this->output( "\n\tDeleted these file(s) [{$elapsed_ms}ms]:\n\t" .
@@ -358,6 +358,7 @@ class CopyFileBackend extends Maintenance {
                        // backends in FileBackendMultiWrite (since they get writes second, they have
                        // higher timestamps). However, when copying the other way, this hits loads of
                        // false positives (possibly 100%) and wastes a bunch of time on GETs/PUTs.
+                       // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                        $same = ( $srcStat['mtime'] <= $dstStat['mtime'] );
                } else {
                        // This is the slowest method which does many per-file HEADs (unless an object