X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=blobdiff_plain;f=includes%2FSetup.php;h=01f67c8caf74edbb6bc3ad95be032b1d39328d35;hb=526341516a91502ac7cfd2e5590e7432b3f50c5d;hp=d6f4b2fe4c0b28cf9ee57e240dd0f0ad83ec8fa1;hpb=e90eafdf6107d4e49c9c20f6310d1d6ee5f5c47f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index d6f4b2fe4c..01f67c8caf 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -249,12 +249,12 @@ $wgNamespaceAliases['Image_talk'] = NS_FILE_TALK; */ $wgLockManagers[] = [ 'name' => 'fsLockManager', - 'class' => 'FSLockManager', + 'class' => FSLockManager::class, 'lockDirectory' => "{$wgUploadDirectory}/lockdir", ]; $wgLockManagers[] = [ 'name' => 'nullLockManager', - 'class' => 'NullLockManager', + 'class' => NullLockManager::class, ]; /** @@ -276,7 +276,7 @@ $wgGalleryOptions += [ */ if ( !$wgLocalFileRepo ) { $wgLocalFileRepo = [ - 'class' => 'LocalRepo', + 'class' => LocalRepo::class, 'name' => 'local', 'directory' => $wgUploadDirectory, 'scriptDirUrl' => $wgScriptPath, @@ -295,7 +295,7 @@ if ( !$wgLocalFileRepo ) { if ( $wgUseSharedUploads ) { if ( $wgSharedUploadDBname ) { $wgForeignFileRepos[] = [ - 'class' => 'ForeignDBRepo', + 'class' => ForeignDBRepo::class, 'name' => 'shared', 'directory' => $wgSharedUploadDirectory, 'url' => $wgSharedUploadPath, @@ -315,7 +315,7 @@ if ( $wgUseSharedUploads ) { ]; } else { $wgForeignFileRepos[] = [ - 'class' => 'FileRepo', + 'class' => FileRepo::class, 'name' => 'shared', 'directory' => $wgSharedUploadDirectory, 'url' => $wgSharedUploadPath, @@ -329,7 +329,7 @@ if ( $wgUseSharedUploads ) { } if ( $wgUseInstantCommons ) { $wgForeignFileRepos[] = [ - 'class' => 'ForeignAPIRepo', + 'class' => ForeignAPIRepo::class, 'name' => 'wikimediacommons', 'apibase' => 'https://commons.wikimedia.org/w/api.php', 'url' => 'https://upload.wikimedia.org/wikipedia/commons', @@ -349,7 +349,7 @@ if ( !isset( $wgLocalFileRepo['backend'] ) ) { $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend'; } foreach ( $wgForeignFileRepos as &$repo ) { - if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) { + if ( !isset( $repo['directory'] ) && $repo['class'] === ForeignAPIRepo::class ) { $repo['directory'] = $wgUploadDirectory; // b/c } if ( !isset( $repo['backend'] ) ) { @@ -360,6 +360,7 @@ unset( $repo ); // no global pollution; destroy reference // Convert this deprecated setting to modern system if ( $wgExperimentalHtmlIds ) { + wfDeprecated( '$wgExperimentalHtmlIds', '1.30' ); $wgFragmentMode = [ 'html5-legacy', 'html5' ]; } @@ -370,9 +371,8 @@ if ( $wgRCFilterByAge ) { // Note that we allow 1 link higher than the max for things like 56 days but a 60 day link. sort( $wgRCLinkDays ); - // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) { - // @codingStandardsIgnoreEnd if ( $wgRCLinkDays[$i] >= $rcMaxAgeDays ) { $wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false ); break; @@ -538,16 +538,16 @@ if ( $wgNewUserLog ) { $wgLogTypes[] = 'newusers'; $wgLogNames['newusers'] = 'newuserlogpage'; $wgLogHeaders['newusers'] = 'newuserlogpagetext'; - $wgLogActionsHandlers['newusers/newusers'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/create'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/create2'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/byemail'] = 'NewUsersLogFormatter'; - $wgLogActionsHandlers['newusers/autocreate'] = 'NewUsersLogFormatter'; + $wgLogActionsHandlers['newusers/newusers'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/create'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/create2'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/byemail'] = NewUsersLogFormatter::class; + $wgLogActionsHandlers['newusers/autocreate'] = NewUsersLogFormatter::class; } if ( $wgPageLanguageUseDB ) { $wgLogTypes[] = 'pagelang'; - $wgLogActionsHandlers['pagelang/pagelang'] = 'PageLangLogFormatter'; + $wgLogActionsHandlers['pagelang/pagelang'] = PageLangLogFormatter::class; } if ( $wgCookieSecure === 'detect' ) { @@ -698,7 +698,7 @@ if ( $wgMainWANCache === false ) { // Sites using multiple datacenters can configure a relayer. $wgMainWANCache = 'mediawiki-main-default'; $wgWANObjectCaches[$wgMainWANCache] = [ - 'class' => 'WANObjectCache', + 'class' => WANObjectCache::class, 'cacheId' => $wgMainCacheType, 'channels' => [ 'purge' => 'wancache-main-default-purge' ] ]; @@ -737,19 +737,19 @@ if ( !$wgDBerrorLogTZ ) { // Initialize the request object in $wgRequest $wgRequest = RequestContext::getMain()->getRequest(); // BackCompat // Set user IP/agent information for causal consistency purposes. -// The cpPosTime cookie has no prefix and is set by MediaWiki::preOutputCommit(). -$cpPosTime = $wgRequest->getFloat( 'cpPosTime', $wgRequest->getCookie( 'cpPosTime', '' ) ); +// The cpPosIndex cookie has no prefix and is set by MediaWiki::preOutputCommit(). +$cpPosIndex = $wgRequest->getInt( 'cpPosIndex', (int)$wgRequest->getCookie( 'cpPosIndex', '' ) ); MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ 'IPAddress' => $wgRequest->getIP(), 'UserAgent' => $wgRequest->getHeader( 'User-Agent' ), 'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ), - 'ChronologyPositionTime' => $cpPosTime + 'ChronologyPositionIndex' => $cpPosIndex ] ); // Make sure that caching does not compromise the consistency improvements -if ( $cpPosTime ) { +if ( $cpPosIndex ) { MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false ); } -unset( $cpPosTime ); +unset( $cpPosIndex ); // Useful debug output if ( $wgCommandLineMode ) {