Merge "tests: Fix broken assertion in ApiQueryAllPagesTest"
[lhc/web/wiklou.git] / includes / libs / filebackend / FileBackendStore.php
index f2c07e8..ffb8793 100644 (file)
@@ -1396,12 +1396,12 @@ abstract class FileBackendStore extends FileBackend {
                        }
                }
 
-               $res = $this->doExecuteOpHandlesInternal( $fileOpHandles );
+               $statuses = $this->doExecuteOpHandlesInternal( $fileOpHandles );
                foreach ( $fileOpHandles as $fileOpHandle ) {
                        $fileOpHandle->closeResources();
                }
 
-               return $res;
+               return $statuses;
        }
 
        /**
@@ -1440,7 +1440,10 @@ abstract class FileBackendStore extends FileBackend {
                                $name = strtolower( $name );
                                $maxHVLen = in_array( $name, $longs ) ? INF : 255;
                                if ( strlen( $name ) > 255 || strlen( $value ) > $maxHVLen ) {
-                                       trigger_error( "Header '$name: $value' is too long." );
+                                       $this->logger->error( "Header '{header}' is too long.", [
+                                               'filebackend' => $this->name,
+                                               'header' => "$name: $value",
+                                       ] );
                                } else {
                                        $newHeaders[$name] = strlen( $value ) ? $value : ''; // null/false => ""
                                }
@@ -1587,7 +1590,7 @@ abstract class FileBackendStore extends FileBackend {
                                // Validate and sanitize the relative path (backend-specific)
                                $relPath = $this->resolveContainerPath( $shortCont, $relPath );
                                if ( $relPath !== null ) {
-                                       // Prepend any wiki ID prefix to the container name
+                                       // Prepend any domain ID prefix to the container name
                                        $container = $this->fullContainerName( $shortCont );
                                        if ( self::isValidContainerName( $container ) ) {
                                                // Validate and sanitize the container name (backend-specific)
@@ -1722,7 +1725,7 @@ abstract class FileBackendStore extends FileBackend {
        }
 
        /**
-        * Get the full container name, including the wiki ID prefix
+        * Get the full container name, including the domain ID prefix
         *
         * @param string $container
         * @return string
@@ -1789,7 +1792,9 @@ abstract class FileBackendStore extends FileBackend {
         */
        final protected function deleteContainerCache( $container ) {
                if ( !$this->memCache->delete( $this->containerCacheKey( $container ), 300 ) ) {
-                       trigger_error( "Unable to delete stat cache for container $container." );
+                       $this->logger->warning( "Unable to delete stat cache for container {container}.",
+                               [ 'filebackend' => $this->name, 'container' => $container ]
+                       );
                }
        }
 
@@ -1887,7 +1892,9 @@ abstract class FileBackendStore extends FileBackend {
                        return; // invalid storage path
                }
                if ( !$this->memCache->delete( $this->fileCacheKey( $path ), 300 ) ) {
-                       trigger_error( "Unable to delete stat cache for file $path." );
+                       $this->logger->warning( "Unable to delete stat cache for file {path}.",
+                               [ 'filebackend' => $this->name, 'path' => $path ]
+                       );
                }
        }