summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-12-04 16:15:49 +0100
committerMichael Hamann <michael@content-space.de>2012-12-04 16:15:49 +0100
commit1421e5483ad1ca8780331077141e0c07b6530bc5 (patch)
treef8482ed4b574d53647142847562d82ecaa377a6c /inc/indexer.php
parent3d2ce006bd7cffab5cda27f01787d2fd66ab630e (diff)
downloadrpg-1421e5483ad1ca8780331077141e0c07b6530bc5.tar.gz
rpg-1421e5483ad1ca8780331077141e0c07b6530bc5.tar.bz2
Indexer: Make $Indexer in idx_get_indexer() global instead of static
This avoids problems with test cases that use the indexer and the PID cache - the index is cleaned between test cases but the PID cache wasn't cleaned. Now PHPUnit can unset the global $Indexer between test cases.
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 05b082872..4dfaa33fb 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1196,8 +1196,8 @@ class Doku_Indexer {
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function idx_get_indexer() {
- static $Indexer = null;
- if (is_null($Indexer)) {
+ global $Indexer;
+ if (!isset($Indexer)) {
$Indexer = new Doku_Indexer();
}
return $Indexer;