Index: trunk/phase3/tests/parser/parserTest.inc |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo, |
142 | 142 | $parserMemc, $wgThumbnailScriptPath, $wgScriptPath, |
143 | 143 | $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath, $wgExtensionAssetsPath, |
144 | | - $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType; |
| 144 | + $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers; |
145 | 145 | |
146 | 146 | $wgScript = '/index.php'; |
147 | 147 | $wgScriptPath = '/'; |
— | — | @@ -149,6 +149,11 @@ |
150 | 150 | $wgStylePath = '/skins'; |
151 | 151 | $wgExtensionAssetsPath = '/extensions'; |
152 | 152 | $wgThumbnailScriptPath = false; |
| 153 | + $wgLockManagers = array( array( |
| 154 | + 'name' => 'fsLockManager', |
| 155 | + 'class' => 'FSLockManager', |
| 156 | + 'lockDirectory' => wfTempDir() . '/test-repo/lockdir', |
| 157 | + ) ); |
153 | 158 | $wgLocalFileRepo = array( |
154 | 159 | 'class' => 'LocalRepo', |
155 | 160 | 'name' => 'local', |
— | — | @@ -627,6 +632,11 @@ |
628 | 633 | 'wgScriptPath' => '/', |
629 | 634 | 'wgArticlePath' => '/wiki/$1', |
630 | 635 | 'wgActionPaths' => array(), |
| 636 | + 'wgLockManagers' => array( |
| 637 | + 'name' => 'fsLockManager', |
| 638 | + 'class' => 'FSLockManager', |
| 639 | + 'lockDirectory' => $this->uploadDir . '/lockdir', |
| 640 | + ), |
631 | 641 | 'wgLocalFileRepo' => array( |
632 | 642 | 'class' => 'LocalRepo', |
633 | 643 | 'name' => 'local', |
— | — | @@ -951,6 +961,8 @@ |
952 | 962 | */ |
953 | 963 | private function teardownGlobals() { |
954 | 964 | RepoGroup::destroySingleton(); |
| 965 | + FileBackendGroup::destroySingleton(); |
| 966 | + LockManagerGroup::destroySingleton(); |
955 | 967 | LinkCache::singleton()->clear(); |
956 | 968 | |
957 | 969 | foreach ( $this->savedGlobals as $var => $val ) { |
Index: trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php |
— | — | @@ -31,6 +31,14 @@ |
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
| 35 | + * Destroy the singleton instance, so that a new one will be created next |
| 36 | + * time singleton() is called. |
| 37 | + */ |
| 38 | + public static function destroySingleton() { |
| 39 | + self::$instance = null; |
| 40 | + } |
| 41 | + |
| 42 | + /** |
35 | 43 | * Register lock managers from the global variables |
36 | 44 | * |
37 | 45 | * @return void |