die( "This file is part of MediaWiki, it is not a valid entry point" );
}
+use MediaWiki\Linker\LinkTarget;
use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
use MediaWiki\ProcOpenError;
use MediaWiki\Session\SessionManager;
-use MediaWiki\MediaWikiServices;
use MediaWiki\Shell\Shell;
use Wikimedia\ScopedCallback;
use Wikimedia\WrappedString;
}
}
-/**
- * @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
*
);
}
-/**
- * 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
// to avoid getting in some kind of infinite loop.
break;
}
- if ( $resetGzipEncoding ) {
- if ( $status['name'] == 'ob_gzhandler' ) {
- // Reset the 'Content-Encoding' field set by this handler
- // so we can start fresh.
- header_remove( 'Content-Encoding' );
- break;
- }
+ if ( $resetGzipEncoding && $status['name'] == 'ob_gzhandler' ) {
+ // Reset the 'Content-Encoding' field set by this handler
+ // so we can start fresh.
+ header_remove( 'Content-Encoding' );
+ break;
}
}
}
*/
function wfRecursiveRemoveDir( $dir ) {
wfDebug( __FUNCTION__ . "( $dir )\n" );
- // taken from https://secure.php.net/manual/en/function.rmdir.php#98622
+ // taken from https://www.php.net/manual/en/function.rmdir.php#98622
if ( is_dir( $dir ) ) {
$objects = scandir( $dir );
foreach ( $objects as $object ) {
* @param string|string[] ...$args strings to escape and glue together,
* or a single array of strings parameter
* @return string
- * @deprecated since 1.30 use MediaWiki\Shell::escape()
+ * @deprecated since 1.30 use MediaWiki\Shell\Shell::escape()
*/
function wfEscapeShellArg( ...$args ) {
return Shell::escape( ...$args );
* 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.34' );
return MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
}
* Find a file.
* Shortcut for RepoGroup::singleton()->findFile()
*
- * @param string|Title $title String or Title object
+ * @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
*/