<?php
+use MediaWiki\MediaWikiServices;
+
/**
* Wraps the user object, so we can also retain full access to properties
* like password if we log in via the API.
private function assertNotReal() {
global $wgDBprefix;
- if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX &&
- $wgDBprefix !== MediaWikiTestCase::ORA_DB_PREFIX
- ) {
+ if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX ) {
throw new MWException( "Can't create user on real database" );
}
}
throw new MWException( "Passed User has an ID but is not in the database?" );
}
- $passwordFactory = new PasswordFactory();
- $passwordFactory->init( RequestContext::getMain()->getConfig() );
- if ( !$passwordFactory->newFromCiphertext( $row->user_password )->equals( $password ) ) {
+ $passwordFactory = MediaWikiServices::getInstance()->getPasswordFactory();
+ if ( !$passwordFactory->newFromCiphertext( $row->user_password )->verify( $password ) ) {
$passwordHash = $passwordFactory->newFromPlaintext( $password );
$dbw->update(
'user',