-The development of this software is covered by a [Code of Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).
+The development of this software is covered by a [Code of Conduct](https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct).
This action should be considered deprecated and should not be used directly.
* Extensions overriding ContentHandler::getUndoContent() will need to be
updated for the changed method signature.
+* Added a new hook, 'UserGetRightsRemove', which can be used to remove rights
+ from user. Unlike the 'UserGetRights' it will ensure that removed rights
+ will not be reinserted.
=== External library changes in 1.32 ===
* The '--tidy' option to maintenance/parse.php has been removed. Tidying
the output is now the default. Use '--no-tidy' to bypass the tidy
phase.
+* The global function wfErrorLog, deprecated since 1.25, has now been removed.
+ Use MWLoggerLegacyLogger::emit or UDPTransport.
=== Deprecations in 1.32 ===
* HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit
* QuickTemplate::msgHtml() and BaseTemplate::msgHtml() have been deprecated
as they promote bad practises. I18n messages should always be properly
escaped.
+* Skin::getDynamicStylesheetQuery() has been deprecated. It always
+ returns action=raw&ctype=text/css which callers should use directly.
+* Class LegacyFormatter is deprecated.
=== Other changes in 1.32 ===
* (T198811) The following tables have had their UNIQUE indexes turned into
$user: User to get rights for
&$rights: Current rights
+'UserGetRightsRemove': Called in User::getRights(). This hook override
+the UserGetRights hook. It can be used to remove rights from user
+and ensure that will not be reinserted by the other hook callbacks
+therefore this hook should not be used to add any rights, use UserGetRights instead.
+$user: User to get rights for
+&$rights: Current rights
+
'UserGroupsChanged': Called after user groups are changed.
$user: User whose groups changed
$added: Groups added
*
* @param string|null|bool $text Text to unserialize
* @return Content|bool|null The content object created from $text. If $text was false
- * or null, false resp. null will be returned instead.
+ * or null, then false or null will be returned instead.
*
* @throws MWException If unserializing the text results in a Content
* object that is not an instance of TextContent and
MWDebug::warning( $msg, $callerOffset + 1, $level, 'production' );
}
-/**
- * Log to a file without getting "file size exceeded" signals.
- *
- * Can also log to TCP or UDP with the syntax udp://host:port/prefix. This will
- * send lines to the specified port, prefixed by the specified prefix and a space.
- * @since 1.25 support for additional context data
- *
- * @param string $text
- * @param string $file Filename
- * @param array $context Additional logging context data
- * @throws MWException
- * @deprecated since 1.25 Use \MediaWiki\Logger\LegacyLogger::emit or UDPTransport
- */
-function wfErrorLog( $text, $file, array $context = [] ) {
- wfDeprecated( __METHOD__, '1.25' );
- $logger = LoggerFactory::getInstance( 'wfErrorLog' );
- $context['destination'] = $file;
- $logger->info( trim( $text ), $context );
-}
-
/**
* @todo document
* @todo Move logic to MediaWiki.php
*/
public static function numberingroup( $group ) {
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ $fname = __METHOD__;
return $cache->getWithSetCallback(
$cache->makeKey( 'SiteStats', 'groupcounts', $group ),
$cache::TTL_HOUR,
- function ( $oldValue, &$ttl, array &$setOpts ) use ( $group ) {
+ function ( $oldValue, &$ttl, array &$setOpts ) use ( $group, $fname ) {
$dbr = self::getLB()->getConnection( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
'ug_group' => $group,
'ug_expiry IS NULL OR ug_expiry >= ' . $dbr->addQuotes( $dbr->timestamp() )
],
- __METHOD__
+ $fname
);
},
[ 'pcTTL' => $cache::TTL_PROC_LONG ]
*/
public static function pagesInNs( $ns ) {
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ $fname = __METHOD__;
return $cache->getWithSetCallback(
$cache->makeKey( 'SiteStats', 'page-in-namespace', $ns ),
$cache::TTL_HOUR,
- function ( $oldValue, &$ttl, array &$setOpts ) use ( $ns ) {
+ function ( $oldValue, &$ttl, array &$setOpts ) use ( $ns, $fname ) {
$dbr = self::getLB()->getConnection( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
'page',
'COUNT(*)',
[ 'page_namespace' => $ns ],
- __METHOD__
+ $fname
);
},
[ 'pcTTL' => $cache::TTL_PROC_LONG ]
if ( array_key_exists( $id, $table ) ) {
return $table[$id];
}
+ $fname = __METHOD__;
$table = $this->cache->getWithSetCallback(
$this->getCacheKey(),
$this->cacheTTL,
- function ( $oldValue, &$ttl, &$setOpts ) use ( $id ) {
+ function ( $oldValue, &$ttl, &$setOpts ) use ( $id, $fname ) {
// Check if cached value is up-to-date enough to have $id
if ( is_array( $oldValue ) && array_key_exists( $id, $oldValue ) ) {
// Completely leave the cache key alone
// Log a fallback to master
if ( $source === DB_MASTER ) {
$this->logger->info(
- __METHOD__ . 'falling back to master select from ' .
+ $fname . ' falling back to master select from ' .
$this->table . ' with id ' . $id
);
}
}
/**
- * Get the default message text or false if the message doesn't exist
+ * Get the default (plain) message contents for an page that overrides an
+ * interface message key.
+ *
+ * Primary use cases:
+ *
+ * - Article:
+ * - Show default when viewing the page. The Article::getSubstituteContent
+ * method displays the default message content, instead of the
+ * 'noarticletext' placeholder message normally used.
+ *
+ * - EditPage:
+ * - Title of edit page. When creating an interface message override,
+ * the editor is told they are "Editing the page", instead of
+ * "Creating the page". (EditPage::setHeaders)
+ * - Edit notice. The 'translateinterface' edit notice is shown when creating
+ * or editing a an interface message override. (EditPage::showIntro)
+ * - Opening the editor. The contents of the localisation message are used
+ * as contents of the editor when creating a new page in the MediaWiki
+ * namespace. This simplifies the process for editors when "changing"
+ * an interface message by creating an override. (EditPage::getContentObject)
+ * - Showing a diff. The left-hand side of a diff when an editor is
+ * previewing their changes before saving the creation of a page in the
+ * MediaWiki namespace. (EditPage::showDiff)
+ * - Disallowing a save. When attempting to create a a MediaWiki-namespace
+ * page with the proposed content matching the interface message default,
+ * the save is rejected, the same way we disallow blank pages from being
+ * created. (EditPage::internalAttemptSave)
+ *
+ * - ApiEditPage:
+ * - Default content, when using the 'prepend' or 'append' feature.
+ *
+ * - SkinTemplate:
+ * - Label the create action as "Edit", if the page can be an override.
*
* @return string|bool
*/
$title = $this->getTitle();
$request = $this->getRequest();
- // If it's a MediaWiki message we can just hit the message cache
- if ( $request->getBool( 'usemsgcache' ) && $title->getNamespace() == NS_MEDIAWIKI ) {
- // The first "true" is to use the database, the second is to use
- // the content langue and the last one is to specify the message
- // key already contains the language in it ("/de", etc.).
- $text = MessageCache::singleton()->get( $title->getDBkey(), true, true, true );
- // If the message doesn't exist, return a blank
- if ( $text === false ) {
- $text = '';
- }
- } else {
- // Get it from the DB
- $rev = Revision::newFromTitle( $title, $this->getOldId() );
- if ( $rev ) {
- $lastmod = wfTimestamp( TS_RFC2822, $rev->getTimestamp() );
- $request->response()->header( "Last-modified: $lastmod" );
+ // Get it from the DB
+ $rev = Revision::newFromTitle( $title, $this->getOldId() );
+ if ( $rev ) {
+ $lastmod = wfTimestamp( TS_RFC2822, $rev->getTimestamp() );
+ $request->response()->header( "Last-modified: $lastmod" );
- // Public-only due to cache headers
- $content = $rev->getContent();
+ // Public-only due to cache headers
+ $content = $rev->getContent();
- if ( $content === null ) {
- // revision not found (or suppressed)
+ if ( $content === null ) {
+ // revision not found (or suppressed)
+ $text = false;
+ } elseif ( !$content instanceof TextContent ) {
+ // non-text content
+ wfHttpError( 415, "Unsupported Media Type", "The requested page uses the content model `"
+ . $content->getModel() . "` which is not supported via this interface." );
+ die();
+ } else {
+ // want a section?
+ $section = $request->getIntOrNull( 'section' );
+ if ( $section !== null ) {
+ $content = $content->getSection( $section );
+ }
+
+ if ( $content === null || $content === false ) {
+ // section not found (or section not supported, e.g. for JS, JSON, and CSS)
$text = false;
- } elseif ( !$content instanceof TextContent ) {
- // non-text content
- wfHttpError( 415, "Unsupported Media Type", "The requested page uses the content model `"
- . $content->getModel() . "` which is not supported via this interface." );
- die();
} else {
- // want a section?
- $section = $request->getIntOrNull( 'section' );
- if ( $section !== null ) {
- $content = $content->getSection( $section );
- }
-
- if ( $content === null || $content === false ) {
- // section not found (or section not supported, e.g. for JS, JSON, and CSS)
- $text = false;
- } else {
- $text = $content->getNativeData();
- }
+ $text = $content->getNativeData();
}
}
}
$title = $page->getTitle();
$key = self::getStashKey( $title, self::getContentHash( $content ), $user );
+ $fname = __METHOD__;
// Use the master DB to allow for fast blocking locks on the "save path" where this
// value might actually be used to complete a page edit. If the edit submission request
// need to duplicate parsing of the same content/user/summary bundle, so try to avoid
// blocking at all here.
$dbw = wfGetDB( DB_MASTER );
- if ( !$dbw->lock( $key, __METHOD__, 0 ) ) {
+ if ( !$dbw->lock( $key, $fname, 0 ) ) {
// De-duplicate requests on the same key
return self::ERROR_BUSY;
}
/** @noinspection PhpUnusedLocalVariableInspection */
- $unlocker = new ScopedCallback( function () use ( $dbw, $key ) {
- $dbw->unlock( $key, __METHOD__ );
+ $unlocker = new ScopedCallback( function () use ( $dbw, $key, $fname ) {
+ $dbw->unlock( $key, $fname );
} );
$cutoffTime = time() - self::PRESUME_FRESH_TTL_SEC;
// @codeCoverageIgnoreStart
if ( $this->getPasswordFactory()->needsUpdate( $pwhash ) ) {
$newHash = $this->getPasswordFactory()->newFromPlaintext( $req->password );
- \DeferredUpdates::addCallableUpdate( function () use ( $newHash, $oldRow ) {
+ $fname = __METHOD__;
+ \DeferredUpdates::addCallableUpdate( function () use ( $newHash, $oldRow, $fname ) {
$dbw = wfGetDB( DB_MASTER );
$dbw->update(
'user',
'user_id' => $oldRow->user_id,
'user_password' => $oldRow->user_password
],
- __METHOD__
+ $fname
);
} );
}
// Ignore $wgMaxMsgCacheEntrySize so the process cache is up to date
$this->cache->setField( $code, $title, ' ' . $text );
}
+ $fname = __METHOD__;
// (b) Update the shared caches in a deferred update with a fresh DB snapshot
DeferredUpdates::addCallableUpdate(
- function () use ( $title, $msg, $code ) {
+ function () use ( $title, $msg, $code, $fname ) {
global $wgMaxMsgCacheEntrySize;
// Allow one caller at a time to avoid race conditions
$scopedLock = $this->getReentrantScopedLock(
);
if ( !$scopedLock ) {
LoggerFactory::getInstance( 'MessageCache' )->error(
- __METHOD__ . ': could not acquire lock to update {title} ({code})',
+ $fname . ': could not acquire lock to update {title} ({code})',
[ 'title' => $title, 'code' => $code ] );
return;
}
* @return string Either " <MESSAGE>" or "!NONEXISTANT"
*/
private function loadCachedMessagePageEntry( $dbKey, $code, $hash ) {
+ $fname = __METHOD__;
return $this->srvCache->getWithSetCallback(
$this->srvCache->makeKey( 'messages-big', $hash, $dbKey ),
IExpiringStore::TTL_MINUTE,
- function () use ( $code, $dbKey, $hash ) {
+ function () use ( $code, $dbKey, $hash, $fname ) {
return $this->wanCache->getWithSetCallback(
$this->bigMessageCacheKey( $hash, $dbKey ),
$this->mExpiry,
- function ( $oldValue, &$ttl, &$setOpts ) use ( $dbKey, $code ) {
+ function ( $oldValue, &$ttl, &$setOpts ) use ( $dbKey, $code, $fname ) {
// Try loading the message from the database
$dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr );
$message = $this->getMessageTextFromContent( $content );
} else {
LoggerFactory::getInstance( 'MessageCache' )->warning(
- __METHOD__ . ': failed to load page text for \'{titleKey}\'',
+ $fname . ': failed to load page text for \'{titleKey}\'',
[ 'titleKey' => $dbKey, 'code' => $code ]
);
$message = null;
) {
return false;
}
- $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
+ $attribs = array_filter( $attribs,
+ [ Sanitizer::class, 'isReservedDataAttribute' ],
+ ARRAY_FILTER_USE_KEY
+ );
$dateheader = ''; // $html now contains only <li>...</li>, for hooks' convenience.
$this->insertDateHeader( $dateheader, $rc->mAttribs['rc_timestamp'] );
use UDPTransport;
/**
- * PSR-3 logger that mimics the historic implementation of MediaWiki's
+ * PSR-3 logger that mimics the historic implementation of MediaWiki's former
* wfErrorLog logging implementation.
*
* This logger is configured by the following global configuration variables:
// specfied.
$shouldEmit = (bool)$wgDBerrorLog;
- } elseif ( $channel === 'wfErrorLog' ) {
- // All messages on the wfErrorLog channel should be emitted.
- $shouldEmit = true;
-
} elseif ( $channel === 'wfDebug' ) {
// wfDebug messages are emitted if a catch all logging file has
// been specified. Checked explicitly so that 'private' flagged
/**
* Format a message.
*
- * Messages to the 'wfDebug', 'wfLogDBError' and 'wfErrorLog' channels
- * receive special formatting to mimic the historic output of the functions
- * of the same name. All other channel values are formatted based on the
- * historic output of the `wfDebugLog()` global function.
+ * Messages to the 'wfDebug' and 'wfLogDBError' channels receive special formatting to mimic the
+ * historic output of the functions of the same name. All other channel values are formatted
+ * based on the historic output of the `wfDebugLog()` global function.
*
* @param string $channel
* @param string $message
} elseif ( $channel === 'wfLogDBError' ) {
$text = self::formatAsWfLogDBError( $channel, $message, $context );
- } elseif ( $channel === 'wfErrorLog' ) {
- $text = "{$message}\n";
-
} elseif ( $channel === 'profileoutput' ) {
// Legacy wfLogProfilingData formatitng
$forward = '';
use Monolog\Formatter\NormalizerFormatter;
/**
- * Log message formatter that mimics the legacy log message formatting of
- * `wfDebug`, `wfDebugLog`, `wfLogDBError` and `wfErrorLog` global functions by
- * delegating the formatting to \MediaWiki\Logger\LegacyLogger.
+ * Log message formatter that mimics the legacy log message formatting of `wfDebug`, `wfDebugLog`,
+ * `wfLogDBError` and the former `wfErrorLog` global functions by delegating the formatting to
+ * \MediaWiki\Logger\LegacyLogger.
*
+ * @deprecated since 1.32
* @since 1.25
* @copyright © 2013 Wikimedia Foundation and contributors
* @see \MediaWiki\Logger\LegacyLogger
use UnexpectedValueException;
/**
- * Log handler that replicates the behavior of MediaWiki's wfErrorLog()
+ * Log handler that replicates the behavior of MediaWiki's former wfErrorLog()
* logging service. Log output can be directed to a local file, a PHP stream,
* or a udp2log server.
*
*/
public function getDescriptionStylesheetUrl() {
if ( isset( $this->scriptDirUrl ) ) {
- return $this->makeUrl( 'title=MediaWiki:Filepage.css&' .
- wfArrayToCgi( Skin::getDynamicStylesheetQuery() ) );
+ // Must match canonical query parameter order for optimum caching
+ // See Title::getCdnUrls
+ return $this->makeUrl( 'title=MediaWiki:Filepage.css&action=raw&ctype=text/css' );
}
return false;
$lang->getCode(),
md5( $this->getName() )
);
+ $fname = __METHOD__;
return $cache->getWithSetCallback(
$key,
$this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
- function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) {
+ function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
wfDebug( "Fetching shared description from $renderUrl\n" );
- $res = Http::get( $renderUrl, [], __METHOD__ );
+ $res = Http::get( $renderUrl, [], $fname );
if ( !$res ) {
$ttl = WANObjectCache::TTL_UNCACHEABLE;
}
}
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ $fname = __METHOD__;
return $cache->getWithSetCallback(
$this->repo->getLocalCacheKey(
$touched
),
$this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
- function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) {
+ function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
wfDebug( "Fetching shared description from $renderUrl\n" );
- $res = Http::get( $renderUrl, [], __METHOD__ );
+ $res = Http::get( $renderUrl, [], $fname );
if ( !$res ) {
$ttl = WANObjectCache::TTL_UNCACHEABLE;
}
# Defer purges, page creation, and link updates in case they error out.
# The most important thing is that files and the DB registry stay synced.
$dbw->endAtomic( __METHOD__ );
+ $fname = __METHOD__;
# Do some cache purges after final commit so that:
# a) Changes are more likely to be seen post-purge
__METHOD__,
function () use (
$reupload, $wikiPage, $newPageContent, $comment, $user,
- $logEntry, $logId, $descId, $tags
+ $logEntry, $logId, $descId, $tags, $fname
) {
# Update memcache after the commit
$this->invalidateCache();
'logging',
$update,
[ 'log_id' => $logId ],
- __METHOD__
+ $fname
);
$this->getRepo()->getMasterDB()->insert(
'log_search',
'ls_value' => $logEntry->getAssociatedRevId(),
'ls_log_id' => $logId,
],
- __METHOD__
+ $fname
);
# Add change tags, if any
return parent::getRaw( $value );
}
+ /**
+ * @param mixed $value
+ * @return OOUI\FieldLayout
+ * @since 1.32
+ */
+ public function getOOUI( $value ) {
+ if ( !empty( $this->mParams['rawrow'] ) ) {
+ if ( !( $value instanceof OOUI\FieldLayout ) ) {
+ throw new Exception( "'default' must be a FieldLayout or subclass when using 'rawrow'" );
+ }
+ return $value;
+ }
+
+ return parent::getOOUI( $value );
+ }
+
protected function needsLabel() {
return false;
}
}
}
+ $fname = __METHOD__;
$iwData = $this->objectCache->getWithSetCallback(
$this->objectCache->makeKey( 'interwiki', $prefix ),
$this->objectCacheExpiry,
- function ( $oldValue, &$ttl, array &$setOpts ) use ( $prefix ) {
+ function ( $oldValue, &$ttl, array &$setOpts ) use ( $prefix, $fname ) {
$dbr = wfGetDB( DB_REPLICA ); // TODO: inject LoadBalancer
$setOpts += Database::getCacheSetOptions( $dbr );
'interwiki',
self::selectFields(),
[ 'iw_prefix' => $prefix ],
- __METHOD__
+ $fname
);
return $row ? (array)$row : '!NONEXISTENT';
if ( $dbkeys === [] ) {
return;
}
+ $fname = __METHOD__;
DeferredUpdates::addUpdate( new AutoCommitUpdate(
$dbw,
__METHOD__,
- function () use ( $dbw, $namespace, $dbkeys ) {
+ function () use ( $dbw, $namespace, $dbkeys, $fname ) {
$services = MediaWikiServices::getInstance();
$lbFactory = $services->getDBLoadBalancerFactory();
// Determine which pages need to be updated.
'page_title' => $dbkeys,
'page_touched < ' . $dbw->addQuotes( $now )
],
- __METHOD__
+ $fname
);
if ( !$ids ) {
}
$batchSize = $services->getMainConfig()->get( 'UpdateRowsPerQuery' );
- $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
+ $ticket = $lbFactory->getEmptyTransactionTicket( $fname );
foreach ( array_chunk( $ids, $batchSize ) as $idBatch ) {
$dbw->update(
'page',
'page_id' => $idBatch,
'page_touched < ' . $dbw->addQuotes( $now ) // handle races
],
- __METHOD__
+ $fname
);
- $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
+ $lbFactory->commitAndWaitForReplication( $fname, $ticket );
}
}
) );
// Using one key for all cluster replica DBs is preferable
$this->getLBInfo( 'clusterMasterHost' ) ?: $this->getServer()
);
+ $fname = __METHOD__;
return $cache->getWithSetCallback(
$key,
$cache::TTL_INDEFINITE,
- function () use ( $cache, $key ) {
+ function () use ( $cache, $key, $fname ) {
// Get and leave a lock key in place for a short period
if ( !$cache->lock( $key, 0, 10 ) ) {
return false; // avoid master connection spike slams
// Connect to and query the master; catch errors to avoid outages
try {
- $res = $conn->query( 'SELECT @@server_id AS id', __METHOD__ );
+ $res = $conn->query( 'SELECT @@server_id AS id', $fname );
$row = $res ? $res->fetchObject() : false;
$id = $row ? (int)$row->id : 0;
} catch ( DBError $e ) {
* @throws DBQueryError If the variable doesn't exist for some reason
*/
protected function getServerId() {
+ $fname = __METHOD__;
return $this->srvCache->getWithSetCallback(
$this->srvCache->makeGlobalKey( 'mysql-server-id', $this->getServer() ),
self::SERVER_ID_CACHE_TTL,
- function () {
- $res = $this->query( "SELECT @@server_id AS id", __METHOD__ );
+ function () use ( $fname ) {
+ $res = $this->query( "SELECT @@server_id AS id", $fname );
return intval( $this->fetchObject( $res )->id );
}
);
}
public function closeAll() {
- $this->forEachOpenConnection( function ( IDatabase $conn ) {
+ $fname = __METHOD__;
+ $this->forEachOpenConnection( function ( IDatabase $conn ) use ( $fname ) {
$host = $conn->getServer();
$this->connLogger->debug(
- __METHOD__ . ": closing connection to database '$host'." );
+ $fname . ": closing connection to database '$host'." );
$conn->close();
} );
} );
$e = null; // first exception
+ $fname = __METHOD__;
// Loop until callbacks stop adding callbacks on other connections
do {
// Run any pending callbacks for each connection...
}
);
// Clear out any active transactions left over from callbacks...
- $this->forEachOpenMasterConnection( function ( Database $conn ) use ( &$e ) {
+ $this->forEachOpenMasterConnection( function ( Database $conn ) use ( &$e, $fname ) {
if ( $conn->writesPending() ) {
// A callback from another handle wrote to this one and DBO_TRX is set
- $this->queryLogger->warning( __METHOD__ . ": found writes pending." );
+ $this->queryLogger->warning( $fname . ": found writes pending." );
$fnames = implode( ', ', $conn->pendingWriteAndCallbackCallers() );
$this->queryLogger->warning(
- __METHOD__ . ": found writes pending ($fnames).",
+ $fname . ": found writes pending ($fnames).",
[
'db_server' => $conn->getServer(),
'db_name' => $conn->getDBname()
} elseif ( $conn->trxLevel() ) {
// A callback from another handle read from this one and DBO_TRX is set,
// which can easily happen if there is only one DB (no replicas)
- $this->queryLogger->debug( __METHOD__ . ": found empty transaction." );
+ $this->queryLogger->debug( $fname . ": found empty transaction." );
}
try {
- $conn->commit( __METHOD__, $conn::FLUSHING_ALL_PEERS );
+ $conn->commit( $fname, $conn::FLUSHING_ALL_PEERS );
} catch ( Exception $ex ) {
$e = $e ?: $ex;
}
/**
* Get the query to generate a dynamic stylesheet
*
+ * @deprecated since 1.32 Use action=raw&ctype=text/css directly.
* @return array
*/
public static function getDynamicStylesheetQuery() {
- global $wgSquidMaxage;
-
return [
'action' => 'raw',
- 'maxage' => $wgSquidMaxage,
- 'usemsgcache' => 'yes',
'ctype' => 'text/css',
- 'smaxage' => $wgSquidMaxage,
];
}
// Certain names may be reserved for batch processes.
foreach ( $reservedUsernames as $reserved ) {
if ( substr( $reserved, 0, 4 ) == 'msg:' ) {
- $reserved = wfMessage( substr( $reserved, 4 ) )->inContentLanguage()->text();
+ $reserved = wfMessage( substr( $reserved, 4 ) )->inContentLanguage()->plain();
}
if ( $reserved == $name ) {
return false;
}
}
+ Hooks::run( 'UserGetRightsRemove', [ $this, &$this->mRights ] );
// Force reindexation of rights when a hook has unset one of them
$this->mRights = array_values( array_unique( $this->mRights ) );
'user',
'user_id',
[ 'user_name' => $this->mName ],
- __METHOD__,
+ $fname,
[ 'LOCK IN SHARE MODE' ]
);
$loaded = false;
}
}
if ( !$loaded ) {
- throw new MWException( __METHOD__ . ": hit a key conflict attempting " .
+ throw new MWException( $fname . ": hit a key conflict attempting " .
"to insert user '{$this->mName}' row, but it was not present in select!" );
}
return Status::newFatal( 'userexists' );
$dbw = $this->getConnectionRef( DB_MASTER );
$factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
- $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
+ $ticket = $factory->getEmptyTransactionTicket( $fname );
$watchersChunks = array_chunk( $watchers, $wgUpdateRowsPerQuery );
foreach ( $watchersChunks as $watchersChunk ) {
);
if ( count( $watchersChunks ) > 1 ) {
$factory->commitAndWaitForReplication(
- __METHOD__, $ticket, [ 'domain' => $dbw->getDomainID() ]
+ $fname, $ticket, [ 'domain' => $dbw->getDomainID() ]
);
}
}
$this->mCyLa2Arab = [
# # Punctuation -> Arabic
- '/#|№|No\./u' => '', # ؀
- '/\,/' => '،', # ،
- '/;/' => '؛', # ؛
- '/\?/' => '؟', # ؟
- '/%/' => '٪', # ٪
- '/\*/' => '٭', # ٭
+ '/#|№|No\./u' => '', # U+0600
+ '/\,/' => '،', # U+060C
+ '/;/' => '؛', # U+061B
+ '/\?/' => '؟', # U+061F
+ '/%/' => '٪', # U+066A
+ '/\*/' => '٭', # U+066D
# # Digits -> Arabic
- '/0/' => '۰', # ۰
- '/1/' => '۱', # ۱
- '/2/' => '۲', # ۲
- '/3/' => '۳', # ۳
- '/4/' => '۴', # ۴
- '/5/' => '۵', # ۵
- '/6/' => '۶', # ۶
- '/7/' => '۷', # ۷
- '/8/' => '۸', # ۸
- '/9/' => '۹', # ۹
+ '/0/' => '۰', # U+06F0
+ '/1/' => '۱', # U+06F1
+ '/2/' => '۲', # U+06F2
+ '/3/' => '۳', # U+06F3
+ '/4/' => '۴', # U+06F4
+ '/5/' => '۵', # U+06F5
+ '/6/' => '۶', # U+06F6
+ '/7/' => '۷', # U+06F7
+ '/8/' => '۸', # U+06F8
+ '/9/' => '۹', # U+06F9
# # Cyrillic -> Arabic
'/Аллаһ/ui' => 'ﷲ',
'/([АӘЕЁИОӨҰҮЭЮЯЪЬ])е/ui' => '$1يە',
'؟' => '?',
# digits
- '٠' => '0', # ٠
- '١' => '1', # ١
- '٢' => '2', # ٢
- '٣' => '3', # ٣
- '٤' => '4', # ٤
- '٥' => '5', # ٥
- '٦' => '6', # ٦
- '٧' => '7', # ٧
- '٨' => '8', # ٨
- '٩' => '9', # ٩
+ '٠' => '0', # U+0660
+ '١' => '1', # U+0661
+ '٢' => '2', # U+0662
+ '٣' => '3', # U+0663
+ '٤' => '4', # U+0664
+ '٥' => '5', # U+0665
+ '٦' => '6', # U+0666
+ '٧' => '7', # U+0667
+ '٨' => '8', # U+0668
+ '٩' => '9', # U+0669
];
public $mLatinToArabic = [
/* # deactivated for now, breaks links i.e. in header of Special:Recentchanges :-(
# digits
- '0' => '٠', # ٠
- '1' => '١', # ١
- '2' => '٢', # ٢
- '3' => '٣', # ٣
- '4' => '٤', # ٤
- '5' => '٥', # ٥
- '6' => '٦', # ٦
- '7' => '٧', # ٧
- '8' => '٨', # ٨
- '9' => '٩', # ٩
+ '0' => '٠', # U+0660
+ '1' => '١', # U+0661
+ '2' => '٢', # U+0662
+ '3' => '٣', # U+0663
+ '4' => '٤', # U+0664
+ '5' => '٥', # U+0665
+ '6' => '٦', # U+0666
+ '7' => '٧', # U+0667
+ '8' => '٨', # U+0668
+ '9' => '٩', # U+0669
*/
];
];
$digitTransformTable = [
- '0' => '٠', # ٠
- '1' => '١', # ١
- '2' => '٢', # ٢
- '3' => '٣', # ٣
- '4' => '٤', # ٤
- '5' => '٥', # ٥
- '6' => '٦', # ٦
- '7' => '٧', # ٧
- '8' => '٨', # ٨
- '9' => '٩', # ٩
+ '0' => '٠', # U+0660
+ '1' => '١', # U+0661
+ '2' => '٢', # U+0662
+ '3' => '٣', # U+0663
+ '4' => '٤', # U+0664
+ '5' => '٥', # U+0665
+ '6' => '٦', # U+0666
+ '7' => '٧', # U+0667
+ '8' => '٨', # U+0668
+ '9' => '٩', # U+0669
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
$namespaceNames = [
];
$digitTransformTable = [
- '0' => '০', # ০
- '1' => '১', # ১
- '2' => '২', # ২
- '3' => '৩', # ৩
- '4' => '৪', # ৪
- '5' => '৫', # ৫
- '6' => '৬', # ৬
- '7' => '৭', # ৭
- '8' => '৮', # ৮
- '9' => '৯', # ৯
+ '0' => '০', # U+09E6
+ '1' => '১', # U+09E7
+ '2' => '২', # U+09E8
+ '3' => '৩', # U+09E9
+ '4' => '৪', # U+09EA
+ '5' => '৫', # U+09EB
+ '6' => '৬', # U+09EC
+ '7' => '৭', # U+09ED
+ '8' => '৮', # U+09EE
+ '9' => '৯', # U+09EF
];
$digitGroupingPattern = "##,##,###";
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
*/
$digitTransformTable = [
- '0' => '༠', # ༠
- '1' => '༡', # ༡
- '2' => '༢', # ༢
- '3' => '༣', # ༣
- '4' => '༤', # ༤
- '5' => '༥', # ༥
- '6' => '༦', # ༦
- '7' => '༧', # ༧
- '8' => '༨', # ༨
- '9' => '༩', # ༩
+ '0' => '༠', # U+0F20
+ '1' => '༡', # U+0F21
+ '2' => '༢', # U+0F22
+ '3' => '༣', # U+0F23
+ '4' => '༤', # U+0F24
+ '5' => '༥', # U+0F25
+ '6' => '༦', # U+0F26
+ '7' => '༧', # U+0F27
+ '8' => '༨', # U+0F28
+ '9' => '༩', # U+0F29
];
];
$digitTransformTable = [
- '0' => '٠', # ٠
- '1' => '١', # ١
- '2' => '٢', # ٢
- '3' => '٣', # ٣
- '4' => '٤', # ٤
- '5' => '٥', # ٥
- '6' => '٦', # ٦
- '7' => '٧', # ٧
- '8' => '٨', # ٨
- '9' => '٩', # ٩
+ '0' => '٠', # U+0660
+ '1' => '١', # U+0661
+ '2' => '٢', # U+0662
+ '3' => '٣', # U+0663
+ '4' => '٤', # U+0664
+ '5' => '٥', # U+0665
+ '6' => '٦', # U+0666
+ '7' => '٧', # U+0667
+ '8' => '٨', # U+0668
+ '9' => '٩', # U+0669
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
$datePreferences = [
*/
$digitTransformTable = [
- '0' => '༠', # ༠
- '1' => '༡', # ༡
- '2' => '༢', # ༢
- '3' => '༣', # ༣
- '4' => '༤', # ༤
- '5' => '༥', # ༥
- '6' => '༦', # ༦
- '7' => '༧', # ༧
- '8' => '༨', # ༨
- '9' => '༩', # ༩
+ '0' => '༠', # U+0F20
+ '1' => '༡', # U+0F21
+ '2' => '༢', # U+0F22
+ '3' => '༣', # U+0F23
+ '4' => '༤', # U+0F24
+ '5' => '༥', # U+0F25
+ '6' => '༦', # U+0F26
+ '7' => '༧', # U+0F27
+ '8' => '༨', # U+0F28
+ '9' => '༩', # U+0F29
];
];
$digitTransformTable = [
- '0' => '۰', # ۰
- '1' => '۱', # ۱
- '2' => '۲', # ۲
- '3' => '۳', # ۳
- '4' => '۴', # ۴
- '5' => '۵', # ۵
- '6' => '۶', # ۶
- '7' => '۷', # ۷
- '8' => '۸', # ۸
- '9' => '۹', # ۹
- '%' => '٪', # ٪
+ '0' => '۰', # U+06F0
+ '1' => '۱', # U+06F1
+ '2' => '۲', # U+06F2
+ '3' => '۳', # U+06F3
+ '4' => '۴', # U+06F4
+ '5' => '۵', # U+06F5
+ '6' => '۶', # U+06F6
+ '7' => '۷', # U+06F7
+ '8' => '۸', # U+06F8
+ '9' => '۹', # U+06F9
+ '%' => '٪', # U+066A
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
/**
];
$digitTransformTable = [
- '0' => '૦', # ૦
- '1' => '૧', # ૧
- '2' => '૨', # ૨
- '3' => '૩', # ૩
- '4' => '૪', # ૪
- '5' => '૫', # ૫
- '6' => '૬', # ૬
- '7' => '૭', # ૭
- '8' => '૮', # ૮
- '9' => '૯', # ૯
+ '0' => '૦', # U+0AE6
+ '1' => '૧', # U+0AE7
+ '2' => '૨', # U+0AE8
+ '3' => '૩', # U+0AE9
+ '4' => '૪', # U+0AEA
+ '5' => '૫', # U+0AEB
+ '6' => '૬', # U+0AEC
+ '7' => '૭', # U+0AED
+ '8' => '૮', # U+0AEE
+ '9' => '૯', # U+0AEF
];
$digitGroupingPattern = "##,##,###";
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
$linkTrail = "/^([a-z\x{0900}-\x{0963}\x{0966}-\x{A8E0}-\x{A8FF}]+)(.*)$/sDu";
$rtl = true;
$digitTransformTable = [
- '0' => '۰', # ۰
- '1' => '۱', # ۱
- '2' => '۲', # ۲
- '3' => '۳', # ۳
- '4' => '۴', # ۴
- '5' => '۵', # ۵
- '6' => '۶', # ۶
- '7' => '۷', # ۷
- '8' => '۸', # ۸
- '9' => '۹', # ۹
+ '0' => '۰', # U+06F0
+ '1' => '۱', # U+06F1
+ '2' => '۲', # U+06F2
+ '3' => '۳', # U+06F3
+ '4' => '۴', # U+06F4
+ '5' => '۵', # U+06F5
+ '6' => '۶', # U+06F6
+ '7' => '۷', # U+06F7
+ '8' => '۸', # U+06F8
+ '9' => '۹', # U+06F9
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
$fallback8bitEncoding = 'windows-1256';
];
$digitTransformTable = [
- '0' => '០', # ០
- '1' => '១', # ១
- '2' => '២', # ២
- '3' => '៣', # ៣
- '4' => '៤', # ៤
- '5' => '៥', # ៥
- '6' => '៦', # ៦
- '7' => '៧', # ៧
- '8' => '៨', # ៨
- '9' => '៩', # ៩
+ '0' => '០', # U+17E0
+ '1' => '១', # U+17E1
+ '2' => '២', # U+17E2
+ '3' => '៣', # U+17E3
+ '4' => '៤', # U+17E4
+ '5' => '៥', # U+17E5
+ '6' => '៦', # U+17E6
+ '7' => '៧', # U+17E7
+ '8' => '៨', # U+17E8
+ '9' => '៩', # U+17E9
];
$separatorTransformTable = [
];
$digitTransformTable = [
- '0' => '೦', # ೦
- '1' => '೧', # ೧
- '2' => '೨', # ೨
- '3' => '೩', # ೩
- '4' => '೪', # ೪
- '5' => '೫', # ೫
- '6' => '೬', # ೬
- '7' => '೭', # ೭
- '8' => '೮', # ೮
- '9' => '೯', # ೯
+ '0' => '೦', # U+0CE6
+ '1' => '೧', # U+0CE7
+ '2' => '೨', # U+0CE8
+ '3' => '೩', # U+0CE9
+ '4' => '೪', # U+0CEA
+ '5' => '೫', # U+0CEB
+ '6' => '೬', # U+0CEC
+ '7' => '೭', # U+0CED
+ '8' => '೮', # U+0CEE
+ '9' => '೯', # U+0CEF
];
$digitGroupingPattern = "##,##,###";
];
$digitTransformTable = [
- '0' => '٠', # ٠
- '1' => '١', # ١
- '2' => '٢', # ٢
- '3' => '٣', # ٣
- '4' => '٤', # ٤
- '5' => '٥', # ٥
- '6' => '٦', # ٦
- '7' => '٧', # ٧
- '8' => '٨', # ٨
- '9' => '٩', # ٩
+ '0' => '٠', # U+0660
+ '1' => '١', # U+0661
+ '2' => '٢', # U+0662
+ '3' => '٣', # U+0663
+ '4' => '٤', # U+0664
+ '5' => '٥', # U+0665
+ '6' => '٦', # U+0666
+ '7' => '٧', # U+0667
+ '8' => '٨', # U+0668
+ '9' => '٩', # U+0669
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
$rtl = true;
$digitTransformTable = [
- '0' => '٠', # ٠
- '1' => '١', # ١
- '2' => '٢', # ٢
- '3' => '٣', # ٣
- '4' => '٤', # ٤
- '5' => '٥', # ٥
- '6' => '٦', # ٦
- '7' => '٧', # ٧
- '8' => '٨', # ٨
- '9' => '٩', # ٩
+ '0' => '٠', # U+0660
+ '1' => '١', # U+0661
+ '2' => '٢', # U+0662
+ '3' => '٣', # U+0663
+ '4' => '٤', # U+0664
+ '5' => '٥', # U+0665
+ '6' => '٦', # U+0666
+ '7' => '٧', # U+0667
+ '8' => '٨', # U+0668
+ '9' => '٩', # U+0669
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
];
$digitTransformTable = [
- '0' => '໐', # ໐
- '1' => '໑', # ໑
- '2' => '໒', # ໒
- '3' => '໓', # ໓
- '4' => '໔', # ໔
- '5' => '໕', # ໕
- '6' => '໖', # ໖
- '7' => '໗', # ໗
- '8' => '໘', # ໘
- '9' => '໙', # ໙
+ '0' => '໐', # U+0ED0
+ '1' => '໑', # U+0ED1
+ '2' => '໒', # U+0ED2
+ '3' => '໓', # U+0ED3
+ '4' => '໔', # U+0ED4
+ '5' => '໕', # U+0ED5
+ '6' => '໖', # U+0ED6
+ '7' => '໗', # U+0ED7
+ '8' => '໘', # U+0ED8
+ '9' => '໙', # U+0ED9
];
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
$linkTrail = "/^([\u{0900}-\u{0963}\u{0971}-\u{097F}\u{FEFF}\u{200D}]+)(.*)$/sDu";
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
*/
$digitTransformTable = [
- '0' => '୦', # ୦
- '1' => '୧', # ୧
- '2' => '୨', # ୨
- '3' => '୩', # ୩
- '4' => '୪', # ୪
- '5' => '୫', # ୫
- '6' => '୬', # ୬
- '7' => '୭', # ୭
- '8' => '୮', # ୮
- '9' => '୯', # ୯
+ '0' => '୦', # U+0B66
+ '1' => '୧', # U+0B67
+ '2' => '୨', # U+0B68
+ '3' => '୩', # U+0B69
+ '4' => '୪', # U+0B6A
+ '5' => '୫', # U+0B6B
+ '6' => '୬', # U+0B6C
+ '7' => '୭', # U+0B6D
+ '8' => '୮', # U+0B6E
+ '9' => '୯', # U+0B6F
];
$linkTrail = "/^([a-z\x{0B00}-\x{0B7F}]+)(.*)$/sDu";
];
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
$rtl = true;
$digitTransformTable = [
- '0' => '۰', # ᝶
- '1' => '۱', # ᝷
- '2' => '۲', # ᝸
- '3' => '۳', # ᝹
- '4' => '۴', # ក
- '5' => '۵', # ខ
- '6' => '۶', # គ
- '7' => '۷', # ឃ
- '8' => '۸', # ង
- '9' => '۹', # ច
+ '0' => '۰', # U+06F0
+ '1' => '۱', # U+06F1
+ '2' => '۲', # U+06F2
+ '3' => '۳', # U+06F3
+ '4' => '۴', # U+06F4
+ '5' => '۵', # U+06F5
+ '6' => '۶', # U+06F6
+ '7' => '۷', # U+06F7
+ '8' => '۸', # U+06F8
+ '9' => '۹', # U+06F9
];
$separatorTransformTable = [
- '.' => '٫', # ٫
- ',' => '٬', # ٬
+ '.' => '٫', # U+066B
+ ',' => '٬', # U+066C
];
$namespaceNames = [
$fallback = 'hi';
$digitTransformTable = [
- '0' => '०', # ०
- '1' => '१', # १
- '2' => '२', # २
- '3' => '३', # ३
- '4' => '४', # ४
- '5' => '५', # ५
- '6' => '६', # ६
- '7' => '७', # ७
- '8' => '८', # ८
- '9' => '९', # ९
+ '0' => '०', # U+0966
+ '1' => '१', # U+0967
+ '2' => '२', # U+0968
+ '3' => '३', # U+0969
+ '4' => '४', # U+096A
+ '5' => '५', # U+096B
+ '6' => '६', # U+096C
+ '7' => '७', # U+096D
+ '8' => '८', # U+096E
+ '9' => '९', # U+096F
];
$linkPrefixExtension = false;
$rtl = true;
$digitTransformTable = [
- '0' => '۰', # ۰
- '1' => '۱', # ۱
- '2' => '۲', # ۲
- '3' => '۳', # ۳
- '4' => '۴', # ۴
- '5' => '۵', # ۵
- '6' => '۶', # ۶
- '7' => '۷', # ۷
- '8' => '۸', # ۸
- '9' => '۹', # ۹
- '%' => '٪', # ٪
+ '0' => '۰', # U+06F0
+ '1' => '۱', # U+06F1
+ '2' => '۲', # U+06F2
+ '3' => '۳', # U+06F3
+ '4' => '۴', # U+06F4
+ '5' => '۵', # U+06F5
+ '6' => '۶', # U+06F6
+ '7' => '۷', # U+06F7
+ '8' => '۸', # U+06F8
+ '9' => '۹', # U+06F9
+ '%' => '٪', # U+066A
];
uselang
uselivepreview
usemod
-usemsgcache
usenewrc
user
useragent
);
}
$this->total += $dbw->affectedRows();
+ MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->waitForReplication();
}
/**
$toDelete[] = $id;
$maxId = max(
- (int)$dbw->selectField( 'archive', 'MAX(ar_rev_id)', [], __METHOD__ ),
- (int)$dbw->selectField( 'slots', 'MAX(slot_revision_id)', [], __METHOD__ )
+ (int)$dbw->selectField( 'archive', 'MAX(ar_rev_id)', [], $fname ),
+ (int)$dbw->selectField( 'slots', 'MAX(slot_revision_id)', [], $fname )
);
if ( $id <= $maxId ) {
$dbw->insert( 'revision', [ 'rev_id' => $maxId + 1 ] + self::$dummyRev, $fname );
class DatabasePostgresTest extends MediaWikiTestCase {
private function doTestInsertIgnore() {
- $reset = new ScopedCallback( function () {
+ $fname = __METHOD__;
+ $reset = new ScopedCallback( function () use ( $fname ) {
if ( $this->db->explicitTrxActive() ) {
- $this->db->rollback( __METHOD__ );
+ $this->db->rollback( $fname );
}
- $this->db->query( 'DROP TABLE IF EXISTS ' . $this->db->tableName( 'foo' ) );
+ $this->db->query( 'DROP TABLE IF EXISTS ' . $this->db->tableName( 'foo' ), $fname );
} );
$this->db->query(
- "CREATE TEMPORARY TABLE {$this->db->tableName( 'foo' )} (i INTEGER NOT NULL PRIMARY KEY)"
+ "CREATE TEMPORARY TABLE {$this->db->tableName( 'foo' )} (i INTEGER NOT NULL PRIMARY KEY)",
+ __METHOD__
);
$this->db->insert( 'foo', [ [ 'i' => 1 ], [ 'i' => 2 ] ], __METHOD__ );
}
private function doTestInsertSelectIgnore() {
- $reset = new ScopedCallback( function () {
+ $fname = __METHOD__;
+ $reset = new ScopedCallback( function () use ( $fname ) {
if ( $this->db->explicitTrxActive() ) {
- $this->db->rollback( __METHOD__ );
+ $this->db->rollback( $fname );
}
- $this->db->query( 'DROP TABLE IF EXISTS ' . $this->db->tableName( 'foo' ) );
- $this->db->query( 'DROP TABLE IF EXISTS ' . $this->db->tableName( 'bar' ) );
+ $this->db->query( 'DROP TABLE IF EXISTS ' . $this->db->tableName( 'foo' ), $fname );
+ $this->db->query( 'DROP TABLE IF EXISTS ' . $this->db->tableName( 'bar' ), $fname );
} );
$this->db->query(
- "CREATE TEMPORARY TABLE {$this->db->tableName( 'foo' )} (i INTEGER)"
+ "CREATE TEMPORARY TABLE {$this->db->tableName( 'foo' )} (i INTEGER)",
+ __METHOD__
);
$this->db->query(
- "CREATE TEMPORARY TABLE {$this->db->tableName( 'bar' )} (i INTEGER NOT NULL PRIMARY KEY)"
+ "CREATE TEMPORARY TABLE {$this->db->tableName( 'bar' )} (i INTEGER NOT NULL PRIMARY KEY)",
+ __METHOD__
);
$this->db->insert( 'bar', [ [ 'i' => 1 ], [ 'i' => 2 ] ], __METHOD__ );