Last modified: 2013-10-23 18:17:20 UTC
In MediaWiki 1.18, when you set DBA as the main caching mechanism ($wgMainCacheType = CACHE_DB) you'll run into an error. In includes/objectcache/DBABagOStuff.php on line 17 you check if $dir === false or not. In my case it isn't, so you assign its value to $this->mFile = "$dir/mw-cache-" . wfWikiID();. The problem is that from v1.18 on the $dir is an array. I got the following when I print_r'd the $dir variable in the first line of the __construct function: Array ( [class] => DBABagOStuff ). Of course in this case the $this->mFile = "$dir/mw-cache-" . wfWikiID(); line will be broken also and that's why later MW cannot open the DBA cache. For an ugly workaround I forced the $wgTempDirectory to be assigned to the $dir variable: if ( $dir === false || is_array($dir) ) { global $wgTmpDirectory; $dir = $wgTmpDirectory; }
We did some refactoring for the object cache refactoring. I did send a patch as r105419 which might apply to 1.18 as is. Once patch is applied, you will be able to configure the CACHE_DBA backend using: $wgObjectCaches[CACHE_DBA]['dir'] = '/some/directory/' Keeping bug open until revision is reviewed in trunk, will then back port it to 1.18 and mark this bug fixed.
backported in REL1_18 with r105706 will be in 1.18.1 Please note another developer advise against the use of CACHE_DBA except for testing :D
Thank you for the quick fix! On a shared hosting I think this is the "best" solution before CACHE_NONE, so I'm forced to use this. Fortunately, if everything goes well we'll move to an other server where APC will be turned on, so we can forget the DBA caching.