Skip to content

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

MEXAHOTABOP
Copy link
Contributor

@MEXAHOTABOP MEXAHOTABOP commented Jan 2, 2023

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

@MEXAHOTABOP
Copy link
Contributor Author

c5b835b
Changes behavior of DFRawPath now this is relative from extension directory, instead of absolute.

"description": "Absolute path to raws directory, when empty use 'raws' directory in extension catalog"
"value": "raws",
"path": true,
"description": "Relative path to raws directory"
Copy link
Member

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

Copy link
Contributor Author

@MEXAHOTABOP MEXAHOTABOP Jan 3, 2023

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.

https://github.com/wikimedia/mediawiki/blob/9afab251cac5b02564a68c13f25418c522df9467/includes/registration/ExtensionProcessor.php#L831

Copy link
Member

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?

Copy link
Contributor Author

@MEXAHOTABOP MEXAHOTABOP Jul 11, 2025

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants