jenkins-bot has submitted this change and it was merged.

Change subject: Fix SQLite $wgObjectCaches definition + b/c handling
......................................................................


Fix SQLite $wgObjectCaches definition + b/c handling

Follow-up to 47e816c69c197fec86c344256d81d7c8f781b880

Change-Id: Id94857a7c8726871cf826a34b5cf10cb465b7125
---
M includes/installer/SqliteInstaller.php
M includes/objectcache/ObjectCache.php
2 files changed, 19 insertions(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  Hoo man: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/installer/SqliteInstaller.php 
b/includes/installer/SqliteInstaller.php
index 6024331..9bf87f4 100644
--- a/includes/installer/SqliteInstaller.php
+++ b/includes/installer/SqliteInstaller.php
@@ -319,6 +319,7 @@
                'type' => 'sqlite',
                'dbname' => 'wikicache',
                'tablePrefix' => '',
+               'dbDirectory' => \$wgSQLiteDataDir,
                'flags' => 0
        ]
 ];";
diff --git a/includes/objectcache/ObjectCache.php 
b/includes/objectcache/ObjectCache.php
index 1e0013f..ea237aa 100644
--- a/includes/objectcache/ObjectCache.php
+++ b/includes/objectcache/ObjectCache.php
@@ -183,8 +183,25 @@
                        $params['reportDupes'] = isset( $params['reportDupes'] )
                                ? $params['reportDupes']
                                : true;
+                       // Do b/c logic for SqlBagOStuff
+                       if ( is_subclass_of( $class, SqlBagOStuff::class ) ) {
+                               if ( isset( $params['server'] ) && !isset( 
$params['servers'] ) ) {
+                                       $params['servers'] = [ 
$params['server'] ];
+                                       unset( $param['server'] );
+                               }
+                               // In the past it was not required to set 
'dbDirectory' in $wgObjectCaches
+                               if ( isset( $params['servers'] ) ) {
+                                       foreach ( $params['servers'] as 
&$server ) {
+                                               if ( $server['type'] === 
'sqlite' && !isset( $server['dbDirectory'] ) ) {
+                                                       $server['dbDirectory'] 
= MediaWikiServices::getInstance()
+                                                               
->getMainConfig()->get( 'SQLiteDataDir' );
+                                               }
+                                       }
+                               }
+                       }
+
                        // Do b/c logic for MemcachedBagOStuff
-                       if ( is_subclass_of( $class, 'MemcachedBagOStuff' ) ) {
+                       if ( is_subclass_of( $class, MemcachedBagOStuff::class 
) ) {
                                if ( !isset( $params['servers'] ) ) {
                                        $params['servers'] = 
$GLOBALS['wgMemCachedServers'];
                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/311487
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id94857a7c8726871cf826a34b5cf10cb465b7125
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hoo man <h...@online.de>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to