X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=7256eab2fbeeceb03dc1b7ae4b46253179e0c9ab;hb=ed11415e690a33ad1120d82c33b1713ff84f9808;hp=c7a45c72b33f287b59b677d5fc17d4ff621491c5;hpb=52d871d0908282aa29dbf35b5ebc10c5cb5cfa09;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index c7a45c72b3..7256eab2fb 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -32,6 +32,7 @@ use MediaWiki\Session\SessionManager; use MediaWiki\Shell\Shell; use Wikimedia\ScopedCallback; use Wikimedia\WrappedString; +use Wikimedia\AtEase\AtEase; /** * Load an extension @@ -799,9 +800,9 @@ function wfParseUrl( $url ) { if ( $wasRelative ) { $url = "http:$url"; } - Wikimedia\suppressWarnings(); + AtEase::suppressWarnings(); $bits = parse_url( $url ); - Wikimedia\restoreWarnings(); + AtEase::restoreWarnings(); // parse_url() returns an array without scheme for some invalid URLs, e.g. // parse_url("%0Ahttp://example.com") == [ 'host' => '%0Ahttp', 'path' => 'example.com' ] if ( !$bits || !isset( $bits['scheme'] ) ) { @@ -1846,24 +1847,6 @@ function wfNegotiateType( $cprefs, $sprefs ) { return $besttype; } -/** - * Reference-counted warning suppression - * - * @deprecated since 1.26, use Wikimedia\suppressWarnings() directly - * @param bool $end - */ -function wfSuppressWarnings( $end = false ) { - Wikimedia\suppressWarnings( $end ); -} - -/** - * @deprecated since 1.26, use Wikimedia\restoreWarnings() directly - * Restore error level to previous value - */ -function wfRestoreWarnings() { - Wikimedia\restoreWarnings(); -} - /** * Get a timestamp string in one of various formats * @@ -1990,9 +1973,9 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) { } // Turn off the normal warning, we're doing our own below - Wikimedia\suppressWarnings(); + AtEase::suppressWarnings(); $ok = mkdir( $dir, $mode, true ); // PHP5 <3 - Wikimedia\restoreWarnings(); + AtEase::restoreWarnings(); if ( !$ok ) { // directory may have been created on another request since we last checked @@ -2230,9 +2213,9 @@ function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) { # This check may also protect against code injection in # case of broken installations. - Wikimedia\suppressWarnings(); + AtEase::suppressWarnings(); $haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 ); - Wikimedia\restoreWarnings(); + AtEase::restoreWarnings(); if ( !$haveDiff3 ) { wfDebug( "diff3 not found\n" ); @@ -2314,9 +2297,9 @@ function wfDiff( $before, $after, $params = '-u' ) { } global $wgDiff; - Wikimedia\suppressWarnings(); + AtEase::suppressWarnings(); $haveDiff = $wgDiff && file_exists( $wgDiff ); - Wikimedia\restoreWarnings(); + AtEase::restoreWarnings(); # This check may also protect against code injection in # case of broken installations. @@ -2492,7 +2475,7 @@ function wfSetupSession( $sessionId = false ) { if ( session_id() !== $session->getId() ) { session_id( $session->getId() ); } - Wikimedia\quietCall( 'session_start' ); + AtEase::quietCall( 'session_start' ); } /** @@ -2627,31 +2610,31 @@ function wfGetLB( $wiki = false ) { * @return \Wikimedia\Rdbms\LBFactory */ function wfGetLBFactory() { - wfDeprecated( __METHOD__, '1.34' ); + wfDeprecated( __METHOD__, '1.27' ); return MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); } /** * Find a file. - * Shortcut for RepoGroup::singleton()->findFile() - * + * @deprecated since 1.34, use MediaWikiServices * @param string|LinkTarget $title String or LinkTarget object * @param array $options Associative array of options (see RepoGroup::findFile) * @return File|bool File, or false if the file does not exist */ function wfFindFile( $title, $options = [] ) { - return RepoGroup::singleton()->findFile( $title, $options ); + return MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title, $options ); } /** * Get an object referring to a locally registered file. * Returns a valid placeholder object if the file does not exist. * + * @deprecated since 1.34, use MediaWikiServices * @param Title|string $title * @return LocalFile|null A File, or null if passed an invalid Title */ function wfLocalFile( $title ) { - return RepoGroup::singleton()->getLocalRepo()->newFile( $title ); + return MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()->newFile( $title ); } /**