X-Git-Url: https://git.heureux-cyclage.org/index.php?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=c6ccf31e631cff338a418fa931083ef54c60277d;hb=586dc66ddda1ee3645c3f5c70c532bc0300c1f52;hp=1859c02e43c941861644073f901e73d1c9acad08;hpb=c1f430f17b2c6ee009c82c2f2002103613b33d02;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 1859c02e43..c6ccf31e63 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1191,7 +1191,8 @@ function wfLogProfilingData() { $profiler->logData(); $config = $context->getConfig(); - if ( $config->get( 'StatsdServer' ) ) { + $stats = MediaWikiServices::getInstance()->getStatsdDataFactory(); + if ( $config->get( 'StatsdServer' ) && $stats->hasData() ) { try { $statsdServer = explode( ':', $config->get( 'StatsdServer' ) ); $statsdHost = $statsdServer[0]; @@ -1199,9 +1200,7 @@ function wfLogProfilingData() { $statsdSender = new SocketSender( $statsdHost, $statsdPort ); $statsdClient = new SamplingStatsdClient( $statsdSender, true, false ); $statsdClient->setSamplingRates( $config->get( 'StatsdSamplingRates' ) ); - $statsdClient->send( - MediaWikiServices::getInstance()->getStatsdDataFactory()->getBuffer() - ); + $statsdClient->send( $stats->getData() ); } catch ( Exception $ex ) { MWExceptionHandler::logException( $ex ); } @@ -2193,8 +2192,6 @@ function wfIniGetBool( $setting ) { * @return string */ function wfEscapeShellArg( /*...*/ ) { - wfInitShellLocale(); - $args = func_get_args(); if ( count( $args ) === 1 && is_array( reset( $args ) ) ) { // If only one argument has been passed, and that argument is an array, @@ -2309,8 +2306,6 @@ function wfShellExec( $cmd, &$retval = null, $environ = [], $includeStderr = isset( $options['duplicateStderr'] ) && $options['duplicateStderr']; $profileMethod = isset( $options['profileMethod'] ) ? $options['profileMethod'] : wfGetCaller(); - wfInitShellLocale(); - $envcmd = ''; foreach ( $environ as $k => $v ) { if ( wfIsWindows() ) { @@ -2534,25 +2529,14 @@ function wfShellExecWithStderr( $cmd, &$retval = null, $environ = [], $limits = } /** - * Set the locale for locale-sensitive operations + * Formerly set the locale for locale-sensitive operations * - * Sets LC_ALL to a known value to work around issues like the following: - * - https://bugs.php.net/bug.php?id=45132 escapeshellarg() destroys non-ASCII - * characters if LANG is not a UTF-8 locale - * - T107128 Scribunto string comparison works case insensitive while the - * standard Lua case sensitive + * This is now done in Setup.php. * + * @deprecated since 1.30, no longer needed * @see $wgShellLocale */ function wfInitShellLocale() { - static $done = false; - if ( $done ) { - return; - } - $done = true; - global $wgShellLocale; - putenv( "LC_ALL=$wgShellLocale" ); - setlocale( LC_ALL, $wgShellLocale ); } /** @@ -3515,7 +3499,9 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) { } $cache = ObjectCache::getLocalServerInstance( 'hash' ); - $key = wfMemcKey( 'bad-image-list', ( $blacklist === null ) ? 'default' : md5( $blacklist ) ); + $key = $cache->makeKey( + 'bad-image-list', ( $blacklist === null ) ? 'default' : md5( $blacklist ) + ); $badImages = $cache->get( $key ); if ( $badImages === false ) { // cache miss