(bug 36776) Changing User::getNewtalk to use $wgDisableAnonTalk.
[lhc/web/wiklou.git] / maintenance / copyFileBackend.php
index 548a33b..498bc6b 100644 (file)
@@ -90,6 +90,8 @@ class CopyFileBackend extends Maintenance {
                                // Only copy the missing files over in the next loop
                                $srcPathsRel = array_diff( $relFilesSrc, $relFilesDst );
                                $this->output( count( $srcPathsRel ) . " file(s) need to be copied.\n" );
+                               unset( $relFilesSrc );
+                               unset( $relFilesDst );
                        }
 
                        $batchPaths = array();
@@ -141,7 +143,7 @@ class CopyFileBackend extends Maintenance {
                        }
                        $fsFiles[] = $fsFile; // keep TempFSFile objects alive as needed
                        // Note: prepare() is usually fast for key/value backends
-                       $status = $dst->prepare( array( 'dir' => dirname( $dstPath ) ) );
+                       $status = $dst->prepare( array( 'dir' => dirname( $dstPath ), 'bypassReadOnly' => 1 ) );
                        if ( !$status->isOK() ) {
                                $this->error( print_r( $status->getErrorsArray(), true ) );
                                $this->error( "Could not copy $srcPath to $dstPath.", 1 ); // die
@@ -152,10 +154,10 @@ class CopyFileBackend extends Maintenance {
                }
 
                $t_start = microtime( true );
-               $status = $dst->doQuickOperations( $ops );
+               $status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) );
                if ( !$status->isOK() ) {
                        sleep( 10 ); // wait and retry copy again
-                       $status = $dst->doQuickOperations( $ops );
+                       $status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) );
                }
                $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
                if ( !$status->isOK() ) {