Output more MW version info in update.php
[lhc/web/wiklou.git] / includes / ForeignResourceManager.php
index 9fd1e4f..80a12fe 100644 (file)
@@ -19,6 +19,8 @@
  * @ingroup Maintenance
  */
 
+use Wikimedia\AtEase\AtEase;
+
 /**
  * Manage foreign resources registered with ResourceLoader.
  *
@@ -150,7 +152,7 @@ class ForeignResourceManager {
 
        /** @return string|false */
        private function cacheGet( $key ) {
-               return Wikimedia\quietCall( 'file_get_contents', "{$this->cacheDir}/$key.data" );
+               return AtEase::quietCall( 'file_get_contents', "{$this->cacheDir}/$key.data" );
        }
 
        private function cacheSet( $key, $data ) {
@@ -178,15 +180,13 @@ class ForeignResourceManager {
                if ( $integrity === $actualIntegrity ) {
                        $this->verbose( "... passed integrity check for {$src}\n" );
                        $this->cacheSet( $key, $data );
+               } elseif ( $this->action === 'make-sri' ) {
+                       $this->output( "Integrity for {$src}\n\tintegrity: ${actualIntegrity}\n" );
                } else {
-                       if ( $this->action === 'make-sri' ) {
-                               $this->output( "Integrity for {$src}\n\tintegrity: ${actualIntegrity}\n" );
-                       } else {
-                               throw new Exception( "Integrity check failed for {$src}\n" .
-                                       "\tExpected: {$integrity}\n" .
-                                       "\tActual: {$actualIntegrity}"
-                               );
-                       }
+                       throw new Exception( "Integrity check failed for {$src}\n" .
+                               "\tExpected: {$integrity}\n" .
+                               "\tActual: {$actualIntegrity}"
+                       );
                }
                return $data;
        }