Fix compatibility issues for DokuWiki 2025-05-14a "Librarian"#41
Open
tryweb wants to merge 4 commits intoturnermm:masterfrom
Open
Fix compatibility issues for DokuWiki 2025-05-14a "Librarian"#41tryweb wants to merge 4 commits intoturnermm:masterfrom
tryweb wants to merge 4 commits intoturnermm:masterfrom
Conversation
Resolves "require_once() is deprecated" warnings observed in PHP logs for the DokuWiki quickstats plugin. The following explicit `require_once` statements for DokuWiki's core plugin classes have been removed from their respective files, as they are now correctly handled by DokuWiki's autoloader: - `action.php`: Removed `require_once(DOKU_PLUGIN.'action.php');` - `admin.php`: Removed `require_once(DOKU_PLUGIN.'admin.php');` - `syntax.php`: Removed `require_once(DOKU_PLUGIN.'syntax.php');` This refactoring improves code modernism, aligns with contemporary PHP practices, and eliminates unnecessary warnings in the DokuWiki environment.
…uire_once calls This commit addresses a critical "Undefined array key" E_WARNING observed in `action.php` at line 451, which occurred when accessing `$this->pages['page'][$ID]`. The issue was due to `$this->pages` or its sub-arrays not always being fully initialized with expected keys, especially on first page visits or with new/empty statistics files. To fix this, the `add_data` method in `action.php` has been updated to: - Ensure that `$this->pages['page']`, `$this->pages['site_total']`, and `$this->pages['date']` are explicitly checked and initialized as arrays or zero before any access or increment operations. - Ensure `$this->ips['uniq']` is initialized if not set. These changes enhance the plugin's robustness, improve compatibility with modern PHP versions, and eliminate unnecessary warnings in the DokuWiki logs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update ensures the quickstats plugin works correctly with the
latest DokuWiki version and eliminates all deprecation warnings,
parse errors, and undefined variable notices.
Files modified:
Fixes: GeoLite2-City database download functionality