Merge "Fix CodeSniffer errors and warnings"
[lhc/web/wiklou.git] / includes / filebackend / SwiftFileBackend.php
index d6bbfbe..c3d2de8 100644 (file)
@@ -275,7 +275,7 @@ class SwiftFileBackend extends FileBackendStore {
                $sha1Hash = wfBaseConvert( $sha1Hash, 16, 36, 31 );
                $contentType = $this->getContentType( $params['dst'], null, $params['src'] );
 
-               $handle = fopen( $params['src'], 'rb+' );
+               $handle = fopen( $params['src'], 'rb' );
                if ( $handle === false ) { // source doesn't exist?
                        $status->fatal( 'backend-fail-store', $params['src'], $params['dst'] );
 
@@ -1218,7 +1218,8 @@ class SwiftFileBackend extends FileBackendStore {
                }
 
                // Run all requests for the first stage, then the next, and so on
-               for ( $stage = 0; $stage < count( $httpReqsByStage ); ++$stage ) {
+               $reqCount = count( $httpReqsByStage );
+               for ( $stage = 0; $stage < $reqCount; ++$stage ) {
                        $httpReqs = $this->http->runMulti( $httpReqsByStage[$stage] );
                        foreach ( $httpReqs as $index => $httpReq ) {
                                // Run the callback for each request of this operation