use MediaWiki\Shell\Shell;
use Wikimedia\ScopedCallback;
use Wikimedia\WrappedString;
+use Wikimedia\AtEase\AtEase;
/**
* Load an extension
}
}
-/**
- * @deprecated since 1.32, use array_filter() with ARRAY_FILTER_USE_BOTH directly
- *
- * @param array $arr
- * @param callable $callback Will be called with the array value and key (in that order) and
- * should return a bool which will determine whether the array element is kept.
- * @return array
- */
-function wfArrayFilter( array $arr, callable $callback ) {
- wfDeprecated( __FUNCTION__, '1.32' );
- return array_filter( $arr, $callback, ARRAY_FILTER_USE_BOTH );
-}
-
-/**
- * @deprecated since 1.32, use array_filter() with ARRAY_FILTER_USE_KEY directly
- *
- * @param array $arr
- * @param callable $callback Will be called with the array key and should return a bool which
- * will determine whether the array element is kept.
- * @return array
- */
-function wfArrayFilterByKey( array $arr, callable $callback ) {
- wfDeprecated( __FUNCTION__, '1.32' );
- return array_filter( $arr, $callback, ARRAY_FILTER_USE_KEY );
-}
-
/**
* Appends to second array if $value differs from that in $default
*
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'] ) ) {
);
}
-/**
- * Make URL indexes, appropriate for the el_index field of externallinks.
- *
- * @deprecated since 1.33, use LinkFilter::makeIndexes() instead
- * @param string $url
- * @return array
- */
-function wfMakeUrlIndexes( $url ) {
- wfDeprecated( __FUNCTION__, '1.33' );
- return LinkFilter::makeIndexes( $url );
-}
-
/**
* Check whether a given URL has a domain that occurs in a given set of domains
* @param string $url
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
*
}
// 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
# 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" );
}
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.
if ( session_id() !== $session->getId() ) {
session_id( $session->getId() );
}
- Wikimedia\quietCall( 'session_start' );
+ AtEase::quietCall( 'session_start' );
}
/**
* Get the load balancer factory object
*
* @deprecated since 1.27, use MediaWikiServices::getInstance()->getDBLoadBalancerFactory() instead.
+ * TODO: Remove in MediaWiki 1.35
*
* @return \Wikimedia\Rdbms\LBFactory
*/
function wfGetLBFactory() {
+ 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 );
}
/**