dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pass options as array to IDatabase::insert
[lhc/web/wiklou.git]
/
includes
/
installer
/
DatabaseUpdater.php
diff --git
a/includes/installer/DatabaseUpdater.php
b/includes/installer/DatabaseUpdater.php
index
750f108
..
de7a347
100644
(file)
--- a/
includes/installer/DatabaseUpdater.php
+++ b/
includes/installer/DatabaseUpdater.php
@@
-20,8
+20,8
@@
* @file
* @ingroup Deployment
*/
* @file
* @ingroup Deployment
*/
-use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
use MediaWiki\MediaWikiServices;
require_once __DIR__ . '/../../maintenance/Maintenance.php';
@@
-59,7
+59,7
@@
abstract class DatabaseUpdater {
/**
* Handle to the database subclass
*
/**
* Handle to the database subclass
*
- * @var Database
+ * @var
IMaintainable
Database
*/
protected $db;
*/
protected $db;
@@
-110,11
+110,15
@@
abstract class DatabaseUpdater {
protected $holdContentHandlerUseDB = true;
/**
protected $holdContentHandlerUseDB = true;
/**
- * @param Database &$db To perform updates on
+ * @param
IMaintainable
Database &$db To perform updates on
* @param bool $shared Whether to perform updates on shared tables
* @param Maintenance|null $maintenance Maintenance object which created us
*/
* @param bool $shared Whether to perform updates on shared tables
* @param Maintenance|null $maintenance Maintenance object which created us
*/
- protected function __construct( Database &$db, $shared, Maintenance $maintenance = null ) {
+ protected function __construct(
+ IMaintainableDatabase &$db,
+ $shared,
+ Maintenance $maintenance = null
+ ) {
$this->db = $db;
$this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
$this->shared = $shared;
$this->db = $db;
$this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
$this->shared = $shared;
@@
-177,14
+181,18
@@
abstract class DatabaseUpdater {
}
/**
}
/**
- * @param Database $db
+ * @param
IMaintainable
Database $db
* @param bool $shared
* @param Maintenance|null $maintenance
*
* @throws MWException
* @return DatabaseUpdater
*/
* @param bool $shared
* @param Maintenance|null $maintenance
*
* @throws MWException
* @return DatabaseUpdater
*/
- public static function newForDB( Database $db, $shared = false, Maintenance $maintenance = null ) {
+ public static function newForDB(
+ IMaintainableDatabase $db,
+ $shared = false,
+ Maintenance $maintenance = null
+ ) {
$type = $db->getType();
if ( in_array( $type, Installer::getDBTypes() ) ) {
$class = ucfirst( $type ) . 'Updater';
$type = $db->getType();
if ( in_array( $type, Installer::getDBTypes() ) ) {
$class = ucfirst( $type ) . 'Updater';
@@
-198,7
+206,7
@@
abstract class DatabaseUpdater {
/**
* Get a database connection to run updates
*
/**
* Get a database connection to run updates
*
- * @return Database
+ * @return
IMaintainable
Database
*/
public function getDB() {
return $this->db;
*/
public function getDB() {
return $this->db;
@@
-523,7
+531,7
@@
abstract class DatabaseUpdater {
if ( $val && $this->canUseNewUpdatelog() ) {
$values['ul_value'] = $val;
}
if ( $val && $this->canUseNewUpdatelog() ) {
$values['ul_value'] = $val;
}
- $this->db->insert( 'updatelog', $values, __METHOD__,
'IGNORE'
);
+ $this->db->insert( 'updatelog', $values, __METHOD__,
[ 'IGNORE' ]
);
$this->db->setFlag( DBO_DDLMODE );
}
$this->db->setFlag( DBO_DDLMODE );
}
@@
-1219,7
+1227,7
@@
abstract class DatabaseUpdater {
*/
protected function rebuildLocalisationCache() {
/**
*/
protected function rebuildLocalisationCache() {
/**
- * @var
$cl RebuildLocalisationCache
+ * @var
RebuildLocalisationCache $cl
*/
$cl = $this->maintenance->runChild(
RebuildLocalisationCache::class, 'rebuildLocalisationCache.php'
*/
$cl = $this->maintenance->runChild(
RebuildLocalisationCache::class, 'rebuildLocalisationCache.php'