Avoid using trigger_error() in addMissingMetadata()
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Jul 2015 20:28:48 +0000 (13:28 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Jul 2015 20:29:10 +0000 (20:29 +0000)
* Just use the normal swift log instead

Bug: T105810
Change-Id: Ifa463e6298a1b57ab6a8d92f9defc744619d9fb6

includes/filebackend/SwiftFileBackend.php

index 9bae2ae..2ccafe4 100644 (file)
@@ -666,8 +666,9 @@ class SwiftFileBackend extends FileBackendStore {
                        return $objHdrs; // nothing to do
                }
 
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" );
-               trigger_error( "$path was not stored with SHA-1 metadata.", E_USER_WARNING );
+               wfDebugLog( 'SwiftBackend', __METHOD__ . ": $path was not stored with SHA-1 metadata." );
 
                $auth = $this->getAuthentication();
                if ( !$auth ) {
@@ -677,6 +678,7 @@ class SwiftFileBackend extends FileBackendStore {
                }
 
                $status = Status::newGood();
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scopeLockS = $this->getScopedFileLocks( array( $path ), LockManager::LOCK_UW, $status );
                if ( $status->isOK() ) {
                        $tmpFile = $this->getLocalCopy( array( 'src' => $path, 'latest' => 1 ) );
@@ -696,7 +698,8 @@ class SwiftFileBackend extends FileBackendStore {
                                }
                        }
                }
-               trigger_error( "Unable to set SHA-1 metadata for $path", E_USER_WARNING );
+
+               wfDebugLog( 'SwiftBackend', __METHOD__ . ": unable to set SHA-1 metadata for $path" );
                $objHdrs['x-object-meta-sha1base36'] = false;
 
                return $objHdrs; // failed