* @author Roan Kattouw
*/
+use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
+use Wikimedia\ScopedCallback;
/**
* Abstraction for ResourceLoader modules, with name registration and maxage functionality.
public function getConfig() {
if ( $this->config === null ) {
// Ugh, fall back to default
- $this->config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
+ $this->config = MediaWikiServices::getInstance()->getMainConfig();
}
return $this->config;
}
/**
- * Where on the HTML page should this module's JS be loaded?
- * - 'top': in the "<head>"
- * - 'bottom': at the bottom of the "<body>"
+ * From where in the page HTML should this module be loaded?
*
+ * @deprecated since 1.29 Obsolete. All modules load async from `<head>`.
* @return string
*/
public function getPosition() {
- return 'bottom';
+ return 'top';
}
/**
);
if ( $dbw->trxLevel() ) {
- $dbw->onTransactionResolution( function () use ( &$scopeLock ) {
- ScopedCallback::consume( $scopeLock ); // release after commit
- } );
+ $dbw->onTransactionResolution(
+ function () use ( &$scopeLock ) {
+ ScopedCallback::consume( $scopeLock ); // release after commit
+ },
+ __METHOD__
+ );
}
}
} catch ( Exception $e ) {