-
Notifications
You must be signed in to change notification settings - Fork 7
rebase extension.json work around new codebase #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
c5b835b |
"description": "Absolute path to raws directory, when empty use 'raws' directory in extension catalog" | ||
"value": "raws", | ||
"path": true, | ||
"description": "Relative path to raws directory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't it also be absolute? I don't see any checks for the path root in DFRawFunctions.body.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With "path": true mediawiki insert extension directory to path without any other checks.
So only relative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what is it relative to?
If this has to be relative to the extension directory, I don't really see a point in having it be configurable.
If it's relative to the MediaWiki installation, I suppose that makes a bit more sense to have as an option, but I'm still not sure we've ever needed it (aside from maybe testing raws in development, which could also be done by using symlinks or patching the extension). Are you using this config option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is relative to extension directory
Russian wiki uses NixOS as base OS https://github.com/MEXAHOTABOP/dfwk and every module (including DFRawFunctions) absolute path will be based on its hash like /nix/store/mhzd8rgxhn6dfpzv0l5l293wa9sfx9w9-DFRawFunctions-456959f , so instead of using absolute path that will be known only when extension is downloaded and evaluated, I found it easier just use relative to extension directory.
fix problem with non evalable wgDFRawPath
remove missed __DIR__
Default str to int comparison behavior was changed in php8+ https://wiki.php.net/rfc/string_to_number_comparison with is caused undefined behavior in code. This commit fixes it by explicitly casting str to int.
Differences from #7 :
Leave code in DFRawFunctions.body.php to make review more easily
Added $wgDFRawVersion varible, that define version with will be used if namespace is not set, that change required for Russian wiki that use only main user space, and should not affect English wiki.
Fixed problem with non evalable by default DFRawPath in extension.json by moving default path DIR . '/raws'; to code