Index: trunk/phase3/includes/objectcache/DBABagOStuff.php |
— | — | @@ -6,20 +6,23 @@ |
7 | 7 | * writer locks. Intended for development use only, as a memcached workalike |
8 | 8 | * for systems that don't have it. |
9 | 9 | * |
| 10 | + * On construction you can pass array( 'dir' => '/some/path' ); as a parameter |
| 11 | + * to override the default DBA files directory (wgTmpDirectory). |
| 12 | + * |
10 | 13 | * @ingroup Cache |
11 | 14 | */ |
12 | 15 | class DBABagOStuff extends BagOStuff { |
13 | 16 | var $mHandler, $mFile, $mReader, $mWriter, $mDisabled; |
14 | 17 | |
15 | | - public function __construct( $dir = false ) { |
| 18 | + public function __construct( $params ) { |
16 | 19 | global $wgDBAhandler; |
17 | 20 | |
18 | | - if ( $dir === false ) { |
| 21 | + if ( !isset( $params['dir'] ) ) { |
19 | 22 | global $wgTmpDirectory; |
20 | | - $dir = $wgTmpDirectory; |
| 23 | + $params['dir'] = $wgTmpDirectory; |
21 | 24 | } |
22 | 25 | |
23 | | - $this->mFile = "$dir/mw-cache-" . wfWikiID(); |
| 26 | + $this->mFile = $params['dir']."/mw-cache-" . wfWikiID(); |
24 | 27 | $this->mFile .= '.db'; |
25 | 28 | wfDebug( __CLASS__ . ": using cache file {$this->mFile}\n" ); |
26 | 29 | $this->mHandler = $wgDBAhandler; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1529,6 +1529,8 @@ |
1530 | 1530 | * given, giving a callable function which will generate a suitable cache object. |
1531 | 1531 | * |
1532 | 1532 | * The other parameters are dependent on the class used. |
| 1533 | + * - CACHE_DBA uses $wgTmpDirectory by default. The 'dir' parameter let you |
| 1534 | + * overrides that. |
1533 | 1535 | */ |
1534 | 1536 | $wgObjectCaches = array( |
1535 | 1537 | CACHE_NONE => array( 'class' => 'EmptyBagOStuff' ), |