Update suppressWarning()/restoreWarning() calls
authorReedy <reedy@wikimedia.org>
Sat, 10 Feb 2018 07:52:26 +0000 (07:52 +0000)
committerReedy <reedy@wikimedia.org>
Sat, 10 Feb 2018 08:50:12 +0000 (08:50 +0000)
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f

107 files changed:
includes/GitInfo.php
includes/GlobalFunctions.php
includes/HistoryBlob.php
includes/MediaWiki.php
includes/OutputPage.php
includes/Setup.php
includes/WebRequest.php
includes/api/ApiMain.php
includes/api/ApiQueryImageInfo.php
includes/cache/CacheDependency.php
includes/cache/FileCacheBase.php
includes/cache/localisation/LocalisationCache.php
includes/changes/RecentChange.php
includes/clientpool/SquidPurgeClient.php
includes/clientpool/SquidPurgeClientPool.php
includes/db/DatabaseOracle.php
includes/debug/logger/LegacyLogger.php
includes/exception/MWExceptionHandler.php
includes/filerepo/FileRepo.php
includes/http/CurlHttpRequest.php
includes/import/ImportStreamSource.php
includes/installer/DatabaseInstaller.php
includes/installer/Installer.php
includes/installer/SqliteInstaller.php
includes/libs/CryptRand.php
includes/libs/filebackend/FileBackendStore.php
includes/libs/filebackend/HTTPFileStreamer.php
includes/libs/filebackend/MemoryFileBackend.php
includes/libs/filebackend/SwiftFileBackend.php
includes/libs/filebackend/fileop/StoreFileOp.php
includes/libs/filebackend/fsfile/FSFile.php
includes/libs/filebackend/fsfile/TempFSFile.php
includes/libs/lockmanager/FSLockManager.php
includes/libs/mime/MimeAnalyzer.php
includes/libs/objectcache/MemcachedClient.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMssql.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/xmp/XMP.php
includes/logging/LogEntry.php
includes/mail/UserMailer.php
includes/media/Bitmap.php
includes/media/DjVu.php
includes/media/DjVuImage.php
includes/media/Exif.php
includes/media/ExifBitmap.php
includes/media/GIF.php
includes/media/GIFMetadataExtractor.php
includes/media/IPTC.php
includes/media/ImageHandler.php
includes/media/JpegMetadataExtractor.php
includes/media/MediaHandler.php
includes/media/PNG.php
includes/media/PNGMetadataExtractor.php
includes/media/SVG.php
includes/media/SVGMetadataExtractor.php
includes/media/WebP.php
includes/media/XCF.php
includes/objectcache/SqlBagOStuff.php
includes/parser/Preprocessor_DOM.php
includes/parser/Sanitizer.php
includes/resourceloader/ResourceLoaderModule.php
includes/search/SearchMySQL.php
includes/search/SearchSqlite.php
includes/skins/MediaWikiI18N.php
includes/specials/SpecialExport.php
includes/specials/SpecialLockdb.php
includes/specials/SpecialUnlockdb.php
includes/specials/pagers/ContribsPager.php
includes/specials/pagers/DeletedContribsPager.php
includes/upload/UploadBase.php
includes/utils/ExecutableFinder.php
includes/utils/FileContentsHasher.php
includes/utils/UIDGenerator.php
languages/Language.php
maintenance/Maintenance.php
maintenance/benchmarks/benchmarkJSMinPlus.php
maintenance/dumpTextPass.php
maintenance/install.php
maintenance/jsparse.php
maintenance/language/StatOutputs.php
maintenance/rebuildFileCache.php
maintenance/sqlite.php
maintenance/storage/fixT22757.php
maintenance/storage/recompressTracked.php
tests/parser/ParserTestResultNormalizer.php
tests/parser/fuzzTest.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/CommentStoreTest.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/RevisionDbTestBase.php
tests/phpunit/includes/RevisionTest.php
tests/phpunit/includes/api/ApiErrorFormatterTest.php
tests/phpunit/includes/api/ApiMainTest.php
tests/phpunit/includes/api/ApiUploadTest.php
tests/phpunit/includes/changes/RecentChangeTest.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/phpunit/includes/debug/MWDebugTest.php
tests/phpunit/includes/debug/logger/monolog/AvroFormatterTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/libs/JavaScriptMinifierTest.php
tests/phpunit/includes/session/PHPSessionHandlerTest.php
tests/phpunit/includes/session/SessionTest.php
tests/phpunit/structure/AutoLoaderTest.php
thumb.php

index fb75c25..6270b27 100644 (file)
@@ -306,9 +306,9 @@ class GitInfo {
                        $config = "{$this->basedir}/config";
                        $url = false;
                        if ( is_readable( $config ) ) {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $configArray = parse_ini_file( $config, true );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                                $remote = false;
 
                                // Use the "origin" remote repo if available or any other repo if not.
index a06d721..43428ac 100644 (file)
@@ -877,9 +877,9 @@ function wfParseUrl( $url ) {
        if ( $wasRelative ) {
                $url = "http:$url";
        }
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $bits = parse_url( $url );
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
        // parse_url() returns an array without scheme for some invalid URLs, e.g.
        // parse_url("%0Ahttp://example.com") == [ 'host' => '%0Ahttp', 'path' => 'example.com' ]
        if ( !$bits || !isset( $bits['scheme'] ) ) {
@@ -2009,19 +2009,19 @@ function wfNegotiateType( $cprefs, $sprefs ) {
 /**
  * Reference-counted warning suppression
  *
- * @deprecated since 1.26, use MediaWiki\suppressWarnings() directly
+ * @deprecated since 1.26, use Wikimedia\suppressWarnings() directly
  * @param bool $end
  */
 function wfSuppressWarnings( $end = false ) {
-       MediaWiki\suppressWarnings( $end );
+       Wikimedia\suppressWarnings( $end );
 }
 
 /**
- * @deprecated since 1.26, use MediaWiki\restoreWarnings() directly
+ * @deprecated since 1.26, use Wikimedia\restoreWarnings() directly
  * Restore error level to previous value
  */
 function wfRestoreWarnings() {
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 }
 
 /**
@@ -2150,9 +2150,9 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) {
        }
 
        // Turn off the normal warning, we're doing our own below
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $ok = mkdir( $dir, $mode, true ); // PHP5 <3
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 
        if ( !$ok ) {
                // directory may have been created on another request since we last checked
@@ -2412,9 +2412,9 @@ function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) {
 
        # This check may also protect against code injection in
        # case of broken installations.
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 );
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 
        if ( !$haveDiff3 ) {
                wfDebug( "diff3 not found\n" );
@@ -2496,9 +2496,9 @@ function wfDiff( $before, $after, $params = '-u' ) {
        }
 
        global $wgDiff;
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $haveDiff = $wgDiff && file_exists( $wgDiff );
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 
        # This check may also protect against code injection in
        # case of broken installations.
@@ -3122,15 +3122,15 @@ function wfMemoryLimit() {
                $conflimit = wfShorthandToInteger( $wgMemoryLimit );
                if ( $conflimit == -1 ) {
                        wfDebug( "Removing PHP's memory limit\n" );
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        ini_set( 'memory_limit', $conflimit );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        return $conflimit;
                } elseif ( $conflimit > $memlimit ) {
                        wfDebug( "Raising PHP's memory limit to $conflimit bytes\n" );
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        ini_set( 'memory_limit', $conflimit );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        return $conflimit;
                }
        }
@@ -3283,9 +3283,9 @@ function wfUnpack( $format, $data, $length = false ) {
                }
        }
 
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $result = unpack( $format, $data );
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 
        if ( $result === false ) {
                // If it cannot extract the packed data.
index 26a6d45..1d4f6e4 100644 (file)
@@ -519,9 +519,9 @@ class DiffHistoryBlob implements HistoryBlob {
        function diff( $t1, $t2 ) {
                # Need to do a null concatenation with warnings off, due to bugs in the current version of xdiff
                # "String is not zero-terminated"
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $diff = xdiff_string_rabdiff( $t1, $t2 ) . '';
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                return $diff;
        }
 
@@ -532,9 +532,9 @@ class DiffHistoryBlob implements HistoryBlob {
         */
        function patch( $base, $diff ) {
                if ( function_exists( 'xdiff_string_bpatch' ) ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $text = xdiff_string_bpatch( $base, $diff ) . '';
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        return $text;
                }
 
index 371f2cb..6c932d2 100644 (file)
@@ -1031,7 +1031,7 @@ class MediaWiki {
                        $port = $info['port'];
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $sock = $host ? fsockopen(
                        $host,
                        $port,
@@ -1040,7 +1040,7 @@ class MediaWiki {
                        // If it takes more than 100ms to connect to ourselves there is a problem...
                        0.100
                ) : false;
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $invokedWithSuccess = true;
                if ( $sock ) {
index e6345ba..6b44a55 100644 (file)
@@ -777,9 +777,9 @@ class OutputPage extends ContextSource {
                # this breaks strtotime().
                $clientHeader = preg_replace( '/;.*$/', '', $clientHeader );
 
-               MediaWiki\suppressWarnings(); // E_STRICT system time bitching
+               Wikimedia\suppressWarnings(); // E_STRICT system time bitching
                $clientHeaderTime = strtotime( $clientHeader );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$clientHeaderTime ) {
                        wfDebug( __METHOD__
                                . ": unable to parse the client's If-Modified-Since header: $clientHeader\n" );
index c9fe8d0..0ff2d6c 100644 (file)
@@ -528,9 +528,9 @@ $wgJsMimeType = 'text/javascript';
 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
 
 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 }
 
 if ( $wgNewUserLog ) {
@@ -717,9 +717,9 @@ wfMemoryLimit();
  * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
  */
 if ( is_null( $wgLocaltimezone ) ) {
-       MediaWiki\suppressWarnings();
+       Wikimedia\suppressWarnings();
        $wgLocaltimezone = date_default_timezone_get();
-       MediaWiki\restoreWarnings();
+       Wikimedia\restoreWarnings();
 }
 
 date_default_timezone_set( $wgLocaltimezone );
index 7bfb5a4..0a7f416 100644 (file)
@@ -123,9 +123,9 @@ class WebRequest {
                        if ( !preg_match( '!^https?://!', $url ) ) {
                                $url = 'http://unused' . $url;
                        }
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $a = parse_url( $url );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $a ) {
                                $path = isset( $a['path'] ) ? $a['path'] : '';
 
index 2c2dd9a..1691cab 100644 (file)
@@ -1397,9 +1397,9 @@ class ApiMain extends ApiBase {
                        $this->getRequest()->response()->statusHeader( 304 );
 
                        // Avoid outputting the compressed representation of a zero-length body
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        ini_set( 'zlib.output_compression', 0 );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        wfClearOutputBuffers();
 
                        return false;
index fd456cb..e447f4f 100644 (file)
@@ -542,9 +542,9 @@ class ApiQueryImageInfo extends ApiQueryBase {
                }
 
                if ( $meta ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $metadata = unserialize( $file->getMetadata() );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $metadata && $version !== 'latest' ) {
                                $metadata = $file->convertMetadataVersion( $metadata, $version );
                        }
index 32dc8c0..4ff1004 100644 (file)
@@ -181,11 +181,11 @@ class FileDependency extends CacheDependency {
 
        function loadDependencyValues() {
                if ( is_null( $this->timestamp ) ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        # Dependency on a non-existent file stores "false"
                        # This is a valid concept!
                        $this->timestamp = filemtime( $this->filename );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
        }
 
@@ -193,9 +193,9 @@ class FileDependency extends CacheDependency {
         * @return bool
         */
        function isExpired() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $lastmod = filemtime( $this->filename );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $lastmod === false ) {
                        if ( $this->timestamp === false ) {
                                # Still nonexistent
index f2da08a..ce5a019 100644 (file)
@@ -179,9 +179,9 @@ abstract class FileCacheBase {
         * @return void
         */
        public function clearCache() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                unlink( $this->cachePath() );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                $this->mCached = false;
        }
 
index 26382aa..dd9e8e1 100644 (file)
@@ -517,15 +517,15 @@ class LocalisationCache {
         */
        protected function readPHPFile( $_fileName, $_fileType ) {
                // Disable APC caching
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $_apcEnabled = ini_set( 'apc.cache_by_default', '0' );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                include $_fileName;
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                ini_set( 'apc.cache_by_default', $_apcEnabled );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $_fileType == 'core' || $_fileType == 'extension' ) {
                        $data = compact( self::$allKeys );
index 678e39a..dfaa398 100644 (file)
@@ -1110,9 +1110,9 @@ class RecentChange {
        public function parseParams() {
                $rcParams = $this->getAttribute( 'rc_params' );
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $unserializedParams = unserialize( $rcParams );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return $unserializedParams;
        }
index be802f9..3388860 100644 (file)
@@ -95,9 +95,9 @@ class SquidPurgeClient {
                }
                $this->socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
                socket_set_nonblock( $this->socket );
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $ok = socket_connect( $this->socket, $ip, $this->port );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$ok ) {
                        $error = socket_last_error( $this->socket );
                        if ( $error !== self::EINPROGRESS ) {
@@ -153,12 +153,12 @@ class SquidPurgeClient {
                        } elseif ( IP::isIPv6( $this->host ) ) {
                                throw new MWException( '$wgSquidServers does not support IPv6' );
                        } else {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $this->ip = gethostbyname( $this->host );
                                if ( $this->ip === $this->host ) {
                                        $this->ip = false;
                                }
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                        }
                }
                return $this->ip;
@@ -178,11 +178,11 @@ class SquidPurgeClient {
         */
        public function close() {
                if ( $this->socket ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        socket_set_block( $this->socket );
                        socket_shutdown( $this->socket );
                        socket_close( $this->socket );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
                $this->socket = null;
                $this->readBuffer = '';
@@ -252,9 +252,9 @@ class SquidPurgeClient {
                        $buf = substr( $this->writeBuffer, 0, self::BUFFER_SIZE );
                        $flags = 0;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $bytesSent = socket_send( $socket, $buf, strlen( $buf ), $flags );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $bytesSent === false ) {
                        $error = socket_last_error( $socket );
@@ -278,9 +278,9 @@ class SquidPurgeClient {
                }
 
                $buf = '';
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $bytesRead = socket_recv( $socket, $buf, self::BUFFER_SIZE, 0 );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $bytesRead === false ) {
                        $error = socket_last_error( $socket );
                        if ( $error != self::EAGAIN && $error != self::EINTR ) {
index 7b327d6..f6109f1 100644 (file)
@@ -66,9 +66,9 @@ class SquidPurgeClientPool {
                        }
                        $exceptSockets = null;
                        $timeout = min( $startTime + $this->timeout - microtime( true ), 1 );
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $numReady = socket_select( $readSockets, $writeSockets, $exceptSockets, $timeout );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $numReady === false ) {
                                wfDebugLog( 'squid', __METHOD__ . ': Error in stream_select: ' .
                                        socket_strerror( socket_last_error() ) . "\n" );
index 90fabaf..eb28b30 100644 (file)
@@ -62,9 +62,9 @@ class DatabaseOracle extends Database {
 
        function __destruct() {
                if ( $this->mOpened ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $this->close();
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
        }
 
@@ -128,7 +128,7 @@ class DatabaseOracle extends Database {
 
                $session_mode = $this->mFlags & DBO_SYSDBA ? OCI_SYSDBA : OCI_DEFAULT;
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                if ( $this->mFlags & DBO_PERSISTENT ) {
                        $this->mConn = oci_pconnect(
                                $this->mUser,
@@ -154,7 +154,7 @@ class DatabaseOracle extends Database {
                                $session_mode
                        );
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $this->mUser != $this->mDBname ) {
                        // change current schema in session
@@ -215,7 +215,7 @@ class DatabaseOracle extends Database {
                        $explain_count
                );
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
 
                $this->mLastResult = $stmt = oci_parse( $this->mConn, $sql );
                if ( $stmt === false ) {
@@ -234,7 +234,7 @@ class DatabaseOracle extends Database {
                        }
                }
 
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $explain_count > 0 ) {
                        return $this->doQuery( 'SELECT id, cardinality "ROWS" FROM plan_table ' .
@@ -522,7 +522,7 @@ class DatabaseOracle extends Database {
                        }
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
 
                if ( oci_execute( $stmt, $this->execFlags() ) === false ) {
                        $e = oci_error( $stmt );
@@ -537,7 +537,7 @@ class DatabaseOracle extends Database {
                        $this->mAffectedRows = oci_num_rows( $stmt );
                }
 
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( isset( $lob ) ) {
                        foreach ( $lob as $lob_v ) {
@@ -1047,9 +1047,9 @@ class DatabaseOracle extends Database {
                }
                $sql = 'ALTER SESSION SET CURRENT_SCHEMA=' . strtoupper( $db );
                $stmt = oci_parse( $this->mConn, $sql );
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $success = oci_execute( $stmt );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$success ) {
                        $e = oci_error( $stmt );
                        if ( $e['code'] != '1435' ) {
@@ -1296,7 +1296,7 @@ class DatabaseOracle extends Database {
                        }
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
 
                if ( oci_execute( $stmt, $this->execFlags() ) === false ) {
                        $e = oci_error( $stmt );
@@ -1311,7 +1311,7 @@ class DatabaseOracle extends Database {
                        $this->mAffectedRows = oci_num_rows( $stmt );
                }
 
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( isset( $lob ) ) {
                        foreach ( $lob as $lob_v ) {
index 06ec574..7bd505d 100644 (file)
@@ -467,7 +467,7 @@ class LegacyLogger extends AbstractLogger {
                        $transport = UDPTransport::newFromString( $file );
                        $transport->emit( $text );
                } else {
-                       \MediaWiki\suppressWarnings();
+                       \Wikimedia\suppressWarnings();
                        $exists = file_exists( $file );
                        $size = $exists ? filesize( $file ) : false;
                        if ( !$exists ||
@@ -475,7 +475,7 @@ class LegacyLogger extends AbstractLogger {
                        ) {
                                file_put_contents( $file, $text, FILE_APPEND );
                        }
-                       \MediaWiki\restoreWarnings();
+                       \Wikimedia\restoreWarnings();
                }
        }
 
index b125f58..78a5df9 100644 (file)
@@ -664,7 +664,7 @@ TXT;
                $catcher = self::CAUGHT_BY_HANDLER;
                // The set_error_handler callback is independent from error_reporting.
                // Filter out unwanted errors manually (e.g. when
-               // MediaWiki\suppressWarnings is active).
+               // Wikimedia\suppressWarnings is active).
                $suppressed = ( error_reporting() & $e->getSeverity() ) === 0;
                if ( !$suppressed ) {
                        $logger = LoggerFactory::getInstance( $channel );
index 6b32953..e430bc8 100644 (file)
@@ -1318,9 +1318,9 @@ class FileRepo {
                }
                // Cleanup for disk source files...
                foreach ( $sourceFSFilesToDelete as $file ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        unlink( $file ); // FS cleanup
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
 
                return $status;
index 3da3eb3..44bdddb 100644 (file)
@@ -111,14 +111,14 @@ class CurlHttpRequest extends MWHttpRequest {
                }
 
                if ( $this->followRedirects && $this->canFollowRedirects() ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        if ( !curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) {
                                $this->logger->debug( __METHOD__ . ": Couldn't set CURLOPT_FOLLOWLOCATION. " .
                                        "Probably open_basedir is set.\n" );
                                // Continue the processing. If it were in curl_setopt_array,
                                // processing would have halted on its entry
                        }
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
 
                if ( $this->profiler ) {
index 94a2b93..cf382e4 100644 (file)
@@ -53,9 +53,9 @@ class ImportStreamSource implements ImportSource {
         * @return Status
         */
        static function newFromFile( $filename ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $file = fopen( $filename, 'rt' );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$file ) {
                        return Status::newFatal( "importcantopen" );
                }
index 62acebf..e6ee70e 100644 (file)
@@ -730,10 +730,10 @@ abstract class DatabaseInstaller {
                        return $status;
                }
                global $IP;
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $rows = file( "$IP/maintenance/interwiki.list",
                        FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                $interwikis = [];
                if ( !$rows ) {
                        return Status::newFatal( 'config-install-interwiki-list' );
index 439b370..f22b63d 100644 (file)
@@ -598,9 +598,9 @@ abstract class Installer {
                // phpcs:ignore MediaWiki.VariableAnalysis.UnusedGlobalVariables
                global $wgExtensionDirectory, $wgStyleDirectory;
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $_lsExists = file_exists( "$IP/LocalSettings.php" );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$_lsExists ) {
                        return false;
@@ -805,14 +805,14 @@ abstract class Installer {
         * @return bool
         */
        protected function envCheckPCRE() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $regexd = preg_replace( '/[\x{0430}-\x{04FF}]/iu', '', '-АБВГД-' );
                // Need to check for \p support too, as PCRE can be compiled
                // with utf8 support, but not unicode property support.
                // check that \p{Zs} (space separators) matches
                // U+3000 (Ideographic space)
                $regexprop = preg_replace( '/\p{Zs}/u', '', "-\xE3\x80\x80-" );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $regexd != '--' || $regexprop != '--' ) {
                        $this->showError( 'config-pcre-no-utf8' );
 
@@ -1205,7 +1205,7 @@ abstract class Installer {
 
                // it would be good to check other popular languages here, but it'll be slow.
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
 
                foreach ( $scriptTypes as $ext => $contents ) {
                        foreach ( $contents as $source ) {
@@ -1224,14 +1224,14 @@ abstract class Installer {
                                unlink( $dir . $file );
 
                                if ( $text == 'exec' ) {
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
 
                                        return $ext;
                                }
                        }
                }
 
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return false;
        }
@@ -1700,8 +1700,8 @@ abstract class Installer {
         * Some long-running pages (Install, Upgrade) will want to do this
         */
        protected function disableTimeLimit() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                set_time_limit( 0 );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
        }
 }
index 31718fe..6f16872 100644 (file)
@@ -160,9 +160,9 @@ class SqliteInstaller extends DatabaseInstaller {
                        # Called early on in the installer, later we just want to sanity check
                        # if it's still writable
                        if ( $create ) {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $ok = wfMkdirParents( $dir, 0700, __METHOD__ );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                                if ( !$ok ) {
                                        return Status::newFatal( 'config-sqlite-mkdir-error', $dir );
                                }
index 859d58b..474c564 100644 (file)
@@ -94,9 +94,9 @@ class CryptRand {
                $files[] = dirname( __DIR__ );
 
                foreach ( $files as $file ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $stat = stat( $file );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $stat ) {
                                // stat() duplicates data into numeric and string keys so kill off all the numeric ones
                                foreach ( $stat as $k => $v ) {
@@ -310,9 +310,9 @@ class CryptRand {
                        }
                        // /dev/urandom is generally considered the best possible commonly
                        // available random source, and is available on most *nix systems.
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $urandom = fopen( "/dev/urandom", "rb" );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
 
                        // Attempt to read all our random data from urandom
                        // php's fread always does buffered reads based on the stream's chunk_size
index dba5a1c..06b263a 100644 (file)
@@ -378,9 +378,9 @@ abstract class FileBackendStore extends FileBackend {
                unset( $params['latest'] ); // sanity
 
                // Check that the specified temp file is valid...
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $ok = ( is_file( $tmpPath ) && filesize( $tmpPath ) == 0 );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$ok ) { // not present or not empty
                        $status->fatal( 'backend-fail-opentemp', $tmpPath );
 
@@ -696,9 +696,9 @@ abstract class FileBackendStore extends FileBackend {
        protected function doGetFileContentsMulti( array $params ) {
                $contents = [];
                foreach ( $this->doGetLocalReferenceMulti( $params ) as $path => $fsFile ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $contents[$path] = $fsFile ? file_get_contents( $fsFile->getPath() ) : false;
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
 
                return $contents;
index 9730acb..9f8959c 100644 (file)
@@ -84,9 +84,9 @@ class HTTPFileStreamer {
                                is_int( $header ) ? HttpStatus::header( $header ) : header( $header );
                        };
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $info = stat( $this->path );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !is_array( $info ) ) {
                        if ( $sendErrors ) {
index 0341a2a..548c85c 100644 (file)
@@ -70,9 +70,9 @@ class MemoryFileBackend extends FileBackendStore {
                        return $status;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $data = file_get_contents( $params['src'] );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $data === false ) { // source doesn't exist?
                        $status->fatal( 'backend-fail-store', $params['src'], $params['dst'] );
 
index e606162..bce8334 100644 (file)
@@ -335,9 +335,9 @@ class SwiftFileBackend extends FileBackendStore {
                        return $status;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $sha1Hash = sha1_file( $params['src'] );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $sha1Hash === false ) { // source doesn't exist?
                        $status->fatal( 'backend-fail-store', $params['src'], $params['dst'] );
 
index bba762f..69ae47f 100644 (file)
@@ -77,9 +77,9 @@ class StoreFileOp extends FileOp {
        }
 
        protected function getSourceSha1Base36() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $hash = sha1_file( $this->params['src'] );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $hash !== false ) {
                        $hash = Wikimedia\base_convert( $hash, 16, 36, 31 );
                }
index dacad1c..553c9aa 100644 (file)
@@ -75,9 +75,9 @@ class FSFile {
         * @return string|bool TS_MW timestamp or false on failure
         */
        public function getTimestamp() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $timestamp = filemtime( $this->path );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $timestamp !== false ) {
                        $timestamp = wfTimestamp( TS_MW, $timestamp );
                }
@@ -168,9 +168,9 @@ class FSFile {
                        return $this->sha1Base36;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $this->sha1Base36 = sha1_file( $this->path );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $this->sha1Base36 !== false ) {
                        $this->sha1Base36 = Wikimedia\base_convert( $this->sha1Base36, 16, 36, 31 );
index fed6812..00d2028 100644 (file)
@@ -62,9 +62,9 @@ class TempFSFile extends FSFile {
                                $tmpDirectory = self::getUsableTempDirectory();
                        }
                        $path = wfTempDir() . '/' . $prefix . $hex . $ext;
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $newFileHandle = fopen( $path, 'x' );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $newFileHandle ) {
                                fclose( $newFileHandle );
                                $tmpFile = new self( $path );
@@ -119,9 +119,9 @@ class TempFSFile extends FSFile {
         */
        public function purge() {
                $this->canDelete = false; // done
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $ok = unlink( $this->path );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                unset( self::$pathsCollect[$this->path] );
 
@@ -179,9 +179,9 @@ class TempFSFile extends FSFile {
         */
        public static function purgeAllOnShutdown() {
                foreach ( self::$pathsCollect as $path ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        unlink( $path );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
        }
 
index 7f33a0a..f2624e7 100644 (file)
@@ -122,13 +122,13 @@ class FSLockManager extends LockManager {
                        if ( isset( $this->handles[$path] ) ) {
                                $handle = $this->handles[$path];
                        } else {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $handle = fopen( $this->getLockPath( $path ), 'a+' );
                                if ( !$handle ) { // lock dir missing?
                                        mkdir( $this->lockDir, 0777, true );
                                        $handle = fopen( $this->getLockPath( $path ), 'a+' ); // try again
                                }
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                        }
                        if ( $handle ) {
                                // Either a shared or exclusive lock
index 4d860bb..8d842cb 100644 (file)
@@ -643,9 +643,9 @@ EOT;
         */
        private function doGuessMimeType( $file, $ext ) {
                // Read a chunk of the file
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $f = fopen( $file, 'rb' );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$f ) {
                        return 'unknown/unknown';
@@ -833,9 +833,9 @@ EOT;
                        }
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $gis = getimagesize( $file );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $gis && isset( $gis['mime'] ) ) {
                        $mime = $gis['mime'];
index b937736..59131b9 100644 (file)
@@ -788,13 +788,13 @@ class MemcachedClient {
                $timeout = $this->_connect_timeout;
                $errno = $errstr = null;
                for ( $i = 0; !$sock && $i < $this->_connect_attempts; $i++ ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        if ( $this->_persistent == 1 ) {
                                $sock = pfsockopen( $ip, $port, $errno, $errstr, $timeout );
                        } else {
                                $sock = fsockopen( $ip, $port, $errno, $errstr, $timeout );
                        }
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
                if ( !$sock ) {
                        $this->_error_log( "Error connecting to $host: $errstr" );
index f3877fb..d1814e1 100644 (file)
@@ -29,7 +29,7 @@ use Psr\Log\LoggerAwareInterface;
 use Psr\Log\LoggerInterface;
 use Wikimedia\ScopedCallback;
 use Wikimedia\Timestamp\ConvertibleTimestamp;
-use MediaWiki;
+use Wikimedia;
 use BagOStuff;
 use HashBagOStuff;
 use InvalidArgumentException;
@@ -3369,9 +3369,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                $fname = false,
                callable $inputCallback = null
        ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $fp = fopen( $filename, 'r' );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( false === $fp ) {
                        throw new RuntimeException( "Could not open \"{$filename}\".\n" );
@@ -3810,9 +3810,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                if ( $this->mConn ) {
                        // Avoid connection leaks for sanity. Normally, resources close at script completion.
                        // The connection might already be closed in zend/hhvm by now, so suppress warnings.
-                       \MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $this->closeConnection();
-                       \MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        $this->mConn = false;
                        $this->mOpened = false;
                }
index 832ed9e..9a0e8c9 100644 (file)
@@ -27,7 +27,7 @@
 
 namespace Wikimedia\Rdbms;
 
-use MediaWiki;
+use Wikimedia;
 use Exception;
 use stdClass;
 
@@ -111,9 +111,9 @@ class DatabaseMssql extends Database {
                        $connectionInfo['PWD'] = $password;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $this->mConn = sqlsrv_connect( $server, $connectionInfo );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $this->mConn === false ) {
                        throw new DBConnectionError( $this, $this->lastError() );
index fcedf56..bd2d274 100644 (file)
@@ -24,7 +24,7 @@ namespace Wikimedia\Rdbms;
 
 use DateTime;
 use DateTimeZone;
-use MediaWiki;
+use Wikimedia;
 use InvalidArgumentException;
 use Exception;
 use stdClass;
@@ -160,9 +160,9 @@ abstract class DatabaseMysqlBase extends Database {
                }
 
                if ( strlen( $dbName ) ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $success = $this->selectDB( $dbName );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( !$success ) {
                                $this->queryLogger->error(
                                        "Error selecting database {db_name} on server {db_server}",
@@ -257,9 +257,9 @@ abstract class DatabaseMysqlBase extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $ok = $this->mysqlFreeResult( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$ok ) {
                        throw new DBUnexpectedError( $this, "Unable to free MySQL result" );
                }
@@ -282,9 +282,9 @@ abstract class DatabaseMysqlBase extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $row = $this->mysqlFetchObject( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $errno = $this->lastErrno();
                // Unfortunately, mysql_fetch_object does not reset the last errno.
@@ -318,9 +318,9 @@ abstract class DatabaseMysqlBase extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $row = $this->mysqlFetchArray( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $errno = $this->lastErrno();
                // Unfortunately, mysql_fetch_array does not reset the last errno.
@@ -354,9 +354,9 @@ abstract class DatabaseMysqlBase extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $n = $this->mysqlNumRows( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                // Unfortunately, mysql_num_rows does not reset the last errno.
                // We are not checking for any errors here, since
@@ -467,12 +467,12 @@ abstract class DatabaseMysqlBase extends Database {
        public function lastError() {
                if ( $this->mConn ) {
                        # Even if it's non-zero, it can still be invalid
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $error = $this->mysqlError( $this->mConn );
                        if ( !$error ) {
                                $error = $this->mysqlError();
                        }
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                } else {
                        $error = $this->mysqlError();
                }
index 5bf845b..8fbb7de 100644 (file)
@@ -24,7 +24,7 @@ namespace Wikimedia\Rdbms;
 
 use Wikimedia\Timestamp\ConvertibleTimestamp;
 use Wikimedia\WaitConditionLoop;
-use MediaWiki;
+use Wikimedia;
 use Exception;
 
 /**
@@ -266,9 +266,9 @@ class DatabasePostgres extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $ok = pg_free_result( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$ok ) {
                        throw new DBUnexpectedError( $this, "Unable to free Postgres result\n" );
                }
@@ -278,9 +278,9 @@ class DatabasePostgres extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $row = pg_fetch_object( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                # @todo FIXME: HACK HACK HACK HACK debug
 
                # @todo hashar: not sure if the following test really trigger if the object
@@ -300,9 +300,9 @@ class DatabasePostgres extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $row = pg_fetch_array( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $conn = $this->getBindingHandle();
                if ( pg_last_error( $conn ) ) {
@@ -319,9 +319,9 @@ class DatabasePostgres extends Database {
                if ( $res instanceof ResultWrapper ) {
                        $res = $res->result;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $n = pg_num_rows( $res );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $conn = $this->getBindingHandle();
                if ( pg_last_error( $conn ) ) {
index 88e816a..1955915 100644 (file)
@@ -343,9 +343,9 @@ class XMPReader implements LoggerAwareInterface {
                        }
                        if ( $this->charset !== 'UTF-8' ) {
                                // don't convert if already utf-8
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $content = iconv( $this->charset, 'UTF-8//IGNORE', $content );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                        }
 
                        // Ensure the XMP block does not have an xml doctype declaration, which
@@ -571,7 +571,7 @@ class XMPReader implements LoggerAwareInterface {
 
                // Even with LIBXML_NOWARNING set, XMLReader::read gives a warning
                // when parsing truncated XML, which causes unit tests to fail.
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                while ( $reader->read() ) {
                        if ( $reader->nodeType === XMLReader::ELEMENT ) {
                                // Reached the first element without hitting a doctype declaration
@@ -585,7 +585,7 @@ class XMPReader implements LoggerAwareInterface {
                                break;
                        }
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !is_null( $result ) ) {
                        return $result;
index 16b3593..35502c7 100644 (file)
@@ -265,9 +265,9 @@ class DatabaseLogEntry extends LogEntryBase {
        public function getParameters() {
                if ( !isset( $this->params ) ) {
                        $blob = $this->getRawParameters();
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $params = LogEntryBase::extractParams( $blob );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $params !== false ) {
                                $this->params = $params;
                                $this->legacy = false;
index cb07fd5..fb0f2f9 100644 (file)
@@ -360,13 +360,13 @@ class UserMailer {
                                require_once 'Mail.php';
                        }
 
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
 
                        // Create the mail object using the Mail::factory method
                        $mail_object =& Mail::factory( 'smtp', $wgSMTP );
                        if ( PEAR::isError( $mail_object ) ) {
                                wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                                return Status::newFatal( 'pear-mail-error', $mail_object->getMessage() );
                        }
 
@@ -386,11 +386,11 @@ class UserMailer {
                                $status = self::sendWithPear( $mail_object, $chunk, $headers, $body );
                                // FIXME : some chunks might be sent while others are not!
                                if ( !$status->isOK() ) {
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
                                        return $status;
                                }
                        }
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        return Status::newGood();
                } else {
                        // PHP mail()
index 617a910..712906e 100644 (file)
@@ -203,9 +203,9 @@ class BitmapHandler extends TransformationalImageHandler {
                                '-layers', 'merge',
                                '-background', 'white',
                        ];
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $xcfMeta = unserialize( $image->getMetadata() );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $xcfMeta
                                && isset( $xcfMeta['colorType'] )
                                && $xcfMeta['colorType'] === 'greyscale-alpha'
index eb7b6ba..2541e35 100644 (file)
@@ -265,9 +265,9 @@ class DjVuHandler extends ImageHandler {
                        return $metadata;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $unser = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( is_array( $unser ) ) {
                        if ( isset( $unser['error'] ) ) {
                                return false;
@@ -321,7 +321,7 @@ class DjVuHandler extends ImageHandler {
         * @return array
         */
        protected function extractTreesFromMetadata( $metadata ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                try {
                        // Set to false rather than null to avoid further attempts
                        $metaTree = false;
@@ -344,7 +344,7 @@ class DjVuHandler extends ImageHandler {
                } catch ( Exception $e ) {
                        wfDebug( "Bogus multipage XML metadata\n" );
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return [ 'MetaTree' => $metaTree, 'TextTree' => $textTree ];
        }
index d25111c..adcac25 100644 (file)
@@ -117,9 +117,9 @@ class DjVuImage {
        }
 
        function getInfo() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $file = fopen( $this->mFilename, 'rb' );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $file === false ) {
                        wfDebug( __METHOD__ . ": missing or failed file read\n" );
 
index cd457f0..a38e79b 100644 (file)
@@ -292,9 +292,9 @@ class Exif {
 
                $this->debugFile( $this->basename, __FUNCTION__, true );
                if ( function_exists( 'exif_read_data' ) ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $data = exif_read_data( $this->file, 0, true );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                } else {
                        throw new MWException( "Internal error: exif_read_data not present. " .
                                "\$wgShowEXIF may be incorrectly set or not checked by an extension." );
@@ -467,17 +467,17 @@ class Exif {
                                        break;
                        }
                        if ( $charset ) {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $val = iconv( $charset, 'UTF-8//IGNORE', $val );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
                        } else {
                                // if valid utf-8, assume that, otherwise assume windows-1252
                                $valCopy = $val;
                                UtfNormal\Validator::quickIsNFCVerify( $valCopy ); // validates $valCopy.
                                if ( $valCopy !== $val ) {
-                                       MediaWiki\suppressWarnings();
+                                       Wikimedia\suppressWarnings();
                                        $val = iconv( 'Windows-1252', 'UTF-8//IGNORE', $val );
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
                                }
                        }
 
index 0e10abb..4267210 100644 (file)
@@ -99,9 +99,9 @@ class ExifBitmapHandler extends BitmapHandler {
                if ( $metadata === self::BROKEN_FILE ) {
                        return self::METADATA_GOOD;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $exif = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !isset( $exif['MEDIAWIKI_EXIF_VERSION'] )
                        || $exif['MEDIAWIKI_EXIF_VERSION'] != Exif::version()
                ) {
@@ -223,9 +223,9 @@ class ExifBitmapHandler extends BitmapHandler {
                if ( !$data ) {
                        return 0;
                }
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $data = unserialize( $data );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( isset( $data['Orientation'] ) ) {
                        # See http://sylvana.net/jpegcrop/exif_orientation.html
                        switch ( $data['Orientation'] ) {
index 5f23855..d65f872 100644 (file)
@@ -131,9 +131,9 @@ class GIFHandler extends BitmapHandler {
                        return self::METADATA_GOOD;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $data = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$data || !is_array( $data ) ) {
                        wfDebug( __METHOD__ . " invalid GIF metadata\n" );
@@ -161,9 +161,9 @@ class GIFHandler extends BitmapHandler {
 
                $original = parent::getLongDesc( $image );
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $metadata = unserialize( $image->getMetadata() );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$metadata || $metadata['frameCount'] <= 1 ) {
                        return $original;
@@ -198,9 +198,9 @@ class GIFHandler extends BitmapHandler {
         */
        public function getLength( $file ) {
                $serMeta = $file->getMetadata();
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $metadata = unserialize( $serMeta );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$metadata || !isset( $metadata['duration'] ) || !$metadata['duration'] ) {
                        return 0.0;
index ac5fc81..a26539a 100644 (file)
@@ -161,9 +161,9 @@ class GIFMetadataExtractor {
                                        UtfNormal\Validator::quickIsNFCVerify( $dataCopy );
 
                                        if ( $dataCopy !== $data ) {
-                                               MediaWiki\suppressWarnings();
+                                               Wikimedia\suppressWarnings();
                                                $data = iconv( 'windows-1252', 'UTF-8', $data );
-                                               MediaWiki\restoreWarnings();
+                                               Wikimedia\restoreWarnings();
                                        }
 
                                        $commentCount = count( $comment );
index ef7ed5f..441c515 100644 (file)
@@ -445,9 +445,9 @@ class IPTC {
         */
        private static function convIPTCHelper( $data, $charset ) {
                if ( $charset ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $data = iconv( $charset, "UTF-8//IGNORE", $data );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $data === false ) {
                                $data = "";
                                wfDebugLog( 'iptc', __METHOD__ . " Error converting iptc data charset $charset to utf-8" );
index 1eefddb..a0a1603 100644 (file)
@@ -201,9 +201,9 @@ abstract class ImageHandler extends MediaHandler {
        }
 
        function getImageSize( $image, $path ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $gis = getimagesize( $path );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return $gis;
        }
index 211845c..229a891 100644 (file)
@@ -102,9 +102,9 @@ class JpegMetadataExtractor {
                                // turns $com to valid utf-8.
                                // thus if no change, its utf-8, otherwise its something else.
                                if ( $com !== $oldCom ) {
-                                       MediaWiki\suppressWarnings();
+                                       Wikimedia\suppressWarnings();
                                        $com = $oldCom = iconv( 'windows-1252', 'UTF-8//IGNORE', $oldCom );
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
                                }
                                // Try it again, if its still not a valid string, then probably
                                // binary junk or some really weird encoding, so don't extract.
index 5dca24b..c76930c 100644 (file)
@@ -158,9 +158,9 @@ abstract class MediaHandler {
        function convertMetadataVersion( $metadata, $version = 1 ) {
                if ( !is_array( $metadata ) ) {
                        // unserialize to keep return parameter consistent.
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $ret = unserialize( $metadata );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
 
                        return $ret;
                }
index b6288bc..6748b26 100644 (file)
@@ -117,9 +117,9 @@ class PNGHandler extends BitmapHandler {
                        return self::METADATA_GOOD;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $data = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$data || !is_array( $data ) ) {
                        wfDebug( __METHOD__ . " invalid png metadata\n" );
@@ -146,9 +146,9 @@ class PNGHandler extends BitmapHandler {
                global $wgLang;
                $original = parent::getLongDesc( $image );
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $metadata = unserialize( $image->getMetadata() );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$metadata || $metadata['frameCount'] <= 0 ) {
                        return $original;
@@ -184,9 +184,9 @@ class PNGHandler extends BitmapHandler {
         */
        public function getLength( $file ) {
                $serMeta = $file->getMetadata();
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $metadata = unserialize( $serMeta );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$metadata || !isset( $metadata['duration'] ) || !$metadata['duration'] ) {
                        return 0.0;
index c12ca0b..78ed0bc 100644 (file)
@@ -202,9 +202,9 @@ class PNGMetadataExtractor {
                                        // if compressed
                                        if ( $items[2] == "\x01" ) {
                                                if ( function_exists( 'gzuncompress' ) && $items[4] === "\x00" ) {
-                                                       MediaWiki\suppressWarnings();
+                                                       Wikimedia\suppressWarnings();
                                                        $items[5] = gzuncompress( $items[5] );
-                                                       MediaWiki\restoreWarnings();
+                                                       Wikimedia\restoreWarnings();
 
                                                        if ( $items[5] === false ) {
                                                                // decompression failed
@@ -246,9 +246,9 @@ class PNGMetadataExtractor {
                                        fseek( $fh, self::$crcSize, SEEK_CUR );
                                        continue;
                                }
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                $content = iconv( 'ISO-8859-1', 'UTF-8', $content );
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
 
                                if ( $content === false ) {
                                        throw new Exception( __METHOD__ . ": Read error (error with iconv)" );
@@ -286,9 +286,9 @@ class PNGMetadataExtractor {
                                                continue;
                                        }
 
-                                       MediaWiki\suppressWarnings();
+                                       Wikimedia\suppressWarnings();
                                        $content = gzuncompress( $content );
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
 
                                        if ( $content === false ) {
                                                // decompression failed
@@ -297,9 +297,9 @@ class PNGMetadataExtractor {
                                                continue;
                                        }
 
-                                       MediaWiki\suppressWarnings();
+                                       Wikimedia\suppressWarnings();
                                        $content = iconv( 'ISO-8859-1', 'UTF-8', $content );
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
 
                                        if ( $content === false ) {
                                                throw new Exception( __METHOD__ . ": Read error (error with iconv)" );
index 10be97a..9085421 100644 (file)
@@ -249,10 +249,10 @@ class SvgHandler extends ImageHandler {
                $ok = symlink( $srcPath, $lnPath );
                /** @noinspection PhpUnusedLocalVariableInspection */
                $cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        unlink( $lnPath );
                        rmdir( $tmpDir );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                } );
                if ( !$ok ) {
                        wfDebugLog( 'thumbnail',
@@ -418,9 +418,9 @@ class SvgHandler extends ImageHandler {
        }
 
        function unpackMetadata( $metadata ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $unser = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( isset( $unser['version'] ) && $unser['version'] == self::SVG_METADATA_VERSION ) {
                        return $unser;
                } else {
index 9b22cbe..fc93b23 100644 (file)
@@ -106,17 +106,17 @@ class SVGReader {
                // Because we cut off the end of the svg making an invalid one. Complicated
                // try catch thing to make sure warnings get restored. Seems like there should
                // be a better way.
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                try {
                        $this->read();
                } catch ( Exception $e ) {
                        // Note, if this happens, the width/height will be taken to be 0x0.
                        // Should we consider it the default 512x512 instead?
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        libxml_disable_entity_loader( $oldDisable );
                        throw $e;
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                libxml_disable_entity_loader( $oldDisable );
        }
 
index e0af6de..295a978 100644 (file)
@@ -63,9 +63,9 @@ class WebPHandler extends BitmapHandler {
                                return self::METADATA_GOOD;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $data = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$data || !is_array( $data ) ) {
                                wfDebug( __METHOD__ . " invalid WebP metadata\n" );
@@ -235,9 +235,9 @@ class WebPHandler extends BitmapHandler {
                        $metadata = $file->getMetadata();
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $metadata = unserialize( $metadata );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $metadata == false ) {
                        return false;
index 1b6c4c8..491fef2 100644 (file)
@@ -217,9 +217,9 @@ class XCFHandler extends BitmapHandler {
         * @return bool
         */
        public function canRender( $file ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $xcfMeta = unserialize( $file->getMetadata() );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( isset( $xcfMeta['colorType'] ) && $xcfMeta['colorType'] === 'index-coloured' ) {
                        return false;
                }
index 6691f73..6d35658 100644 (file)
@@ -681,9 +681,9 @@ class SqlBagOStuff extends BagOStuff {
         */
        protected function unserialize( $serial ) {
                if ( function_exists( 'gzinflate' ) ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $decomp = gzinflate( $serial );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
 
                        if ( false !== $decomp ) {
                                $serial = $decomp;
index 4db2855..81243f3 100644 (file)
@@ -86,9 +86,9 @@ class Preprocessor_DOM extends Preprocessor {
                $xml .= "</list>";
 
                $dom = new DOMDocument();
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $result = $dom->loadXML( $xml );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$result ) {
                        // Try running the XML through UtfNormal to get rid of invalid characters
                        $xml = UtfNormal\Validator::cleanUp( $xml );
@@ -163,9 +163,9 @@ class Preprocessor_DOM extends Preprocessor {
                }
 
                $dom = new DOMDocument;
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $result = $dom->loadXML( $xml );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( !$result ) {
                        // Try running the XML through UtfNormal to get rid of invalid characters
                        $xml = UtfNormal\Validator::cleanUp( $xml );
index de7a6fa..b13e597 100644 (file)
@@ -515,9 +515,9 @@ class Sanitizer {
                                                $badtag = true;
                                        } elseif ( $slash ) {
                                                # Closing a tag... is it the one we just opened?
-                                               MediaWiki\suppressWarnings();
+                                               Wikimedia\suppressWarnings();
                                                $ot = array_pop( $tagstack );
-                                               MediaWiki\restoreWarnings();
+                                               Wikimedia\restoreWarnings();
 
                                                if ( $ot != $t ) {
                                                        if ( isset( $htmlsingleallowed[$ot] ) ) {
@@ -525,32 +525,32 @@ class Sanitizer {
                                                                # and see if we find a match below them
                                                                $optstack = [];
                                                                array_push( $optstack, $ot );
-                                                               MediaWiki\suppressWarnings();
+                                                               Wikimedia\suppressWarnings();
                                                                $ot = array_pop( $tagstack );
-                                                               MediaWiki\restoreWarnings();
+                                                               Wikimedia\restoreWarnings();
                                                                while ( $ot != $t && isset( $htmlsingleallowed[$ot] ) ) {
                                                                        array_push( $optstack, $ot );
-                                                                       MediaWiki\suppressWarnings();
+                                                                       Wikimedia\suppressWarnings();
                                                                        $ot = array_pop( $tagstack );
-                                                                       MediaWiki\restoreWarnings();
+                                                                       Wikimedia\restoreWarnings();
                                                                }
                                                                if ( $t != $ot ) {
                                                                        # No match. Push the optional elements back again
                                                                        $badtag = true;
-                                                                       MediaWiki\suppressWarnings();
+                                                                       Wikimedia\suppressWarnings();
                                                                        $ot = array_pop( $optstack );
-                                                                       MediaWiki\restoreWarnings();
+                                                                       Wikimedia\restoreWarnings();
                                                                        while ( $ot ) {
                                                                                array_push( $tagstack, $ot );
-                                                                               MediaWiki\suppressWarnings();
+                                                                               Wikimedia\suppressWarnings();
                                                                                $ot = array_pop( $optstack );
-                                                                               MediaWiki\restoreWarnings();
+                                                                               Wikimedia\restoreWarnings();
                                                                        }
                                                                }
                                                        } else {
-                                                               MediaWiki\suppressWarnings();
+                                                               Wikimedia\suppressWarnings();
                                                                array_push( $tagstack, $ot );
-                                                               MediaWiki\restoreWarnings();
+                                                               Wikimedia\restoreWarnings();
 
                                                                # <li> can be nested in <ul> or <ol>, skip those cases:
                                                                if ( !isset( $htmllist[$ot] ) || !isset( $listtags[$t] ) ) {
index a6ec72a..def0eed 100644 (file)
@@ -1069,9 +1069,9 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * @return int UNIX timestamp
         */
        protected static function safeFilemtime( $filePath ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $mtime = filemtime( $filePath ) ?: 1;
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                return $mtime;
        }
 
index 2810bce..8e705c1 100644 (file)
@@ -54,9 +54,9 @@ class SearchMySQL extends SearchDatabase {
                if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                                $filteredText, $m, PREG_SET_ORDER ) ) {
                        foreach ( $m as $bits ) {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                list( /* all */, $modifier, $term, $nonQuoted, $wildcard ) = $bits;
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
 
                                if ( $nonQuoted != '' ) {
                                        $term = $nonQuoted;
index 3d4da42..af29212 100644 (file)
@@ -52,9 +52,9 @@ class SearchSqlite extends SearchDatabase {
                if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                                $filteredText, $m, PREG_SET_ORDER ) ) {
                        foreach ( $m as $bits ) {
-                               MediaWiki\suppressWarnings();
+                               Wikimedia\suppressWarnings();
                                list( /* all */, $modifier, $term, $nonQuoted, $wildcard ) = $bits;
-                               MediaWiki\restoreWarnings();
+                               Wikimedia\restoreWarnings();
 
                                if ( $nonQuoted != '' ) {
                                        $term = $nonQuoted;
index 970290a..731897e 100644 (file)
@@ -50,9 +50,9 @@ class MediaWikiI18N {
                $m = [];
                while ( preg_match( '/\$([0-9]*?)/sm', $value, $m ) ) {
                        list( $src, $var ) = $m;
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $varValue = $this->context[$var];
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        $value = str_replace( $src, $varValue, $value );
                }
                return $value;
index 4b5dedf..5a98bb9 100644 (file)
@@ -380,9 +380,9 @@ class SpecialExport extends SpecialPage {
                        $buffer = WikiExporter::STREAM;
 
                        // This might take a while... :D
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        set_time_limit( 0 );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                }
 
                $exporter = new WikiExporter( $db, $history, $buffer );
index 2d087ca..fb04b90 100644 (file)
@@ -80,9 +80,9 @@ class SpecialLockdb extends FormSpecialPage {
                        return Status::newFatal( 'locknoconfirm' );
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $fp = fopen( $this->getConfig()->get( 'ReadOnlyFile' ), 'w' );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( false === $fp ) {
                        # This used to show a file not found error, but the likeliest reason for fopen()
index 8cd86ce..3135653 100644 (file)
@@ -69,9 +69,9 @@ class SpecialUnlockdb extends FormSpecialPage {
                }
 
                $readOnlyFile = $this->getConfig()->get( 'ReadOnlyFile' );
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $res = unlink( $readOnlyFile );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $res ) {
                        return Status::newGood();
index c3fa2b1..e29467d 100644 (file)
@@ -427,14 +427,14 @@ class ContribsPager extends RangeChronologicalPager {
                 * we're definitely dealing with revision data and we may proceed, if not, we'll leave it
                 * to extensions to subscribe to the hook to parse the row.
                 */
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                try {
                        $rev = new Revision( $row );
                        $validRevision = (bool)$rev->getId();
                } catch ( Exception $e ) {
                        $validRevision = false;
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $validRevision ) {
                        $attribs['data-mw-revid'] = $rev->getId();
index 8a76efb..1c31724 100644 (file)
@@ -207,14 +207,14 @@ class DeletedContribsPager extends IndexPager {
                 * we're definitely dealing with revision data and we may proceed, if not, we'll leave it
                 * to extensions to subscribe to the hook to parse the row.
                 */
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                try {
                        $rev = Revision::newFromArchiveRow( $row );
                        $validRevision = (bool)$rev->getId();
                } catch ( Exception $e ) {
                        $validRevision = false;
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $validRevision ) {
                        $attribs['data-mw-revid'] = $rev->getId();
index ddb4bba..064ca67 100644 (file)
@@ -1425,9 +1425,9 @@ abstract class UploadBase {
                // detect the encoding in case is specifies an encoding not whitelisted in self::$safeXmlEncodings
                $attemptEncodings = [ 'UTF-16', 'UTF-16BE', 'UTF-32', 'UTF-32BE' ];
                foreach ( $attemptEncodings as $encoding ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $str = iconv( $encoding, 'UTF-8', $contents );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $str != '' && preg_match( "!<\?xml\b(.*?)\?>!si", $str, $matches ) ) {
                                if ( preg_match( $encodingRegex, $matches[1], $encMatch )
                                        && !in_array( strtoupper( $encMatch[1] ), self::$safeXmlEncodings )
index 93f635d..9679bfe 100644 (file)
@@ -62,9 +62,9 @@ class ExecutableFinder {
        protected static function findExecutable( $path, $name, $versionInfo = false ) {
                $command = $path . DIRECTORY_SEPARATOR . $name;
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $file_exists = is_executable( $command );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $file_exists ) {
                        if ( !$versionInfo ) {
index afe9c0a..e390f21 100644 (file)
@@ -93,11 +93,11 @@ class FileContentsHasher {
                        $filePaths = (array)$filePaths;
                }
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
 
                if ( count( $filePaths ) === 1 ) {
                        $hash = $instance->getFileContentsHashInternal( $filePaths[0], $algo );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        return $hash;
                }
 
@@ -106,7 +106,7 @@ class FileContentsHasher {
                        return $instance->getFileContentsHashInternal( $filePath, $algo ) ?: '';
                }, $filePaths );
 
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $hashes = implode( '', $hashes );
                return $hashes ? hash( $algo, $hashes ) : false;
index 164615a..4d5c3af 100644 (file)
@@ -53,7 +53,7 @@ class UIDGenerator {
                }
                // Try to get some ID that uniquely identifies this machine (RFC 4122)...
                if ( !preg_match( '/^[0-9a-f]{12}$/i', $nodeId ) ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        if ( wfIsWindows() ) {
                                // https://technet.microsoft.com/en-us/library/bb490913.aspx
                                $csv = trim( wfShellExec( 'getmac /NH /FO CSV' ) );
@@ -67,7 +67,7 @@ class UIDGenerator {
                                        wfShellExec( '/sbin/ifconfig -a' ), $m );
                                $nodeId = isset( $m[1] ) ? str_replace( ':', '', $m[1] ) : '';
                        }
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( !preg_match( '/^[0-9a-f]{12}$/i', $nodeId ) ) {
                                $nodeId = MWCryptRand::generateHex( 12, true );
                                $nodeId[1] = dechex( hexdec( $nodeId[1] ) | 0x1 ); // set multicast bit
index 27c9faf..084a2e7 100644 (file)
@@ -2140,7 +2140,7 @@ class Language {
                        return $ts;
                }
 
-               MediaWiki\suppressWarnings(); // E_STRICT system time bitching
+               Wikimedia\suppressWarnings(); // E_STRICT system time bitching
                # Generate an adjusted date; take advantage of the fact that mktime
                # will normalize out-of-range values so we don't have to split $minDiff
                # into hours and minutes.
@@ -2153,7 +2153,7 @@ class Language {
                        (int)substr( $ts, 0, 4 ) ); # Year
 
                $date = date( 'YmdHis', $t );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return $date;
        }
@@ -2605,9 +2605,9 @@ class Language {
                # *input* string. We just ignore those too.
                # REF: https://bugs.php.net/bug.php?id=37166
                # REF: https://phabricator.wikimedia.org/T18885
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $text = iconv( $in, $out . '//IGNORE', $string );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                return $text;
        }
 
index 527e6cb..617071b 100644 (file)
@@ -1156,9 +1156,9 @@ abstract class Maintenance {
 
                $wgShowSQLErrors = true;
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                set_time_limit( 0 );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $this->adjustMemoryLimit();
        }
index fd66b3f..3aa7af7 100644 (file)
@@ -37,9 +37,9 @@ class BenchmarkJSMinPlus extends Benchmarker {
        }
 
        public function execute() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $content = file_get_contents( $this->getOption( 'file' ) );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( $content === false ) {
                        $this->fatalError( 'Unable to open input file' );
                }
index fdc36c7..57e09a7 100644 (file)
@@ -722,13 +722,13 @@ TEXT
        }
 
        private function getTextSpawned( $id ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                if ( !$this->spawnProc ) {
                        // First time?
                        $this->openSpawn();
                }
                $text = $this->getTextSpawnedOnce( $id );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return $text;
        }
@@ -774,7 +774,7 @@ TEXT
        }
 
        private function closeSpawn() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                if ( $this->spawnRead ) {
                        fclose( $this->spawnRead );
                }
@@ -791,7 +791,7 @@ TEXT
                        pclose( $this->spawnProc );
                }
                $this->spawnProc = false;
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
        }
 
        private function getTextSpawnedOnce( $id ) {
index d170c15..6249094 100644 (file)
@@ -132,9 +132,9 @@ class CommandLineInstaller extends Maintenance {
                                $this->error( 'WARNING: You have provided the options "dbpass" and "dbpassfile". '
                                        . 'The content of "dbpassfile" overrides "dbpass".' );
                        }
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $dbpass = file_get_contents( $dbpassfile ); // returns false on failure
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $dbpass === false ) {
                                $this->fatalError( "Couldn't open $dbpassfile" );
                        }
@@ -149,9 +149,9 @@ class CommandLineInstaller extends Maintenance {
                                $this->error( 'WARNING: You have provided the options "pass" and "passfile". '
                                        . 'The content of "passfile" overrides "pass".' );
                        }
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $pass = file_get_contents( $passfile ); // returns false on failure
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $pass === false ) {
                                $this->fatalError( "Couldn't open $passfile" );
                        }
index deac4af..661ec98 100644 (file)
@@ -47,9 +47,9 @@ class JSParseHelper extends Maintenance {
 
                $parser = new JSParser();
                foreach ( $files as $filename ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $js = file_get_contents( $filename );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( $js === false ) {
                                $this->output( "$filename ERROR: could not read file\n" );
                                $this->errs++;
index 15ccb2d..723ea62 100644 (file)
@@ -26,9 +26,9 @@
 /** A general output object. Need to be overridden */
 class StatsOutput {
        function formatPercent( $subset, $total, $revert = false, $accuracy = 2 ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $return = sprintf( '%.' . $accuracy . 'f%%', 100 * $subset / $total );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return $return;
        }
@@ -92,9 +92,9 @@ class WikiStatsOutput extends StatsOutput {
        }
 
        function formatPercent( $subset, $total, $revert = false, $accuracy = 2 ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $v = round( 255 * $subset / $total );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $revert ) {
                        # Weigh reverse with factor 20 so coloring takes effect more quickly as
index 55ed4fa..ae6a75e 100644 (file)
@@ -140,7 +140,7 @@ class RebuildFileCache extends Maintenance {
                                                }
                                        }
 
-                                       MediaWiki\suppressWarnings(); // header notices
+                                       Wikimedia\suppressWarnings(); // header notices
                                        // Cache ?action=view
                                        $wgRequestTime = microtime( true ); # T24852
                                        ob_start();
@@ -157,7 +157,7 @@ class RebuildFileCache extends Maintenance {
                                        $context->getOutput()->clearHTML();
                                        $historyHtml = ob_get_clean();
                                        $historyCache->saveToFileCache( $historyHtml );
-                                       MediaWiki\restoreWarnings();
+                                       Wikimedia\restoreWarnings();
 
                                        if ( $rebuilt ) {
                                                $this->output( "Re-cached page '$title' (id {$row->page_id})..." );
index 5070745..bfd4d97 100644 (file)
@@ -117,12 +117,12 @@ class SqliteMaintenance extends Maintenance {
                $this->db->query( 'BEGIN IMMEDIATE TRANSACTION', __METHOD__ );
                $ourFile = $this->db->getDbFilePath();
                $this->output( "   Copying database file $ourFile to $fileName... " );
-               MediaWiki\suppressWarnings( false );
+               Wikimedia\suppressWarnings();
                if ( !copy( $ourFile, $fileName ) ) {
                        $err = error_get_last();
                        $this->error( "      {$err['message']}" );
                }
-               MediaWiki\suppressWarnings( true );
+               Wikimedia\restoreWarnings();
                $this->output( "   Releasing lock...\n" );
                $this->db->query( 'COMMIT TRANSACTION', __METHOD__ );
        }
index f6aa19b..b7ae691 100644 (file)
@@ -310,9 +310,9 @@ class FixT22757 extends Maintenance {
                $text = $secondaryRow->old_text;
                if ( in_array( 'external', $flags ) ) {
                        $url = $text;
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        list( /* $proto */, $path ) = explode( '://', $url, 2 );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
 
                        if ( $path == "" ) {
                                return false;
index 2a92140..54a9102 100644 (file)
@@ -236,9 +236,9 @@ class RecompressTracked {
                                [ 'file', 'php://stdout', 'w' ],
                                [ 'file', 'php://stderr', 'w' ]
                        ];
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $proc = proc_open( "$cmd --replica-id $i", $spec, $pipes );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        if ( !$proc ) {
                                $this->critical( "Error opening replica DB process: $cmd" );
                                exit( 1 );
index 61aa0d7..fbeed97 100644 (file)
@@ -25,11 +25,11 @@ class ParserTestResultNormalizer {
                // guaranteed to give accurate results. For example, it may introduce
                // differences in the number of line breaks in <pre> tags.
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                if ( !$this->doc->loadXML( '<html><body>' . $text . '</body></html>' ) ) {
                        $this->invalid = true;
                }
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                $this->xpath = new DOMXPath( $this->doc );
                $this->body = $this->xpath->query( '//body' )->item( 0 );
        }
index 9a2a9c9..eb4181c 100644 (file)
@@ -165,9 +165,9 @@ class ParserFuzzTest extends Maintenance {
        function guessVarSize( $var ) {
                $length = 0;
                try {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $length = strlen( serialize( $var ) );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                } catch ( Exception $e ) {
                }
                return $length;
index 01a34b8..817f161 100644 (file)
@@ -1597,9 +1597,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @param string $function
         */
        public function hideDeprecated( $function ) {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                wfDeprecated( $function );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
        }
 
        /**
@@ -1893,9 +1893,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
                # This check may also protect against code injection in
                # case of broken installations.
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( !$haveDiff3 ) {
                        $this->markTestSkipped( "Skip test, since diff3 is not configured" );
index 84e1f32..e332cdd 100644 (file)
@@ -648,8 +648,8 @@ class CommentStoreTest extends MediaWikiLangTestCase {
        }
 
        public function testGetCommentErrors() {
-               MediaWiki\suppressWarnings();
-               $reset = new ScopedCallback( 'MediaWiki\restoreWarnings' );
+               Wikimedia\suppressWarnings();
+               $reset = new ScopedCallback( 'Wikimedia\restoreWarnings' );
 
                $store = $this->makeStore( MIGRATION_OLD );
                $res = $store->getComment( 'dummy', [ 'dummy' => 'comment' ] );
index 9d56150..ee4819f 100644 (file)
@@ -711,9 +711,9 @@ class GlobalTest extends MediaWikiTestCase {
        public function testWfMkdirParents() {
                // Should not return true if file exists instead of directory
                $fname = $this->getNewTempFile();
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $ok = wfMkdirParents( $fname );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                $this->assertFalse( $ok );
        }
 
index be28e43..88c585f 100644 (file)
@@ -266,9 +266,9 @@ class OutputPageTest extends MediaWikiTestCase {
                        'UploadPath' => $uploadPath,
                ] );
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $actual = OutputPage::transformResourcePath( $conf, $path );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $this->assertEquals( $expected ?: $path, $actual );
        }
index b36fd7d..b05a742 100644 (file)
@@ -903,7 +903,7 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
                        'text_id' => 123456789, // not in the test DB
                ] );
 
-               MediaWiki\suppressWarnings(); // bad text_id will trigger a warning.
+               Wikimedia\suppressWarnings(); // bad text_id will trigger a warning.
 
                $this->assertNull( $rev->getContent(),
                        "getContent() should return null if the revision's text blob could not be loaded." );
@@ -912,7 +912,7 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
                $this->assertNull( $rev->getContent(),
                        "getContent() should return null if the revision's text blob could not be loaded." );
 
-               MediaWiki\suppressWarnings( 'end' );
+               Wikimedia\restoreWarnings();
        }
 
        public function provideGetSize() {
index 57c0531..8eac064 100644 (file)
@@ -86,10 +86,10 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers \MediaWiki\Storage\RevisionStore::newMutableRevisionFromArray
         */
        public function testConstructFromArrayWithBadPageId() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $rev = new Revision( [ 'page' => 77777777 ] );
                $this->assertSame( 77777777, $rev->getPage() );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
        }
 
        public function provideConstructFromArray_userSetAsExpected() {
@@ -320,10 +320,10 @@ class RevisionTest extends MediaWikiTestCase {
        public function testConstructFromRowWithBadPageId() {
                $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
                $this->overrideMwServices();
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $rev = new Revision( (object)[ 'rev_page' => 77777777 ] );
                $this->assertSame( 77777777, $rev->getPage() );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
        }
 
        public function provideGetRevisionText() {
index d47481c..aa579ab 100644 (file)
@@ -575,11 +575,11 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
        }
 
        public static function provideGetMessageFromException() {
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $usageException = new UsageException(
                        '<b>Something broke!</b>', 'ue-code', 0, [ 'xxx' => 'yyy', 'baz' => 23 ]
                );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                return [
                        'Normal exception' => [
index 83eba54..67d323f 100644 (file)
@@ -500,9 +500,9 @@ class ApiMainTest extends ApiTestCase {
                        MWExceptionHandler::getRedactedTraceAsString( $dbex )
                )->inLanguage( 'en' )->useDatabase( false )->text();
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $usageEx = new UsageException( 'Usage exception!', 'ue', 0, [ 'foo' => 'bar' ] );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $apiEx1 = new ApiUsageException( null,
                        StatusValue::newFatal( new ApiRawMessage( 'An error', 'sv-error1' ) ) );
index 6b60409..345f196 100644 (file)
@@ -456,9 +456,9 @@ class ApiUploadTest extends ApiTestCaseUpload {
                $chunkSessionKey = false;
                $resultOffset = 0;
                // Open the file:
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $handle = fopen( $filePath, "r" );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                if ( $handle === false ) {
                        $this->markTestIncomplete( "could not open file: $filePath" );
@@ -466,9 +466,9 @@ class ApiUploadTest extends ApiTestCaseUpload {
 
                while ( !feof( $handle ) ) {
                        // Get the current chunk
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $chunkData = fread( $handle, $chunkSize );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
 
                        // Upload the current chunk into the $_FILE object:
                        $this->fakeUploadChunk( 'chunk', 'blob', $mimeType, $chunkData );
index d638d0f..ab42696 100644 (file)
@@ -52,9 +52,9 @@ class RecentChangeTest extends MediaWikiTestCase {
                $row->rc_deleted = 'bar';
                $row->rc_comment = 'comment';
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $rc = RecentChange::newFromRow( $row );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $expected = [
                        'rc_foo' => 'AAA',
index 356ebe5..4097760 100644 (file)
@@ -506,9 +506,9 @@ class LBFactoryTest extends MediaWikiTestCase {
                        $this->assertInstanceOf( \Wikimedia\Rdbms\DBConnectionError::class, $e );
                        $this->assertFalse( $db->isOpen() );
                } else {
-                       \MediaWiki\suppressWarnings();
+                       \Wikimedia\suppressWarnings();
                        $this->assertFalse( $db->selectDB( 'garbage-db' ) );
-                       \MediaWiki\restoreWarnings();
+                       \Wikimedia\restoreWarnings();
                }
 
                $lb->reuseConnection( $db ); // don't care
index 372f732..6f0b1db 100644 (file)
@@ -11,13 +11,13 @@ class MWDebugTest extends MediaWikiTestCase {
        public static function setUpBeforeClass() {
                parent::setUpBeforeClass();
                MWDebug::init();
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
        }
 
        public static function tearDownAfterClass() {
                parent::tearDownAfterClass();
                MWDebug::deinit();
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
        }
 
        /**
index 915a186..baa4df7 100644 (file)
@@ -50,9 +50,9 @@ class AvroFormatterTest extends MediaWikiTestCase {
                // disable conversion of notices
                PHPUnit_Framework_Error_Notice::$enabled = false;
                // have to keep the user notice from being output
-               \MediaWiki\suppressWarnings();
+               \Wikimedia\suppressWarnings();
                $res = $formatter->format( [ 'channel' => 'marty' ] );
-               \MediaWiki\restoreWarnings();
+               \Wikimedia\restoreWarnings();
                PHPUnit_Framework_Error_Notice::$enabled = $noticeEnabled;
                $this->assertNull( $res );
        }
index 31ad1ba..2cd4ba6 100644 (file)
@@ -2584,9 +2584,9 @@ class FileBackendTest extends MediaWikiTestCase {
                        ]
                ];
 
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $actual = $be->sanitizeOpHeaders( $input );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
 
                $this->assertEquals( $expected, $actual, "Header sanitized properly" );
        }
index 6734976..98494c4 100644 (file)
@@ -190,9 +190,9 @@ class JavaScriptMinifierTest extends PHPUnit_Framework_TestCase {
                // JSMin+'s parser will throw an exception if output is not valid JS.
                // suppression of warnings needed for stupid crap
                if ( $expectedValid ) {
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $parser = new JSParser();
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
                        $parser->parse( $minified, 'minify-test.js', 1 );
                }
 
index 54a31b5..28fc04a 100644 (file)
@@ -130,9 +130,9 @@ class PHPSessionHandlerTest extends MediaWikiTestCase {
                );
                $wrap->setEnableFlags( 'warn' );
 
-               \MediaWiki\suppressWarnings();
+               \Wikimedia\suppressWarnings();
                ini_set( 'session.serialize_handler', $handler );
-               \MediaWiki\restoreWarnings();
+               \Wikimedia\restoreWarnings();
                if ( ini_get( 'session.serialize_handler' ) !== $handler ) {
                        $this->markTestSkipped( "Cannot set session.serialize_handler to \"$handler\"" );
                }
index adf0f5d..f84d435 100644 (file)
@@ -365,9 +365,9 @@ class SessionTest extends MediaWikiTestCase {
                $hmac = hash_hmac( 'sha256', $sealed, $hmacKey, true );
                $encrypted = base64_encode( $hmac ) . '.' . $sealed;
                $session->set( 'test', $encrypted );
-               \MediaWiki\suppressWarnings();
+               \Wikimedia\suppressWarnings();
                $this->assertEquals( 'defaulted', $session->getSecret( 'test', 'defaulted' ) );
-               \MediaWiki\restoreWarnings();
+               \Wikimedia\restoreWarnings();
        }
 
 }
index d45a58c..217232e 100644 (file)
@@ -58,9 +58,9 @@ class AutoLoaderTest extends MediaWikiTestCase {
                                continue;
                        }
 
-                       MediaWiki\suppressWarnings();
+                       Wikimedia\suppressWarnings();
                        $contents = file_get_contents( $filePath );
-                       MediaWiki\restoreWarnings();
+                       Wikimedia\restoreWarnings();
 
                        if ( $contents === false ) {
                                $actual[$class] = "[couldn't read file '$filePath']";
index c4b40dc..3b71413 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -235,9 +235,9 @@ function wfStreamThumb( array $params ) {
                // Fix IE brokenness
                $imsString = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] );
                // Calculate time
-               MediaWiki\suppressWarnings();
+               Wikimedia\suppressWarnings();
                $imsUnix = strtotime( $imsString );
-               MediaWiki\restoreWarnings();
+               Wikimedia\restoreWarnings();
                if ( wfTimestamp( TS_UNIX, $img->getTimestamp() ) <= $imsUnix ) {
                        HttpStatus::header( 304 );
                        return;