diff options
author | Michael Hamann <michael@content-space.de> | 2012-12-04 16:15:49 +0100 |
---|---|---|
committer | Michael Hamann <michael@content-space.de> | 2012-12-04 16:15:49 +0100 |
commit | 1421e5483ad1ca8780331077141e0c07b6530bc5 (patch) | |
tree | f8482ed4b574d53647142847562d82ecaa377a6c | |
parent | 3d2ce006bd7cffab5cda27f01787d2fd66ab630e (diff) | |
download | rpg-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.
-rw-r--r-- | inc/indexer.php | 4 |
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; |