dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f739a8f
)
build: Updating mediawiki/mediawiki-codesniffer to 0.12.0
author
Umherirrender
<umherirrender_de.wp@web.de>
Sun, 10 Sep 2017 19:11:37 +0000
(21:11 +0200)
committer
Umherirrender
<umherirrender_de.wp@web.de>
Sun, 10 Sep 2017 19:11:37 +0000
(21:11 +0200)
Change-Id: Iefaae5043fa77d5d556c31079549dab8f61bd3ef
15 files changed:
composer.json
patch
|
blob
|
history
includes/OutputPage.php
patch
|
blob
|
history
includes/libs/filebackend/FileBackendStore.php
patch
|
blob
|
history
includes/libs/objectcache/BagOStuff.php
patch
|
blob
|
history
includes/libs/objectcache/MemcachedBagOStuff.php
patch
|
blob
|
history
includes/libs/objectcache/WANObjectCache.php
patch
|
blob
|
history
includes/libs/rdbms/TransactionProfiler.php
patch
|
blob
|
history
includes/libs/rdbms/database/Database.php
patch
|
blob
|
history
includes/libs/rdbms/loadmonitor/LoadMonitor.php
patch
|
blob
|
history
includes/parser/ParserOutput.php
patch
|
blob
|
history
phpcs.xml
patch
|
blob
|
history
tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
patch
|
blob
|
history
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
patch
|
blob
|
history
tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
patch
|
blob
|
history
tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
patch
|
blob
|
history
diff --git
a/composer.json
b/composer.json
index
dd7567c
..
70d2e8f
100644
(file)
--- a/
composer.json
+++ b/
composer.json
@@
-54,7
+54,7
@@
"jakub-onderka/php-parallel-lint": "0.9.2",
"jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
"justinrainbow/json-schema": "~5.2",
"jakub-onderka/php-parallel-lint": "0.9.2",
"jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
"justinrainbow/json-schema": "~5.2",
- "mediawiki/mediawiki-codesniffer": "0.1
1
.0",
+ "mediawiki/mediawiki-codesniffer": "0.1
2
.0",
"monolog/monolog": "~1.22.1",
"nikic/php-parser": "2.1.0",
"nmred/kafka-php": "0.1.5",
"monolog/monolog": "~1.22.1",
"nikic/php-parser": "2.1.0",
"nmred/kafka-php": "0.1.5",
diff --git
a/includes/OutputPage.php
b/includes/OutputPage.php
index
dd21194
..
b71ae89
100644
(file)
--- a/
includes/OutputPage.php
+++ b/
includes/OutputPage.php
@@
-2013,7
+2013,7
@@
class OutputPage extends ContextSource {
}
$age = time() - wfTimestamp( TS_UNIX, $mtime );
}
$age = time() - wfTimestamp( TS_UNIX, $mtime );
- $adaptiveTTL = max( .9 * $age, $minTTL );
+ $adaptiveTTL = max(
0
.9 * $age, $minTTL );
$adaptiveTTL = min( $adaptiveTTL, $maxTTL );
$this->lowerCdnMaxage( (int)$adaptiveTTL );
$adaptiveTTL = min( $adaptiveTTL, $maxTTL );
$this->lowerCdnMaxage( (int)$adaptiveTTL );
diff --git
a/includes/libs/filebackend/FileBackendStore.php
b/includes/libs/filebackend/FileBackendStore.php
index
77473d1
..
b8eec3f
100644
(file)
--- a/
includes/libs/filebackend/FileBackendStore.php
+++ b/
includes/libs/filebackend/FileBackendStore.php
@@
-1714,7
+1714,7
@@
abstract class FileBackendStore extends FileBackend {
return; // invalid storage path
}
$mtime = ConvertibleTimestamp::convert( TS_UNIX, $val['mtime'] );
return; // invalid storage path
}
$mtime = ConvertibleTimestamp::convert( TS_UNIX, $val['mtime'] );
- $ttl = $this->memCache->adaptiveTTL( $mtime, 7 * 86400, 300, .1 );
+ $ttl = $this->memCache->adaptiveTTL( $mtime, 7 * 86400, 300,
0
.1 );
$key = $this->fileCacheKey( $path );
// Set the cache unless it is currently salted.
$this->memCache->set( $key, $val, $ttl );
$key = $this->fileCacheKey( $path );
// Set the cache unless it is currently salted.
$this->memCache->set( $key, $val, $ttl );
diff --git
a/includes/libs/objectcache/BagOStuff.php
b/includes/libs/objectcache/BagOStuff.php
index
f834ccf
..
8a23db5
100644
(file)
--- a/
includes/libs/objectcache/BagOStuff.php
+++ b/
includes/libs/objectcache/BagOStuff.php
@@
-476,7
+476,7
@@
abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
$lSince = microtime( true ); // lock timestamp
return new ScopedCallback( function () use ( $key, $lSince, $expiry ) {
$lSince = microtime( true ); // lock timestamp
return new ScopedCallback( function () use ( $key, $lSince, $expiry ) {
- $latency = .050; // latency skew (err towards keeping lock present)
+ $latency =
0
.050; // latency skew (err towards keeping lock present)
$age = ( microtime( true ) - $lSince + $latency );
if ( ( $age + $latency ) >= $expiry ) {
$this->logger->warning( "Lock for $key held too long ($age sec)." );
$age = ( microtime( true ) - $lSince + $latency );
if ( ( $age + $latency ) >= $expiry ) {
$this->logger->warning( "Lock for $key held too long ($age sec)." );
diff --git
a/includes/libs/objectcache/MemcachedBagOStuff.php
b/includes/libs/objectcache/MemcachedBagOStuff.php
index
5128d82
..
0188991
100644
(file)
--- a/
includes/libs/objectcache/MemcachedBagOStuff.php
+++ b/
includes/libs/objectcache/MemcachedBagOStuff.php
@@
-45,7
+45,7
@@
class MemcachedBagOStuff extends BagOStuff {
protected function applyDefaultParams( $params ) {
return $params + [
'compress_threshold' => 1500,
protected function applyDefaultParams( $params ) {
return $params + [
'compress_threshold' => 1500,
- 'connect_timeout' => .5,
+ 'connect_timeout' =>
0
.5,
'debug' => false
];
}
'debug' => false
];
}
diff --git
a/includes/libs/objectcache/WANObjectCache.php
b/includes/libs/objectcache/WANObjectCache.php
index
c1c9cc1
..
1f757a4
100644
(file)
--- a/
includes/libs/objectcache/WANObjectCache.php
+++ b/
includes/libs/objectcache/WANObjectCache.php
@@
-1424,7
+1424,7
@@
class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
* @return int Adaptive TTL
* @since 1.28
*/
* @return int Adaptive TTL
* @since 1.28
*/
- public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = .2 ) {
+ public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor =
0
.2 ) {
if ( is_float( $mtime ) || ctype_digit( $mtime ) ) {
$mtime = (int)$mtime; // handle fractional seconds and string integers
}
if ( is_float( $mtime ) || ctype_digit( $mtime ) ) {
$mtime = (int)$mtime; // handle fractional seconds and string integers
}
diff --git
a/includes/libs/rdbms/TransactionProfiler.php
b/includes/libs/rdbms/TransactionProfiler.php
index
af431a6
..
57a12a4
100644
(file)
--- a/
includes/libs/rdbms/TransactionProfiler.php
+++ b/
includes/libs/rdbms/TransactionProfiler.php
@@
-39,7
+39,7
@@
class TransactionProfiler implements LoggerAwareInterface {
/** @var float Seconds */
protected $dbLockThreshold = 3.0;
/** @var float Seconds */
/** @var float Seconds */
protected $dbLockThreshold = 3.0;
/** @var float Seconds */
- protected $eventThreshold = .25;
+ protected $eventThreshold =
0
.25;
/** @var bool */
protected $silenced = false;
/** @var bool */
protected $silenced = false;
diff --git
a/includes/libs/rdbms/database/Database.php
b/includes/libs/rdbms/database/Database.php
index
2c66d74
..
c904092
100644
(file)
--- a/
includes/libs/rdbms/database/Database.php
+++ b/
includes/libs/rdbms/database/Database.php
@@
-54,8
+54,8
@@
abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
const PING_TTL = 1.0;
const PING_QUERY = 'SELECT 1 AS ping';
const PING_TTL = 1.0;
const PING_QUERY = 'SELECT 1 AS ping';
- const TINY_WRITE_SEC = .010;
- const SLOW_WRITE_SEC = .500;
+ const TINY_WRITE_SEC =
0
.010;
+ const SLOW_WRITE_SEC =
0
.500;
const SMALL_WRITE_ROWS = 100;
/** @var string SQL query */
const SMALL_WRITE_ROWS = 100;
/** @var string SQL query */
diff --git
a/includes/libs/rdbms/loadmonitor/LoadMonitor.php
b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
index
fdc5ac8
..
8292c03
100644
(file)
--- a/
includes/libs/rdbms/loadmonitor/LoadMonitor.php
+++ b/
includes/libs/rdbms/loadmonitor/LoadMonitor.php
@@
-157,7
+157,7
@@
class LoadMonitor implements ILoadMonitor {
$newWeight = $movAveRatio * $coefficient + ( 1 - $movAveRatio ) * $lastWeight;
// Scale from 10% to 100% of nominal weight
$newWeight = $movAveRatio * $coefficient + ( 1 - $movAveRatio ) * $lastWeight;
// Scale from 10% to 100% of nominal weight
- $weightScales[$i] = max( $newWeight, .10 );
+ $weightScales[$i] = max( $newWeight,
0
.10 );
if ( !$conn ) {
$lagTimes[$i] = false;
if ( !$conn ) {
$lagTimes[$i] = false;
diff --git
a/includes/parser/ParserOutput.php
b/includes/parser/ParserOutput.php
index
2981748
..
06319e5
100644
(file)
--- a/
includes/parser/ParserOutput.php
+++ b/
includes/parser/ParserOutput.php
@@
-223,7
+223,7
@@
class ParserOutput extends CacheTime {
// finalizeAdaptiveCacheExpiry() uses TTL = MAX( m * PARSE_TIME + b, MIN_AR_TTL)
// Current values imply that m=3933.333333 and b=-333.333333
// See https://www.nngroup.com/articles/website-response-times/
// finalizeAdaptiveCacheExpiry() uses TTL = MAX( m * PARSE_TIME + b, MIN_AR_TTL)
// Current values imply that m=3933.333333 and b=-333.333333
// See https://www.nngroup.com/articles/website-response-times/
- const PARSE_FAST_SEC = .100; // perceived "fast" page parse
+ const PARSE_FAST_SEC =
0
.100; // perceived "fast" page parse
const PARSE_SLOW_SEC = 1.0; // perceived "slow" page parse
const FAST_AR_TTL = 60; // adaptive TTL for "fast" pages
const SLOW_AR_TTL = 3600; // adaptive TTL for "slow" pages
const PARSE_SLOW_SEC = 1.0; // perceived "slow" page parse
const FAST_AR_TTL = 60; // adaptive TTL for "fast" pages
const SLOW_AR_TTL = 3600; // adaptive TTL for "slow" pages
diff --git
a/phpcs.xml
b/phpcs.xml
index
4c5266e
..
bd9890b
100644
(file)
--- a/
phpcs.xml
+++ b/
phpcs.xml
@@
-20,6
+20,9
@@
<exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
<exclude name="MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals" />
<exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionVarUsage" />
<exclude name="MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals" />
+ <exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" />
+ <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
+ <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
</rule>
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
<properties>
</rule>
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
<properties>
diff --git
a/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
b/tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
index
b6682f7
..
a70f136
100644
(file)
--- a/
tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
+++ b/
tests/phpunit/includes/GlobalFunctions/wfTimestampTest.php
@@
-21,7
+21,7
@@
class WfTimestampTest extends MediaWikiTestCase {
[ -30281104, TS_MW, '19690115123456', 'Negative TS_UNIX to TS_MW' ],
[ $t, TS_UNIX, 979562096, 'TS_UNIX to TS_UNIX' ],
[ $t, TS_DB, '2001-01-15 12:34:56', 'TS_UNIX to TS_DB' ],
[ -30281104, TS_MW, '19690115123456', 'Negative TS_UNIX to TS_MW' ],
[ $t, TS_UNIX, 979562096, 'TS_UNIX to TS_UNIX' ],
[ $t, TS_DB, '2001-01-15 12:34:56', 'TS_UNIX to TS_DB' ],
- [ $t + .01, TS_MW, '20010115123456', 'TS_UNIX float to TS_MW' ],
+ [ $t +
0
.01, TS_MW, '20010115123456', 'TS_UNIX float to TS_MW' ],
[ $t, TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_ISO_8601_BASIC to TS_DB' ],
[ $t, TS_ISO_8601_BASIC, '20010115T123456Z', 'TS_ISO_8601_BASIC to TS_DB' ],
diff --git
a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
index
881ace2
..
c762aa7
100644
(file)
--- a/
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
@@
-1184,11
+1184,11
@@
class WANObjectCacheTest extends PHPUnit_Framework_TestCase {
public static function provideAdaptiveTTL() {
return [
public static function provideAdaptiveTTL() {
return [
- [ 3600, 900, 30, .2, 720 ],
- [ 3600, 500, 30, .2, 500 ],
- [ 3600, 86400, 800, .2, 800 ],
- [ false, 86400, 800, .2, 800 ],
- [ null, 86400, 800, .2, 800 ]
+ [ 3600, 900, 30,
0
.2, 720 ],
+ [ 3600, 500, 30,
0
.2, 500 ],
+ [ 3600, 86400, 800,
0
.2, 800 ],
+ [ false, 86400, 800,
0
.2, 800 ],
+ [ null, 86400, 800,
0
.2, 800 ]
];
}
];
}
diff --git
a/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
b/tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
index
cb18fb3
..
b6ea426
100644
(file)
--- a/
tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
+++ b/
tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
@@
-112,10
+112,10
@@
class TransactionProfilerTest extends PHPUnit_Framework_TestCase {
$tp->setLogger( $logger );
$tp->setExpectation( 'queries', 2, __METHOD__ );
$tp->setLogger( $logger );
$tp->setExpectation( 'queries', 2, __METHOD__ );
- $tp->recordQueryCompletion( "SQL 1", microtime( true ) - .01, false, 0 );
- $tp->recordQueryCompletion( "SQL 2", microtime( true ) - .01, false, 0 );
- $tp->recordQueryCompletion( "SQL 3", microtime( true ) - .01, false, 0 ); // warn
- $tp->recordQueryCompletion( "SQL 4", microtime( true ) - .01, false, 0 ); // warn
+ $tp->recordQueryCompletion( "SQL 1", microtime( true ) -
0
.01, false, 0 );
+ $tp->recordQueryCompletion( "SQL 2", microtime( true ) -
0
.01, false, 0 );
+ $tp->recordQueryCompletion( "SQL 3", microtime( true ) -
0
.01, false, 0 ); // warn
+ $tp->recordQueryCompletion( "SQL 4", microtime( true ) -
0
.01, false, 0 ); // warn
}
public function testWriteQueryCount() {
}
public function testWriteQueryCount() {
@@
-126,16
+126,16
@@
class TransactionProfilerTest extends PHPUnit_Framework_TestCase {
$tp->setLogger( $logger );
$tp->setExpectation( 'writes', 2, __METHOD__ );
$tp->setLogger( $logger );
$tp->setExpectation( 'writes', 2, __METHOD__ );
- $tp->recordQueryCompletion( "SQL 1", microtime( true ) - .01, false, 0 );
- $tp->recordQueryCompletion( "SQL 2", microtime( true ) - .01, false, 0 );
- $tp->recordQueryCompletion( "SQL 3", microtime( true ) - .01, false, 0 );
- $tp->recordQueryCompletion( "SQL 4", microtime( true ) - .01, false, 0 );
+ $tp->recordQueryCompletion( "SQL 1", microtime( true ) -
0
.01, false, 0 );
+ $tp->recordQueryCompletion( "SQL 2", microtime( true ) -
0
.01, false, 0 );
+ $tp->recordQueryCompletion( "SQL 3", microtime( true ) -
0
.01, false, 0 );
+ $tp->recordQueryCompletion( "SQL 4", microtime( true ) -
0
.01, false, 0 );
$tp->transactionWritingIn( 'srv1', 'db1', '123' );
$tp->transactionWritingIn( 'srv1', 'db1', '123' );
- $tp->recordQueryCompletion( "SQL 1w", microtime( true ) - .01, true, 2 );
- $tp->recordQueryCompletion( "SQL 2w", microtime( true ) - .01, true, 5 );
- $tp->recordQueryCompletion( "SQL 3w", microtime( true ) - .01, true, 3 );
- $tp->recordQueryCompletion( "SQL 4w", microtime( true ) - .01, true, 1 );
+ $tp->recordQueryCompletion( "SQL 1w", microtime( true ) -
0
.01, true, 2 );
+ $tp->recordQueryCompletion( "SQL 2w", microtime( true ) -
0
.01, true, 5 );
+ $tp->recordQueryCompletion( "SQL 3w", microtime( true ) -
0
.01, true, 3 );
+ $tp->recordQueryCompletion( "SQL 4w", microtime( true ) -
0
.01, true, 1 );
$tp->transactionWritingOut( 'srv1', 'db1', '123', 1, 1 );
}
}
$tp->transactionWritingOut( 'srv1', 'db1', '123', 1, 1 );
}
}
diff --git
a/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
b/tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
index
b564310
..
456447f
100644
(file)
--- a/
tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
+++ b/
tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
@@
-352,8
+352,8
@@
class DatabaseMysqlBaseTest extends PHPUnit_Framework_TestCase {
$db->setLBInfo( 'clusterMasterHost', 'db1052' );
$lagEst = $db->getLag();
$db->setLBInfo( 'clusterMasterHost', 'db1052' );
$lagEst = $db->getLag();
- $this->assertGreaterThan( $lag - .010, $lagEst, "Correct heatbeat lag" );
- $this->assertLessThan( $lag + .010, $lagEst, "Correct heatbeat lag" );
+ $this->assertGreaterThan( $lag -
0
.010, $lagEst, "Correct heatbeat lag" );
+ $this->assertLessThan( $lag +
0
.010, $lagEst, "Correct heatbeat lag" );
}
public static function provideLagAmounts() {
}
public static function provideLagAmounts() {