use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\IDatabase;
-use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\ILoadBalancer;
/**
* Base class for objects that allow access to other wiki's databases using
*
* @since 1.21
*
- * @return LoadBalancer The database load balancer object
+ * @return ILoadBalancer The database load balancer object
*/
public function getLoadBalancer() {
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
'type' => $this->mButtonType,
'label' => $this->mButtonValue,
'flags' => $this->mButtonFlags,
+ 'id' => $this->mButtonId,
] + OOUI\Element::configFromHtmlAttributes(
$this->getAttributes( [ 'disabled', 'tabindex' ] )
) );
$maintClass = false;
+// Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
+// if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
+// been run.
+if ( strval( getenv( 'MW_INSTALL_PATH' ) ) === '' ) {
+ putenv( 'MW_INSTALL_PATH=' . realpath( __DIR__ . '/..' ) );
+}
+
use Wikimedia\Rdbms\IDatabase;
use MediaWiki\Logger\LoggerFactory;
use MediaWiki\MediaWikiServices;
* their own constructors
*/
public function __construct() {
- // Setup $IP, using MW_INSTALL_PATH if it exists
global $IP;
- $IP = strval( getenv( 'MW_INSTALL_PATH' ) ) !== ''
- ? getenv( 'MW_INSTALL_PATH' )
- : realpath( __DIR__ . '/..' );
+ $IP = getenv( 'MW_INSTALL_PATH' );
$this->addDefaultParams();
register_shutdown_function( [ $this, 'outputChanneled' ], false );