* @see Message::__construct
*/
function wfMessage( $key /*...*/ ) {
+ $message = new Message( $key );
+
+ // We call Message::params() to reduce code duplication
$params = func_get_args();
array_shift( $params );
- if ( isset( $params[0] ) && is_array( $params[0] ) ) {
- $params = $params[0];
+ if ( $params ) {
+ call_user_func_array( [ $message, 'params' ], $params );
}
- return new Message( $key, $params );
+
+ return $message;
}
/**
$wgOut->sendCacheControl();
}
+ MediaWiki\HeaderCallback::warnIfHeadersSent();
header( 'Content-type: text/html; charset=utf-8' );
print '<!DOCTYPE html>' .
'<html><head><title>' .
MediaWiki\suppressWarnings( true );
}
-# Autodetect, convert and provide timestamps of various types
-
-require_once __DIR__ . '/libs/time/defines.php';
-
/**
* Get a timestamp string in one of various formats
*
* or MediaWikiServices::getDBLoadBalancerFactory() instead.
*
* @param string|bool $wiki Wiki ID, or false for the current wiki
- * @return LoadBalancer
+ * @return \Wikimedia\Rdbms\LoadBalancer
*/
function wfGetLB( $wiki = false ) {
if ( $wiki === false ) {
*
* @deprecated since 1.27, use MediaWikiServices::getDBLoadBalancerFactory() instead.
*
- * @return LBFactory
+ * @return \Wikimedia\Rdbms\LBFactory
*/
function wfGetLBFactory() {
return \MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancerFactory();