Merge "Use thousands separators in selected integer literals"
This commit is contained in:
commit
6c07e2acf1
40 changed files with 79 additions and 79 deletions
|
|
@ -1943,7 +1943,7 @@ class MainConfigSchema {
|
|||
* Default is 1024*256 bytes
|
||||
*/
|
||||
public const SVGMetadataCutoff = [
|
||||
'default' => 262144,
|
||||
'default' => 262_144,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -2003,7 +2003,7 @@ class MainConfigSchema {
|
|||
* 12.5 million pixels or 3500x3500.
|
||||
*/
|
||||
public const MaxImageArea = [
|
||||
'default' => 12500000,
|
||||
'default' => 12_500_000,
|
||||
'type' => 'string|integer|false',
|
||||
];
|
||||
|
||||
|
|
@ -2016,7 +2016,7 @@ class MainConfigSchema {
|
|||
* It probably makes sense to keep this equal to $wgMaxImageArea.
|
||||
*/
|
||||
public const MaxAnimatedGifArea = [
|
||||
'default' => 12500000,
|
||||
'default' => 12_500_000,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -4276,7 +4276,7 @@ class MainConfigSchema {
|
|||
* Read/write timeout for MemCached server communication, in microseconds.
|
||||
*/
|
||||
public const MemCachedTimeout = [
|
||||
'default' => 500000,
|
||||
'default' => 500_000,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -6488,7 +6488,7 @@ class MainConfigSchema {
|
|||
* by PPFrame::expand()
|
||||
*/
|
||||
public const MaxPPNodeCount = [
|
||||
'default' => 1000000,
|
||||
'default' => 1_000_000,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -9579,7 +9579,7 @@ class MainConfigSchema {
|
|||
'POST' => [
|
||||
'readQueryTime' => 5,
|
||||
'writeQueryTime' => 1,
|
||||
'readQueryRows' => 100000,
|
||||
'readQueryRows' => 100_000,
|
||||
'maxAffected' => 1000
|
||||
],
|
||||
'POST-nonwrite' => [
|
||||
|
|
@ -9601,14 +9601,14 @@ class MainConfigSchema {
|
|||
'PostSend-POST' => [
|
||||
'readQueryTime' => 5,
|
||||
'writeQueryTime' => 1,
|
||||
'readQueryRows' => 100000,
|
||||
'readQueryRows' => 100_000,
|
||||
'maxAffected' => 1000
|
||||
],
|
||||
// Background job runner
|
||||
'JobRunner' => [
|
||||
'readQueryTime' => 30,
|
||||
'writeQueryTime' => 5,
|
||||
'readQueryRows' => 100000,
|
||||
'readQueryRows' => 100_000,
|
||||
'maxAffected' => 500 // ballpark of $wgUpdateRowsPerQuery
|
||||
],
|
||||
// Command-line scripts
|
||||
|
|
@ -12140,7 +12140,7 @@ class MainConfigSchema {
|
|||
* @warning Do not set this lower than $wgMaxArticleSize*1024
|
||||
*/
|
||||
public const APIMaxResultSize = [
|
||||
'default' => 8388608,
|
||||
'default' => 8_388_608,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -12277,7 +12277,7 @@ class MainConfigSchema {
|
|||
* Maximum amount of virtual memory available to shell processes under linux, in KiB.
|
||||
*/
|
||||
public const MaxShellMemory = [
|
||||
'default' => 307200,
|
||||
'default' => 307_200,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -12285,7 +12285,7 @@ class MainConfigSchema {
|
|||
* ImageMagick convert for example can be fairly hungry for scratch space
|
||||
*/
|
||||
public const MaxShellFileSize = [
|
||||
'default' => 102400,
|
||||
'default' => 102_400,
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -12772,7 +12772,7 @@ class MainConfigSchema {
|
|||
* Number of seconds to keep edit recovery data after the edit is stored.
|
||||
*/
|
||||
public const EditRecoveryExpiry = [
|
||||
'default' => 2592000,
|
||||
'default' => 2_592_000,
|
||||
'type' => 'integer',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class ForkController {
|
|||
}
|
||||
// Throttle restarts
|
||||
if ( $this->procsToStart ) {
|
||||
usleep( 500000 );
|
||||
usleep( 500_000 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class WebResponse {
|
|||
* @since 1.27
|
||||
*/
|
||||
public function clearCookie( $name, $options = [] ) {
|
||||
$this->setCookie( $name, '', time() - 31536000 /* 1 year */, $options );
|
||||
$this->setCookie( $name, '', time() - 31_536_000 /* 1 year */, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class SqlBlobStore implements IDBAccessObject, BlobStore {
|
|||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $cacheExpiry = 604800; // 7 days
|
||||
private $cacheExpiry = 604_800; // 7 days
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ class ApiErrorFormatter {
|
|||
return [];
|
||||
}
|
||||
|
||||
$result = new ApiResult( 1000000 );
|
||||
$result = new ApiResult( 1_000_000 );
|
||||
$formatter = new ApiErrorFormatter(
|
||||
$result, $this->lang, $format ?: $this->format, $this->useDB
|
||||
);
|
||||
|
|
|
|||
2
includes/cache/BacklinkCache.php
vendored
2
includes/cache/BacklinkCache.php
vendored
|
|
@ -423,7 +423,7 @@ class BacklinkCache {
|
|||
|
||||
// Do the selects in batches to avoid client-side OOMs (T45452).
|
||||
// Use a LIMIT that plays well with $batchSize to keep equal sized partitions.
|
||||
$selectSize = max( $batchSize, 200000 - ( 200000 % $batchSize ) );
|
||||
$selectSize = max( $batchSize, 200_000 - ( 200_000 % $batchSize ) );
|
||||
$start = false;
|
||||
do {
|
||||
$res = $this->queryLinks( $table, $start, false, $selectSize, 'ids' );
|
||||
|
|
|
|||
|
|
@ -1678,7 +1678,7 @@ class FileRepo {
|
|||
$params = [ 'src' => $path, 'headers' => $headers, 'options' => $optHeaders ];
|
||||
|
||||
// T172851: HHVM does not flush the output properly, causing OOM
|
||||
ob_start( null, 1048576 );
|
||||
ob_start( null, 1_048_576 );
|
||||
ob_implicit_flush( true );
|
||||
|
||||
$status = $this->newGood()->merge( $this->backend->streamFile( $params ) );
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi {
|
|||
protected $apiThumbCacheExpiry = 86400; // 1 day (24*3600)
|
||||
|
||||
/** @var int Redownload thumbnail files after this expiry */
|
||||
protected $fileCacheExpiry = 2592000; // 1 month (30*24*3600)
|
||||
protected $fileCacheExpiry = 2_592_000; // 1 month (30*24*3600)
|
||||
|
||||
/**
|
||||
* @var int API metadata cache time.
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob {
|
|||
/** @var int */
|
||||
public $mSize = 0;
|
||||
/** @var int */
|
||||
public $mMaxSize = 10000000;
|
||||
public $mMaxSize = 10_000_000;
|
||||
/** @var int */
|
||||
public $mMaxCount = 100;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class DiffHistoryBlob implements HistoryBlob {
|
|||
* @var int The maximum uncompressed size before the object becomes sad
|
||||
* Should be less than max_allowed_packet
|
||||
*/
|
||||
public $mMaxSize = 10000000;
|
||||
public $mMaxSize = 10_000_000;
|
||||
|
||||
/** @var int The maximum number of text items before the object becomes sad */
|
||||
public $mMaxCount = 100;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ abstract class JobQueue {
|
|||
|
||||
protected const QOS_ATOMIC = 1; // integer; "all-or-nothing" job insertions
|
||||
|
||||
protected const ROOTJOB_TTL = 2419200; // integer; seconds to remember root jobs (28 days)
|
||||
protected const ROOTJOB_TTL = 2_419_200; // integer; seconds to remember root jobs (28 days)
|
||||
|
||||
/**
|
||||
* @stable to call
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ use Wikimedia\ScopedCallback;
|
|||
*/
|
||||
class JobQueueDB extends JobQueue {
|
||||
private const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
|
||||
private const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed
|
||||
private const MAX_JOB_RANDOM = 2147483647; // integer; 2^31 - 1, used for job_random
|
||||
private const MAX_AGE_PRUNE = 604_800; // integer; seconds a job can live once claimed
|
||||
private const MAX_JOB_RANDOM = 2_147_483_647; // integer; 2^31 - 1, used for job_random
|
||||
private const MAX_OFFSET = 255; // integer; maximum number of rows to skip
|
||||
|
||||
/** @var IMaintainableDatabase|DBError|null */
|
||||
|
|
|
|||
|
|
@ -257,13 +257,13 @@ class Language implements Bcp47Code {
|
|||
* @since 1.35
|
||||
*/
|
||||
protected const DURATION_INTERVALS = [
|
||||
'millennia' => 31556952000,
|
||||
'centuries' => 3155695200,
|
||||
'decades' => 315569520,
|
||||
'years' => 31556952, // 86400 * ( 365 + ( 24 * 3 + 25 ) / 400 )
|
||||
'weeks' => 604800,
|
||||
'days' => 86400,
|
||||
'hours' => 3600,
|
||||
'millennia' => 31_556_952_000,
|
||||
'centuries' => 3_155_695_200,
|
||||
'decades' => 315_569_520,
|
||||
'years' => 31_556_952, // 86400 * ( 365 + ( 24 * 3 + 25 ) / 400 )
|
||||
'weeks' => 604_800,
|
||||
'days' => 86_400,
|
||||
'hours' => 3_600,
|
||||
'minutes' => 60,
|
||||
'seconds' => 1,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class DiffEngine {
|
|||
* @param int $tooLong
|
||||
* @param float $powLimit
|
||||
*/
|
||||
public function __construct( $tooLong = 2000000, $powLimit = 1.45 ) {
|
||||
public function __construct( $tooLong = 2_000_000, $powLimit = 1.45 ) {
|
||||
$this->tooLong = $tooLong;
|
||||
$this->powLimit = $powLimit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class WordLevelDiff extends Diff {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected $bailoutComplexity = 40000000; // Roughly 6K x 6K words changed
|
||||
protected $bailoutComplexity = 40_000_000; // Roughly 6K x 6K words changed
|
||||
|
||||
/**
|
||||
* @stable to call
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ class SwiftFileBackend extends FileBackendStore {
|
|||
$sha1Context = hash_init( 'sha1' );
|
||||
$hashDigestSize = 0;
|
||||
while ( !feof( $srcHandle ) ) {
|
||||
$buffer = (string)fread( $srcHandle, 131072 ); // 128 KiB
|
||||
$buffer = (string)fread( $srcHandle, 131_072 ); // 128 KiB
|
||||
hash_update( $md5Context, $buffer );
|
||||
hash_update( $sha1Context, $buffer );
|
||||
$hashDigestSize += strlen( $buffer );
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ abstract class MediumSpecificBagOStuff extends BagOStuff {
|
|||
}
|
||||
|
||||
// Default to 8MiB if segmentationSize is not set
|
||||
$this->segmentationSize = $params['segmentationSize'] ?? 8388608;
|
||||
$this->segmentationSize = $params['segmentationSize'] ?? 8_388_608;
|
||||
// Default to 64MiB if segmentedValueMaxSize is not set
|
||||
$this->segmentedValueMaxSize = $params['segmentedValueMaxSize'] ?? 67108864;
|
||||
$this->segmentedValueMaxSize = $params['segmentedValueMaxSize'] ?? 67_108_864;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ abstract class MemcachedBagOStuff extends MediumSpecificBagOStuff {
|
|||
* unprefixed access. This can be used with mcrouter. [optional]
|
||||
*/
|
||||
public function __construct( array $params ) {
|
||||
$params['segmentationSize'] ??= 917504; // < 1MiB
|
||||
$params['segmentationSize'] ??= 917_504; // < 1MiB
|
||||
parent::__construct( $params );
|
||||
|
||||
$this->routingPrefix = $params['routingPrefix'] ?? '';
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class MemcachedPeclBagOStuff extends MemcachedBagOStuff {
|
|||
$params += [
|
||||
'compress_threshold' => 1500,
|
||||
'connect_timeout' => 0.5,
|
||||
'timeout' => 500000,
|
||||
'timeout' => 500_000,
|
||||
'serializer' => 'php',
|
||||
'use_binary_protocol' => false,
|
||||
'allow_tcp_nagle_delay' => true
|
||||
|
|
|
|||
|
|
@ -35,15 +35,15 @@ interface ExpirationAwareness {
|
|||
/** @var int One minute, in seconds */
|
||||
public const TTL_MINUTE = 60;
|
||||
/** @var int One hour, in seconds */
|
||||
public const TTL_HOUR = 3600;
|
||||
public const TTL_HOUR = 3_600;
|
||||
/** @var int One day, in seconds */
|
||||
public const TTL_DAY = 86400;
|
||||
public const TTL_DAY = 86_400;
|
||||
/** @var int One week, in seconds */
|
||||
public const TTL_WEEK = 604800;
|
||||
public const TTL_WEEK = 604_800;
|
||||
/** @var int One month, in seconds */
|
||||
public const TTL_MONTH = 2592000;
|
||||
public const TTL_MONTH = 2_592_000;
|
||||
/** @var int One year, in seconds */
|
||||
public const TTL_YEAR = 31536000;
|
||||
public const TTL_YEAR = 31_536_000;
|
||||
|
||||
/** @var int Reasonably strict cache time that last the life of quick requests */
|
||||
public const TTL_PROC_SHORT = 3;
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ class MemcachedClient implements StorageAwareness {
|
|||
$this->_host_dead = array();
|
||||
|
||||
$this->_timeout_seconds = 0;
|
||||
$this->_timeout_microseconds = $args['timeout'] ?? 500000;
|
||||
$this->_timeout_microseconds = $args['timeout'] ?? 500_000;
|
||||
|
||||
$this->_connect_timeout = $args['connect_timeout'] ?? 0.1;
|
||||
$this->_connect_attempts = 2;
|
||||
|
|
|
|||
|
|
@ -2727,7 +2727,7 @@ class WANObjectCache implements
|
|||
// Ramp up $chance from 0 to its nominal value over RAMPUP_TTL seconds to avoid stampedes
|
||||
$chance *= ( $timeOld <= self::RAMPUP_TTL ) ? $timeOld / self::RAMPUP_TTL : 1;
|
||||
|
||||
return ( mt_rand( 1, 1000000000 ) <= 1000000000 * $chance );
|
||||
return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2768,7 +2768,7 @@ class WANObjectCache implements
|
|||
// having p(0)=0 and p(1)=1. The value expires at the nominal expiry.
|
||||
$chance = $ttrRatio ** 4;
|
||||
|
||||
return ( mt_rand( 1, 1000000000 ) <= 1000000000 * $chance );
|
||||
return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ class LoadMonitor implements ILoadMonitor {
|
|||
// the value might not refresh until a modest time after the nominal expiry.
|
||||
$chance = exp( -64 * min( $genRatio, 0.1 ) ) * ( $ttrRatio ** 4 );
|
||||
|
||||
return ( mt_rand( 1, 1000000000 ) <= 1000000000 * $chance );
|
||||
return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -175,8 +175,8 @@ class GlobalIdGenerator {
|
|||
Assert::parameter( $base <= 36, '$base', 'must be <= 36' );
|
||||
Assert::parameter( $base >= 2, '$base', 'must be >= 2' );
|
||||
|
||||
$info = $this->getTimeAndDelay( 'lockFile128', 16384, 1048576, 1048576 );
|
||||
$info[self::CLOCK_OFFSET_COUNTER] %= 1048576;
|
||||
$info = $this->getTimeAndDelay( 'lockFile128', 16384, 1_048_576, 1_048_576 );
|
||||
$info[self::CLOCK_OFFSET_COUNTER] %= 1_048_576;
|
||||
|
||||
return \Wikimedia\base_convert( $this->getTimestampedID128( $info ), 2, $base );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ use MediaWiki\Shell\Shell;
|
|||
* @ingroup Media
|
||||
*/
|
||||
class DjVuHandler extends ImageHandler {
|
||||
private const EXPENSIVE_SIZE_LIMIT = 10485760; // 10MiB
|
||||
private const EXPENSIVE_SIZE_LIMIT = 10_485_760; // 10MiB
|
||||
|
||||
// Constants for getHandlerState
|
||||
private const STATE_DJVU_IMAGE = 'djvuImage';
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class DjVuImage {
|
|||
/**
|
||||
* Memory limit for the DjVu description software
|
||||
*/
|
||||
private const DJVUTXT_MEMORY_LIMIT = 300000000;
|
||||
private const DJVUTXT_MEMORY_LIMIT = 300_000_000;
|
||||
|
||||
/** @var string */
|
||||
private $mFilename;
|
||||
|
|
|
|||
|
|
@ -770,7 +770,7 @@ class Exif {
|
|||
* @return bool
|
||||
*/
|
||||
private function isLong( $in ) {
|
||||
if ( !is_array( $in ) && sprintf( '%d', $in ) == $in && $in >= 0 && $in <= 4294967296 ) {
|
||||
if ( !is_array( $in ) && sprintf( '%d', $in ) == $in && $in >= 0 && $in <= 4_294_967_296 ) {
|
||||
$this->debug( $in, __FUNCTION__, true );
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class PNGMetadataExtractor {
|
|||
private static $textChunks;
|
||||
|
||||
public const VERSION = 1;
|
||||
private const MAX_CHUNK_SIZE = 3145728; // 3 mebibytes
|
||||
private const MAX_CHUNK_SIZE = 3_145_728; // 3 mebibytes
|
||||
|
||||
public static function getMetadata( $filename ) {
|
||||
self::$pngSig = pack( "C8", 137, 80, 78, 71, 13, 10, 26, 10 );
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class TiffHandler extends ExifBitmapHandler {
|
|||
/**
|
||||
* TIFF files over 10M are considered expensive to thumbnail
|
||||
*/
|
||||
private const EXPENSIVE_SIZE_LIMIT = 10485760;
|
||||
private const EXPENSIVE_SIZE_LIMIT = 10_485_760;
|
||||
|
||||
/**
|
||||
* Conversion to PNG for inline display can be disabled here...
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class StripState {
|
|||
protected $expandSize = 0;
|
||||
|
||||
protected $depthLimit = 20;
|
||||
protected $sizeLimit = 5000000;
|
||||
protected $sizeLimit = 5_000_000;
|
||||
|
||||
/**
|
||||
* @stable to call
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ use Xml;
|
|||
class SpecialExpandTemplates extends SpecialPage {
|
||||
|
||||
/** @var int Maximum size in bytes to include. 50 MB allows fixing those huge pages */
|
||||
private const MAX_INCLUDE_SIZE = 50000000;
|
||||
private const MAX_INCLUDE_SIZE = 50_000_000;
|
||||
|
||||
private ParserFactory $parserFactory;
|
||||
private UserOptionsLookup $userOptionsLookup;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
|
|||
* This service is really for thumbnails and other such previews while
|
||||
* uploading.
|
||||
*/
|
||||
private const MAX_SERVE_BYTES = 1048576; // 1 MiB
|
||||
private const MAX_SERVE_BYTES = 1_048_576; // 1 MiB
|
||||
|
||||
/**
|
||||
* @param RepoGroup $repoGroup
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class TextPassDumper extends BackupDumper {
|
|||
protected $failureTimeout = 5;
|
||||
|
||||
/** @var int In bytes. Maximum size to read from the stub in on go. */
|
||||
protected $bufferSize = 524288;
|
||||
protected $bufferSize = 524_288;
|
||||
|
||||
/** @var array */
|
||||
protected $php = [ PHP_BINARY ];
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class RefreshLinks extends Maintenance {
|
|||
$this->addOption( 'touched-only', 'Only fix pages that have been touched after last update' );
|
||||
$this->addOption( 'e', 'Last page id to refresh', false, true );
|
||||
$this->addOption( 'dfn-chunk-size', 'Maximum number of existent IDs to check per ' .
|
||||
'query, default 100000', false, true );
|
||||
'query, default 100,000', false, true );
|
||||
$this->addOption( 'namespace', 'Only fix pages in this namespace', false, true );
|
||||
$this->addOption( 'category', 'Only fix pages in this category', false, true );
|
||||
$this->addOption( 'tracking-category', 'Only fix pages in this tracking category', false, true );
|
||||
|
|
@ -63,7 +63,7 @@ class RefreshLinks extends Maintenance {
|
|||
// delete entries for nonexistent IDs that fall outside the range.
|
||||
$start = (int)$this->getArg( 0 ) ?: null;
|
||||
$end = (int)$this->getOption( 'e' ) ?: null;
|
||||
$dfnChunkSize = (int)$this->getOption( 'dfn-chunk-size', 100000 );
|
||||
$dfnChunkSize = (int)$this->getOption( 'dfn-chunk-size', 100_000 );
|
||||
|
||||
if ( $this->hasOption( 'dfn-only' ) ) {
|
||||
$this->deleteLinksFromNonexistent( $start, $end, $this->getBatchSize(), $dfnChunkSize );
|
||||
|
|
@ -257,7 +257,7 @@ class RefreshLinks extends Maintenance {
|
|||
* @author Merlijn van Deen <valhallasw@arctus.nl>
|
||||
*/
|
||||
private function deleteLinksFromNonexistent( $start = null, $end = null, $batchSize = 100,
|
||||
$chunkSize = 100000
|
||||
$chunkSize = 100_000
|
||||
) {
|
||||
$this->waitForReplication();
|
||||
$this->output( "Deleting illegal entries from the links tables...\n" );
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class RecompressTracked {
|
|||
$dbw = wfGetDB( DB_PRIMARY );
|
||||
$dbr = wfGetDB( DB_REPLICA );
|
||||
$pos = $dbw->getPrimaryPos();
|
||||
$dbr->primaryPosWait( $pos, 100000 );
|
||||
$dbr->primaryPosWait( $pos, 100_000 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ class TrackBlobs extends Maintenance {
|
|||
$dbw = wfGetDB( DB_PRIMARY );
|
||||
$dbr = wfGetDB( DB_REPLICA );
|
||||
$pos = $dbw->getPrimaryPos();
|
||||
$dbr->primaryPosWait( $pos, 100000 );
|
||||
$dbr->primaryPosWait( $pos, 100_000 );
|
||||
|
||||
$textClause = $this->getTextClause();
|
||||
$startId = 0;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ TEXT
|
|||
__METHOD__
|
||||
);
|
||||
// Improve estimate if feasible
|
||||
if ( $count < 1000000 ) {
|
||||
if ( $count < 1_000_000 ) {
|
||||
$count = $this->dbr->newSelectQueryBuilder()
|
||||
->select( 'COUNT(*)' )
|
||||
->from( 'categorylinks' )
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
* @covers ApiErrorFormatter
|
||||
*/
|
||||
public function testErrorFormatterBasics() {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter( $result,
|
||||
$this->getServiceContainer()->getLanguageFactory()->getLanguage( 'de' ), 'wikitext',
|
||||
false );
|
||||
|
|
@ -41,7 +41,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
* @covers ApiErrorFormatter_BackCompat
|
||||
*/
|
||||
public function testNewWithFormat() {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter( $result,
|
||||
$this->getServiceContainer()->getLanguageFactory()->getLanguage( 'de' ), 'wikitext',
|
||||
false );
|
||||
|
|
@ -64,7 +64,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
public function testErrorFormatter( $format, $lang, $useDB,
|
||||
$expect1, $expect2, $expect3
|
||||
) {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter( $result,
|
||||
$this->getServiceContainer()->getLanguageFactory()->getLanguage( $lang ), $format,
|
||||
$useDB );
|
||||
|
|
@ -408,7 +408,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
$disclaimers = wfMessage( 'disclaimers' );
|
||||
$edithelp = wfMessage( 'edithelp' );
|
||||
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter_BackCompat( $result );
|
||||
|
||||
$this->assertSame( 'en', $formatter->getLanguage()->getCode() );
|
||||
|
|
@ -601,7 +601,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
* @param array $expect
|
||||
*/
|
||||
public function testGetMessageFromException( $exception, $options, $expect ) {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter( $result,
|
||||
$this->getServiceContainer()->getLanguageFactory()->getLanguage( 'en' ), 'html',
|
||||
false );
|
||||
|
|
@ -628,7 +628,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
* @param array $expect
|
||||
*/
|
||||
public function testGetMessageFromException_BC( $exception, $options, $expect ) {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter_BackCompat( $result );
|
||||
|
||||
$msg = $formatter->getMessageFromException( $exception, $options );
|
||||
|
|
@ -696,7 +696,7 @@ class ApiErrorFormatterTest extends MediaWikiLangTestCase {
|
|||
* @covers ApiErrorFormatter::formatMessageInternal
|
||||
*/
|
||||
public function testAddMessagesFromStatus_filter() {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$formatter = new ApiErrorFormatter( $result,
|
||||
$this->getServiceContainer()->getLanguageFactory()->getLanguage( 'qqx' ),
|
||||
'plaintext', false );
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ class ApiResultTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
$arr = [];
|
||||
$result2 = new ApiResult( 8388608 );
|
||||
$result2 = new ApiResult( 8_388_608 );
|
||||
$result2->addValue( null, 'foo', 'bar' );
|
||||
ApiResult::setValue( $arr, 'baz', $result2 );
|
||||
$this->assertSame( [
|
||||
|
|
@ -237,7 +237,7 @@ class ApiResultTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers ApiResult
|
||||
*/
|
||||
public function testInstanceDataMethods() {
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
|
||||
$result->addValue( null, 'setValue', '1' );
|
||||
|
||||
|
|
@ -496,8 +496,8 @@ class ApiResultTest extends MediaWikiIntegrationTestCase {
|
|||
$this->assertTrue( $result->addValue( null, 'foo', $obj ) );
|
||||
$this->assertSame( 2, $result->getSize() );
|
||||
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result2 = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$result2 = new ApiResult( 8_388_608 );
|
||||
$result2->addValue( null, 'foo', 'bar' );
|
||||
$result->addValue( null, 'baz', $result2 );
|
||||
$this->assertSame( [
|
||||
|
|
@ -508,7 +508,7 @@ class ApiResultTest extends MediaWikiIntegrationTestCase {
|
|||
ApiResult::META_TYPE => 'assoc',
|
||||
], $result->getResultData() );
|
||||
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$result->addValue( null, 'foo', "foo\x80bar" );
|
||||
$result->addValue( null, 'bar', "a\xcc\x81" );
|
||||
$result->addValue( null, 'baz', 74 );
|
||||
|
|
@ -523,7 +523,7 @@ class ApiResultTest extends MediaWikiIntegrationTestCase {
|
|||
ApiResult::META_TYPE => 'assoc',
|
||||
], $result->getResultData() );
|
||||
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$obj = (object)[ 1 => 'one' ];
|
||||
$arr = [];
|
||||
$result->addValue( $arr, 'foo', $obj );
|
||||
|
|
@ -541,7 +541,7 @@ class ApiResultTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testMetadata() {
|
||||
$arr = [ 'foo' => [ 'bar' => [] ] ];
|
||||
$result = new ApiResult( 8388608 );
|
||||
$result = new ApiResult( 8_388_608 );
|
||||
$result->addValue( null, 'foo', [ 'bar' => [] ] );
|
||||
|
||||
$expect = [
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class ApiQueryTest extends ApiTestCase {
|
|||
public function testTitlesAreRejectedIfInvalid() {
|
||||
$title = false;
|
||||
while ( !$title || Title::newFromText( $title )->exists() ) {
|
||||
$title = md5( mt_rand( 0, 100000 ) );
|
||||
$title = md5( mt_rand( 0, 100_000 ) );
|
||||
}
|
||||
|
||||
$data = $this->doApiRequest( [
|
||||
|
|
|
|||
Loading…
Reference in a new issue