* @file
* @ingroup Deployment
*/
+
+use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\LBFactorySingle;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
/**
* @var string Set by subclasses
*/
- protected static $notMinimumVerisonMessage;
+ protected static $notMinimumVersionMessage;
/**
* The database connection.
public static function meetsMinimumRequirement( $serverVersion ) {
if ( version_compare( $serverVersion, static::$minimumVersion ) < 0 ) {
return Status::newFatal(
- static::$notMinimumVerisonMessage, static::$minimumVersion, $serverVersion
+ static::$notMinimumVersionMessage, static::$minimumVersion, $serverVersion
);
}
* This will return a cached connection if one is available.
*
* @return Status
+ * @suppress PhanUndeclaredMethod
*/
public function getConnection() {
if ( $this->db ) {
public function setupSchemaVars() {
$status = $this->getConnection();
if ( $status->isOK() ) {
+ // @phan-suppress-next-line PhanUndeclaredMethod
$status->value->setSchemaVars( $this->getSchemaVars() );
} else {
$msg = __METHOD__ . ': unexpected error while establishing'
throw new MWException( __METHOD__ . ': unexpected DB connection error' );
}
- \MediaWiki\MediaWikiServices::resetGlobalInstance();
- $services = \MediaWiki\MediaWikiServices::getInstance();
+ MediaWikiServices::resetGlobalInstance();
+ $services = MediaWikiServices::getInstance();
$connection = $status->value;
$services->redefineService( 'DBLoadBalancerFactory', function () use ( $connection ) {
* @return string
*/
public function getReadableName() {
- // Messages: config-type-mysql, config-type-postgres, config-type-sqlite,
- // config-type-oracle
+ // Messages: config-type-mysql, config-type-postgres, config-type-sqlite
return wfMessage( 'config-type-' . $this->getName() )->text();
}
$this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) .
$this->parent->getHelpBox( 'config-db-web-help' );
if ( $noCreateMsg ) {
- $s .= $this->parent->getWarningBox( wfMessage( $noCreateMsg )->plain() );
+ $s .= Html::warningBox( wfMessage( $noCreateMsg )->plain(), 'config-warning-box' );
} else {
$s .= $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create' );
}