X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=7a5a5d8489cf80588b35aefb004f8b670e8ce95f;hb=686aad4a8ca3dc5825c044bded4ad3414c2f77ea;hp=5b809e49944569ff7e697c7a37bd9a793fe24af0;hpb=6e65e0ab0d0dc5e7e0ea000f024a3481da35505b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5b809e4994..7a5a5d8489 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1050,7 +1050,7 @@ function wfMatchesDomainList( $url, $domains ) { */ function wfDebug( $text, $dest = 'all', array $context = [] ) { global $wgDebugRawPage, $wgDebugLogPrefix; - global $wgDebugTimestamps, $wgRequestTime; + global $wgDebugTimestamps; if ( !$wgDebugRawPage && wfIsDebugRawPage() ) { return; @@ -1061,7 +1061,7 @@ function wfDebug( $text, $dest = 'all', array $context = [] ) { if ( $wgDebugTimestamps ) { $context['seconds_elapsed'] = sprintf( '%6.4f', - microtime( true ) - $wgRequestTime + microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'] ); $context['memory_used'] = sprintf( '%5.1fM', @@ -1514,9 +1514,11 @@ function wfHostname() { * @return string */ function wfReportTime() { - global $wgRequestTime, $wgShowHostnames; + global $wgShowHostnames; - $responseTime = round( ( microtime( true ) - $wgRequestTime ) * 1000 ); + $elapsed = ( microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'] ); + // seconds to milliseconds + $responseTime = round( $elapsed * 1000 ); $reportVars = [ 'wgBackendResponseTime' => $responseTime ]; if ( $wgShowHostnames ) { $reportVars['wgHostname'] = wfHostname(); @@ -2686,30 +2688,6 @@ function wfRelativePath( $path, $from ) { return implode( DIRECTORY_SEPARATOR, $pieces ); } -/** - * Convert an arbitrarily-long digit string from one numeric base - * to another, optionally zero-padding to a minimum column width. - * - * Supports base 2 through 36; digit values 10-36 are represented - * as lowercase letters a-z. Input is case-insensitive. - * - * @deprecated since 1.27 Use Wikimedia\base_convert() directly - * - * @param string $input Input number - * @param int $sourceBase Base of the input number - * @param int $destBase Desired base of the output - * @param int $pad Minimum number of digits in the output (pad with zeroes) - * @param bool $lowercase Whether to output in lowercase or uppercase - * @param string $engine Either "gmp", "bcmath", or "php" - * @return string|bool The output number as a string, or false on error - */ -function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, - $lowercase = true, $engine = 'auto' -) { - wfDeprecated( __FUNCTION__, '1.27' ); - return Wikimedia\base_convert( $input, $sourceBase, $destBase, $pad, $lowercase, $engine ); -} - /** * Reset the session id * @@ -3052,7 +3030,8 @@ function wfWaitForSlaves( } try { - wfGetLBFactory()->waitForReplication( [ + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $lbFactory->waitForReplication( [ 'wiki' => $wiki, 'cluster' => $cluster, 'timeout' => $timeout,