| ede46466 | 06-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
SearchIndex: reorganize and expand test suite
Move all Search tests from _test/tests/inc/Search/ to _test/tests/Search/ to match the dokuwiki\test autoloader convention. Fix namespaces from tests\*
SearchIndex: reorganize and expand test suite
Move all Search tests from _test/tests/inc/Search/ to _test/tests/Search/ to match the dokuwiki\test autoloader convention. Fix namespaces from tests\* to dokuwiki\test\* so all tests work in isolation.
Extract inline test helpers into separate autoloadable mock files: TestDirectCollection → MockDirectCollection, TestLookupCollection → MockLookupCollection, TestFrequencyCollection → MockFrequencyCollection.
Rename AbstractIndexTest → AbstractIndexTestCase to fix PHPUnit warning about abstract classes with Test suffix.
Replace dead xxxRealWord() with proper testWildcardSearch() verifying exact token matches and frequencies for all three wildcard types. Add testTokenizedPageSearch() using a dedicated test data file. Add testNoMatchReturnsEmptyFrequencies() which exposed a bug in Term where uninitialized $tokens/$frequencies caused crashes on zero-match terms.
Replace fulltext_query.test.php with modern QueryParserTest in the Search\Query namespace.
Add new test files: - LockTest: acquire/release, reference counting, stale lock override, foreign lock rejection, releaseAll, independent locks - NamespacePredicateTest: filter/exclude, sub-namespaces, partial prefix safety, empty sets, score preservation - PageSetTest: intersect, unite, subtract, isEmpty - QueryEvaluatorTest: word lookups, AND/OR/NOT, namespace filtering, combined queries, partial namespace prefix safety
Fix Term.php: initialize $tokens and $frequencies to [] instead of null.
show more ...
|
| 83b3accc | 06-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
SearchIndex: rewrite Indexer to use Collection classes
Replace the intermediate #2943 classes (FulltextIndex, MetadataIndex) with the new Collection-based architecture. The Indexer is now a thin sta
SearchIndex: rewrite Indexer to use Collection classes
Replace the intermediate #2943 classes (FulltextIndex, MetadataIndex) with the new Collection-based architecture. The Indexer is now a thin stateless orchestrator that delegates all index work to collections.
Key changes: - Indexer no longer extends AbstractIndex; page name passed to methods - addPage/deletePage/clear use PageTitleCollection, PageFulltextCollection, and PageMetaCollection - New PageMetaCollection replaces separate ReferencesCollection and MediaCollection with a single class that handles arbitrary metadata keys dynamically - Shared writable FileIndex('page') passed to all collections - Logger callback replaces verbose parameter - Methods return void instead of bool - Index classes implement IteratorAggregate for clean data access - Indexer tests consolidated into namespaced IndexerTest.php - All callers updated to new stateless API
show more ...
|
| c66b5ec6 | 05-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
SearchIndex: rewrite Lock as static registry with reference counting
Replace the instance-based Lock class with a static registry that tracks held locks per-process with reference counting. This sol
SearchIndex: rewrite Lock as static registry with reference counting
Replace the instance-based Lock class with a static registry that tracks held locks per-process with reference counting. This solves three problems:
- Split indexes (w3, w4, ...) share a single lock name and now coordinate naturally via the registry - Multiple callers can acquire the same lock without conflict - Indexes enforce their own writability through lock()/unlock() methods on AbstractIndex
The Lock registry manages both the filesystem lock (mkdir) and the in-process tracking. The first acquire creates the directory, subsequent acquires increment the refcount. Release decrements, and only removes the directory when the count reaches zero.
Note: I am not sure if implementing this as a static object is a great idea or if we should pass an instance through the collection to the indexes...
show more ...
|
| d92c078c | 05-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
SearchIndex: add DirectCollection for 1:1 entity-token mappings
Introduce DirectCollection as a third collection type alongside FrequencyCollection and LookupCollection. Direct collections store exa
SearchIndex: add DirectCollection for 1:1 entity-token mappings
Introduce DirectCollection as a third collection type alongside FrequencyCollection and LookupCollection. Direct collections store exactly one token per entity at the entity's position in the token index (entity.RID === token.RID), with no frequency or reverse indexes.
AbstractCollection now accepts optional frequency/reverse index names (default to '') and skips locking empty index names.
Adds PageTitleCollection as the first concrete direct collection for the page -> title mapping.
show more ...
|
| f2bbffb5 | 05-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
SearchIndex: extract Collection base class hierarchy
Introduce AbstractCollection as the shared base for all index collections, with FrequencyCollection and LookupCollection as the two abstract subc
SearchIndex: extract Collection base class hierarchy
Introduce AbstractCollection as the shared base for all index collections, with FrequencyCollection and LookupCollection as the two abstract subclasses differing only in how tokens are counted (frequency vs dedup).
Key design decisions: - splitByLength is a constructor parameter on AbstractCollection controlling whether token/frequency indexes use length-based file splitting. This is independent of the collection type. - The reverse index format is self-describing: entries with * have a group prefix (split), entries without don't (non-split). No branching needed in parse/format methods. - addEntity, resolveTokens, updateIndexes, and reverse index handling all live in AbstractCollection. Subclasses only implement countTokens().
Concrete collections: PageFulltextCollection (frequency, split), MediaCollection and ReferencesCollection (lookup, non-split).
Renames FulltextCollection -> PageFulltextCollection and FulltextCollectionSearch -> FrequencyCollectionSearch.
show more ...
|
| 093fe67e | 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
updated rector and applied it |
| db97c5ae | 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
ignore HTML validation issue with skipped headline levels
It's debatable if this is an error. I'd say it's more like a warning. |
| e7a87ee2 | 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix http tests
The response at httpbingo has changed, tests needed updates |
| da1e6c6b | 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
updated tests for PHP 8.2
* now using DomWrapper 3.0 which removes a bunch of deprecation messages * fixed class name throwing a warning * fixed deprecated reflection use |
| 8e88a29b | 07-Mar-2026 |
Andreas Gohr <andi@splitbrain.org> |
update minimum requirement to PHP 8.2
According to https://stitcher.io/blog/php-version-stats-june-2025 most people are running a newer version anyway. 8.2 still receives security support til the en
update minimum requirement to PHP 8.2
According to https://stitcher.io/blog/php-version-stats-june-2025 most people are running a newer version anyway. 8.2 still receives security support til the end of the year and is the version included in Debian old-stable (Bookworm).
This patch only increases the minumum version and updates the composer dependencies. No code has been changed yet.
show more ...
|
| 31003314 | 02-Feb-2026 |
Andreas Gohr <gohr@cosmocode.de> |
TreeBuilder: skip invalid pages and namespaces
This will hide namespace templates or weird folders from listings. Can be disabled with a flag if needed. |
| 8f178b70 | 19-Jan-2026 |
Alexander Lehmann <alexlehm@gmail.com> |
convert tests to data provider |
| 6f0cf24e | 17-Jan-2026 |
Alexander Lehmann <alexlehm@gmail.com> |
add comment to the real-ip test |
| 2b760c9f | 15-Jan-2026 |
Alexander Lehmann <alexlehm@gmail.com> |
add custom client_ip_header |
| 2f70db90 | 04-Dec-2025 |
WillForan <willforan@gmail.com> |
fix: 32bit IP tests w/string of decimal representation, overflows
Math in PHP is hard! sprintf("%.0f",0x7FFFFFFFFFFFFFFF) == sprintf("%.0f",0x7FFFFFFFFFFFFF00)
Changes * 32bit gets own version o
fix: 32bit IP tests w/string of decimal representation, overflows
Math in PHP is hard! sprintf("%.0f",0x7FFFFFFFFFFFFFFF) == sprintf("%.0f",0x7FFFFFFFFFFFFF00)
Changes * 32bit gets own version of tests where expected values are strings * decimalToBinary32 to replace `sprintf("%032b%032b"...)`, avoids overflow * overflow check in ipv4 too * refactor * partsTo64 for 32bit parts into dec value as str (bcmath) * Ip32::$b32 as class constant * condition always PHP_INT_SIZE == 4 for 32bit (instead of == 8 for 64)
show more ...
|
| a060f5a0 | 04-Dec-2025 |
WillForan <willforan@gmail.com> |
refactor(ip): PSR-12 functions
bitmask64_32 -> bitmask64On32 make_bitmask_32 -> makeBitmaskOn32 ipv6_upper_lower_32 -> ipv6UpperLowerOn32
also * uncomment working 7FFF ipv6 test a
refactor(ip): PSR-12 functions
bitmask64_32 -> bitmask64On32 make_bitmask_32 -> makeBitmaskOn32 ipv6_upper_lower_32 -> ipv6UpperLowerOn32
also * uncomment working 7FFF ipv6 test and * fix README suggested podman to use `docker://wpstaging`
show more ...
|
| ce8ae75e | 03-Dec-2025 |
Andreas Gohr <gohr@cosmocode.de> |
allow underscore methods in renderers #4554 |
| 3152848f | 30-Oct-2025 |
Andreas Gohr <gohr@cosmocode.de> |
updated fulltextCollectionTest for new tuple format
frequency of 1 is now written without a count |
| f439e746 | 30-Oct-2025 |
Andreas Gohr <gohr@cosmocode.de> |
updated assertion |
| e05998d5 | 30-Oct-2025 |
Andreas Gohr <gohr@cosmocode.de> |
SearchIndex: more Term tests |
| bc997a9d | 30-Oct-2025 |
Andreas Gohr <gohr@cosmocode.de> |
SearchIndex: TupleOps now work with frequencies of 1
We have indexes where we simply track that a relation between entity and token exists, but there is no frequency. The frequency is always 1. For
SearchIndex: TupleOps now work with frequencies of 1
We have indexes where we simply track that a relation between entity and token exists, but there is no frequency. The frequency is always 1. For those indexes we do not store *1 as frequency but omit it completely.
The TupleOps class now can work with such indexes and will also store frequencies of 1 like this.
show more ...
|
| 3f108b37 | 23-Oct-2025 |
Andreas Gohr <gohr@cosmocode.de> |
refactor preference cookie handling. fixes #4544
This refactors the DOKU_PREF cookie handling on the PHP side into a class. It makes encoding/decoding more explicit and easier to understand.
The ne
refactor preference cookie handling. fixes #4544
This refactors the DOKU_PREF cookie handling on the PHP side into a class. It makes encoding/decoding more explicit and easier to understand.
The new class is used in set_doku_pref() and get_doku_pref() which have not been deprecated for now.
show more ...
|
| 25a70af9 | 20-Sep-2025 |
WillForan <willforan@gmail.com> |
fix(inc/Ip): 32bit arch compatible range check
* added docs about running tests on 32bit w/ podman. * Updated tests to use string instead of int for comparison when 32bit. * added `make_bitmask_3
fix(inc/Ip): 32bit arch compatible range check
* added docs about running tests on 32bit w/ podman. * Updated tests to use string instead of int for comparison when 32bit. * added `make_bitmask_32` and `bitmask64_32`. updated `ipInRange` to use them.
Test failing for `test_ip_to_number` ``` podman run -v $PWD/..:/dokuwiki \ --workdir /dokuwiki/_test -it \ docker://wpstaging/php:8.3-32bit \ ./vendor/bin/phpunit --verbose --stderr --filter ip_test ```
```
1) ip_test::test_ip_to_number with data set #3 ('38AF:3033:AA39:CDE3:1A46:094C...D:5300', 6, 4.084536385505709E+18, 1.8932109165344407E+18) Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -'4084536385505709056' +'4084536381210742243'
/dokuwiki/_test/tests/inc/Ip.test.php:52
2) ip_test::test_ip_to_number with data set #5 ('193.53.125.7', 4, 0, 3241508103) Failed asserting that -1053459193 is identical to 3241508103.
```
show more ...
|
| 2e0b7f74 | 02-Sep-2025 |
Andreas Gohr <gohr@cosmocode.de> |
set DOKU_INC in rector
I had several cases where rector failed to work on plugins without this. I'm not 100% sure why, but it doesn't hurt to set this early. |
| 7caad012 | 04-Jun-2025 |
Andreas Gohr <gohr@cosmocode.de> |
extend tests, fix issues with new Ip methods |