From 39f0f919c5708f4c672a8eb7e0891f50bf16883e Mon Sep 17 00:00:00 2001 From: Reedy Date: Sat, 10 Feb 2018 07:52:26 +0000 Subject: [PATCH] Update suppressWarning()/restoreWarning() calls Bug: T182273 Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f --- includes/GitInfo.php | 4 +-- includes/GlobalFunctions.php | 36 +++++++++---------- includes/HistoryBlob.php | 8 ++--- includes/MediaWiki.php | 4 +-- includes/OutputPage.php | 4 +-- includes/Setup.php | 8 ++--- includes/WebRequest.php | 4 +-- includes/api/ApiMain.php | 4 +-- includes/api/ApiQueryImageInfo.php | 4 +-- includes/cache/CacheDependency.php | 8 ++--- includes/cache/FileCacheBase.php | 4 +-- .../cache/localisation/LocalisationCache.php | 8 ++--- includes/changes/RecentChange.php | 4 +-- includes/clientpool/SquidPurgeClient.php | 20 +++++------ includes/clientpool/SquidPurgeClientPool.php | 4 +-- includes/db/DatabaseOracle.php | 24 ++++++------- includes/debug/logger/LegacyLogger.php | 4 +-- includes/exception/MWExceptionHandler.php | 2 +- includes/filerepo/FileRepo.php | 4 +-- includes/http/CurlHttpRequest.php | 4 +-- includes/import/ImportStreamSource.php | 4 +-- includes/installer/DatabaseInstaller.php | 4 +-- includes/installer/Installer.php | 18 +++++----- includes/installer/SqliteInstaller.php | 4 +-- includes/libs/CryptRand.php | 8 ++--- .../libs/filebackend/FileBackendStore.php | 8 ++--- .../libs/filebackend/HTTPFileStreamer.php | 4 +-- .../libs/filebackend/MemoryFileBackend.php | 4 +-- .../libs/filebackend/SwiftFileBackend.php | 4 +-- .../libs/filebackend/fileop/StoreFileOp.php | 4 +-- includes/libs/filebackend/fsfile/FSFile.php | 8 ++--- .../libs/filebackend/fsfile/TempFSFile.php | 12 +++---- includes/libs/lockmanager/FSLockManager.php | 4 +-- includes/libs/mime/MimeAnalyzer.php | 8 ++--- includes/libs/objectcache/MemcachedClient.php | 4 +-- includes/libs/rdbms/database/Database.php | 10 +++--- .../libs/rdbms/database/DatabaseMssql.php | 6 ++-- .../libs/rdbms/database/DatabaseMysqlBase.php | 26 +++++++------- .../libs/rdbms/database/DatabasePostgres.php | 18 +++++----- includes/libs/xmp/XMP.php | 8 ++--- includes/logging/LogEntry.php | 4 +-- includes/mail/UserMailer.php | 8 ++--- includes/media/Bitmap.php | 4 +-- includes/media/DjVu.php | 8 ++--- includes/media/DjVuImage.php | 4 +-- includes/media/Exif.php | 12 +++---- includes/media/ExifBitmap.php | 8 ++--- includes/media/GIF.php | 12 +++---- includes/media/GIFMetadataExtractor.php | 4 +-- includes/media/IPTC.php | 4 +-- includes/media/ImageHandler.php | 4 +-- includes/media/JpegMetadataExtractor.php | 4 +-- includes/media/MediaHandler.php | 4 +-- includes/media/PNG.php | 12 +++---- includes/media/PNGMetadataExtractor.php | 16 ++++----- includes/media/SVG.php | 8 ++--- includes/media/SVGMetadataExtractor.php | 6 ++-- includes/media/WebP.php | 8 ++--- includes/media/XCF.php | 4 +-- includes/objectcache/SqlBagOStuff.php | 4 +-- includes/parser/Preprocessor_DOM.php | 8 ++--- includes/parser/Sanitizer.php | 24 ++++++------- .../resourceloader/ResourceLoaderModule.php | 4 +-- includes/search/SearchMySQL.php | 4 +-- includes/search/SearchSqlite.php | 4 +-- includes/skins/MediaWikiI18N.php | 4 +-- includes/specials/SpecialExport.php | 4 +-- includes/specials/SpecialLockdb.php | 4 +-- includes/specials/SpecialUnlockdb.php | 4 +-- includes/specials/pagers/ContribsPager.php | 4 +-- .../specials/pagers/DeletedContribsPager.php | 4 +-- includes/upload/UploadBase.php | 4 +-- includes/utils/ExecutableFinder.php | 4 +-- includes/utils/FileContentsHasher.php | 6 ++-- includes/utils/UIDGenerator.php | 4 +-- languages/Language.php | 8 ++--- maintenance/Maintenance.php | 4 +-- maintenance/benchmarks/benchmarkJSMinPlus.php | 4 +-- maintenance/dumpTextPass.php | 8 ++--- maintenance/install.php | 8 ++--- maintenance/jsparse.php | 4 +-- maintenance/language/StatOutputs.php | 8 ++--- maintenance/rebuildFileCache.php | 4 +-- maintenance/sqlite.php | 4 +-- maintenance/storage/fixT22757.php | 4 +-- maintenance/storage/recompressTracked.php | 4 +-- tests/parser/ParserTestResultNormalizer.php | 4 +-- tests/parser/fuzzTest.php | 4 +-- tests/phpunit/MediaWikiTestCase.php | 8 ++--- tests/phpunit/includes/CommentStoreTest.php | 4 +-- .../includes/GlobalFunctions/GlobalTest.php | 4 +-- tests/phpunit/includes/OutputPageTest.php | 4 +-- tests/phpunit/includes/RevisionDbTestBase.php | 4 +-- tests/phpunit/includes/RevisionTest.php | 8 ++--- .../includes/api/ApiErrorFormatterTest.php | 4 +-- tests/phpunit/includes/api/ApiMainTest.php | 4 +-- tests/phpunit/includes/api/ApiUploadTest.php | 8 ++--- .../includes/changes/RecentChangeTest.php | 4 +-- tests/phpunit/includes/db/LBFactoryTest.php | 4 +-- tests/phpunit/includes/debug/MWDebugTest.php | 4 +-- .../logger/monolog/AvroFormatterTest.php | 4 +-- .../includes/filebackend/FileBackendTest.php | 4 +-- .../includes/libs/JavaScriptMinifierTest.php | 4 +-- .../session/PHPSessionHandlerTest.php | 4 +-- .../phpunit/includes/session/SessionTest.php | 4 +-- tests/phpunit/structure/AutoLoaderTest.php | 4 +-- thumb.php | 4 +-- 107 files changed, 354 insertions(+), 354 deletions(-) diff --git a/includes/GitInfo.php b/includes/GitInfo.php index fb75c256d6..6270b27fdd 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -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. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a06d72100f..43428ac68f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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. diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 26a6d45bf8..1d4f6e4e8d 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -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; } diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 371f2cb4fb..6c932d2a2e 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -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 ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index e6345ba7ec..6b44a557b4 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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" ); diff --git a/includes/Setup.php b/includes/Setup.php index c9fe8d0fe8..0ff2d6c2f6 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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 ); diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 7bfb5a43e4..0a7f416cff 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -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'] : ''; diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 2c2dd9ab23..1691caba04 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -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; diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index fd456cbea8..e447f4f487 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -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 ); } diff --git a/includes/cache/CacheDependency.php b/includes/cache/CacheDependency.php index 32dc8c0bea..4ff10047a4 100644 --- a/includes/cache/CacheDependency.php +++ b/includes/cache/CacheDependency.php @@ -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 diff --git a/includes/cache/FileCacheBase.php b/includes/cache/FileCacheBase.php index f2da08a394..ce5a019b7c 100644 --- a/includes/cache/FileCacheBase.php +++ b/includes/cache/FileCacheBase.php @@ -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; } diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index 26382aab1e..dd9e8e194a 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -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 ); diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 678e39aa83..dfaa39816e 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -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; } diff --git a/includes/clientpool/SquidPurgeClient.php b/includes/clientpool/SquidPurgeClient.php index be802f9bec..3388860508 100644 --- a/includes/clientpool/SquidPurgeClient.php +++ b/includes/clientpool/SquidPurgeClient.php @@ -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 ) { diff --git a/includes/clientpool/SquidPurgeClientPool.php b/includes/clientpool/SquidPurgeClientPool.php index 7b327d653d..f6109f1d88 100644 --- a/includes/clientpool/SquidPurgeClientPool.php +++ b/includes/clientpool/SquidPurgeClientPool.php @@ -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" ); diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 90fabaf5c4..eb28b30138 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -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 ) { diff --git a/includes/debug/logger/LegacyLogger.php b/includes/debug/logger/LegacyLogger.php index 06ec5743fc..7bd505d089 100644 --- a/includes/debug/logger/LegacyLogger.php +++ b/includes/debug/logger/LegacyLogger.php @@ -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(); } } diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index b125f58c48..78a5df961b 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -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 ); diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 6b32953449..e430bc8f43 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -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; diff --git a/includes/http/CurlHttpRequest.php b/includes/http/CurlHttpRequest.php index 3da3eb325c..44bdddbaab 100644 --- a/includes/http/CurlHttpRequest.php +++ b/includes/http/CurlHttpRequest.php @@ -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 ) { diff --git a/includes/import/ImportStreamSource.php b/includes/import/ImportStreamSource.php index 94a2b937e0..cf382e4804 100644 --- a/includes/import/ImportStreamSource.php +++ b/includes/import/ImportStreamSource.php @@ -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" ); } diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 62acebf382..e6ee70edfd 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -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' ); diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 439b370ce2..f22b63dbdb 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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(); } } diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index 31718fefa0..6f168720c7 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -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 ); } diff --git a/includes/libs/CryptRand.php b/includes/libs/CryptRand.php index 859d58b5dd..474c564aeb 100644 --- a/includes/libs/CryptRand.php +++ b/includes/libs/CryptRand.php @@ -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 diff --git a/includes/libs/filebackend/FileBackendStore.php b/includes/libs/filebackend/FileBackendStore.php index dba5a1c700..06b263a8c6 100644 --- a/includes/libs/filebackend/FileBackendStore.php +++ b/includes/libs/filebackend/FileBackendStore.php @@ -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; diff --git a/includes/libs/filebackend/HTTPFileStreamer.php b/includes/libs/filebackend/HTTPFileStreamer.php index 9730acb8cd..9f8959cba0 100644 --- a/includes/libs/filebackend/HTTPFileStreamer.php +++ b/includes/libs/filebackend/HTTPFileStreamer.php @@ -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 ) { diff --git a/includes/libs/filebackend/MemoryFileBackend.php b/includes/libs/filebackend/MemoryFileBackend.php index 0341a2af1d..548c85c85d 100644 --- a/includes/libs/filebackend/MemoryFileBackend.php +++ b/includes/libs/filebackend/MemoryFileBackend.php @@ -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'] ); diff --git a/includes/libs/filebackend/SwiftFileBackend.php b/includes/libs/filebackend/SwiftFileBackend.php index e606162a28..bce83348d7 100644 --- a/includes/libs/filebackend/SwiftFileBackend.php +++ b/includes/libs/filebackend/SwiftFileBackend.php @@ -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'] ); diff --git a/includes/libs/filebackend/fileop/StoreFileOp.php b/includes/libs/filebackend/fileop/StoreFileOp.php index bba762f0dd..69ae47f428 100644 --- a/includes/libs/filebackend/fileop/StoreFileOp.php +++ b/includes/libs/filebackend/fileop/StoreFileOp.php @@ -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 ); } diff --git a/includes/libs/filebackend/fsfile/FSFile.php b/includes/libs/filebackend/fsfile/FSFile.php index dacad1cb26..553c9aaf17 100644 --- a/includes/libs/filebackend/fsfile/FSFile.php +++ b/includes/libs/filebackend/fsfile/FSFile.php @@ -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 ); diff --git a/includes/libs/filebackend/fsfile/TempFSFile.php b/includes/libs/filebackend/fsfile/TempFSFile.php index fed6812f5b..00d2028790 100644 --- a/includes/libs/filebackend/fsfile/TempFSFile.php +++ b/includes/libs/filebackend/fsfile/TempFSFile.php @@ -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(); } } diff --git a/includes/libs/lockmanager/FSLockManager.php b/includes/libs/lockmanager/FSLockManager.php index 7f33a0abdf..f2624e721a 100644 --- a/includes/libs/lockmanager/FSLockManager.php +++ b/includes/libs/lockmanager/FSLockManager.php @@ -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 diff --git a/includes/libs/mime/MimeAnalyzer.php b/includes/libs/mime/MimeAnalyzer.php index 4d860bb593..8d842cbb7b 100644 --- a/includes/libs/mime/MimeAnalyzer.php +++ b/includes/libs/mime/MimeAnalyzer.php @@ -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']; diff --git a/includes/libs/objectcache/MemcachedClient.php b/includes/libs/objectcache/MemcachedClient.php index b937736d4f..59131b976a 100644 --- a/includes/libs/objectcache/MemcachedClient.php +++ b/includes/libs/objectcache/MemcachedClient.php @@ -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" ); diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index f3877fbe1e..d1814e18b5 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -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; } diff --git a/includes/libs/rdbms/database/DatabaseMssql.php b/includes/libs/rdbms/database/DatabaseMssql.php index 832ed9e11e..9a0e8c9cf5 100644 --- a/includes/libs/rdbms/database/DatabaseMssql.php +++ b/includes/libs/rdbms/database/DatabaseMssql.php @@ -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() ); diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index fcedf56958..bd2d274cc5 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -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(); } diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 5bf845b1af..8fbb7de7ce 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -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 ) ) { diff --git a/includes/libs/xmp/XMP.php b/includes/libs/xmp/XMP.php index 88e816a72a..1955915890 100644 --- a/includes/libs/xmp/XMP.php +++ b/includes/libs/xmp/XMP.php @@ -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; diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 16b3593dd2..35502c78d2 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -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; diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php index cb07fd5c58..fb0f2f99f0 100644 --- a/includes/mail/UserMailer.php +++ b/includes/mail/UserMailer.php @@ -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() diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 617a910295..712906e0e7 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -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' diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index eb7b6ba08e..2541e35bc5 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -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 ]; } diff --git a/includes/media/DjVuImage.php b/includes/media/DjVuImage.php index d25111c445..adcac2523a 100644 --- a/includes/media/DjVuImage.php +++ b/includes/media/DjVuImage.php @@ -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" ); diff --git a/includes/media/Exif.php b/includes/media/Exif.php index cd457f0bec..a38e79b725 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -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(); } } diff --git a/includes/media/ExifBitmap.php b/includes/media/ExifBitmap.php index 0e10abb9f9..426721095c 100644 --- a/includes/media/ExifBitmap.php +++ b/includes/media/ExifBitmap.php @@ -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'] ) { diff --git a/includes/media/GIF.php b/includes/media/GIF.php index 5f23855c81..d65f872634 100644 --- a/includes/media/GIF.php +++ b/includes/media/GIF.php @@ -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; diff --git a/includes/media/GIFMetadataExtractor.php b/includes/media/GIFMetadataExtractor.php index ac5fc81c9a..a26539a87a 100644 --- a/includes/media/GIFMetadataExtractor.php +++ b/includes/media/GIFMetadataExtractor.php @@ -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 ); diff --git a/includes/media/IPTC.php b/includes/media/IPTC.php index ef7ed5f5a2..441c515f89 100644 --- a/includes/media/IPTC.php +++ b/includes/media/IPTC.php @@ -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" ); diff --git a/includes/media/ImageHandler.php b/includes/media/ImageHandler.php index 1eefddbd4f..a0a160321c 100644 --- a/includes/media/ImageHandler.php +++ b/includes/media/ImageHandler.php @@ -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; } diff --git a/includes/media/JpegMetadataExtractor.php b/includes/media/JpegMetadataExtractor.php index 211845cc8f..229a891db8 100644 --- a/includes/media/JpegMetadataExtractor.php +++ b/includes/media/JpegMetadataExtractor.php @@ -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. diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index 5dca24bcba..c76930cfc7 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -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; } diff --git a/includes/media/PNG.php b/includes/media/PNG.php index b6288bc3f4..6748b26b09 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -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; diff --git a/includes/media/PNGMetadataExtractor.php b/includes/media/PNGMetadataExtractor.php index c12ca0bf10..78ed0bcdc5 100644 --- a/includes/media/PNGMetadataExtractor.php +++ b/includes/media/PNGMetadataExtractor.php @@ -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)" ); diff --git a/includes/media/SVG.php b/includes/media/SVG.php index 10be97a5cd..9085421af8 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -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 { diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index 9b22cbee1a..fc93b2331f 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -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 ); } diff --git a/includes/media/WebP.php b/includes/media/WebP.php index e0af6def45..295a9785b5 100644 --- a/includes/media/WebP.php +++ b/includes/media/WebP.php @@ -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; diff --git a/includes/media/XCF.php b/includes/media/XCF.php index 1b6c4c87ed..491fef2182 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -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; } diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 6691f73d2e..6d35658151 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -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; diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 4db2855570..81243f3c6d 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -86,9 +86,9 @@ class Preprocessor_DOM extends Preprocessor { $xml .= ""; $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 ); diff --git a/includes/parser/Sanitizer.php b/includes/parser/Sanitizer.php index de7a6fa501..b13e59787f 100644 --- a/includes/parser/Sanitizer.php +++ b/includes/parser/Sanitizer.php @@ -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(); #
  • can be nested in