Page MenuHomePhabricator

Use Config instead of globals in SecurePoll extension
Open, In Progress, Needs TriagePublic

Description

See parent task T11968 for details.

Classes that extend classes that have a method for accessing Config are straightforward to fix.

Other cases might need more work.

Details

Event Timeline

Mimurawil changed the task status from Open to In Progress.Feb 3 2025, 6:13 PM
Mimurawil claimed this task.

Change #1117294 had a related patch set uploaded (by Mimurawil; author: Mimurawil):

[mediawiki/extensions/SecurePoll@master] Use config instead of globals

https://gerrit.wikimedia.org/r/1117294

I found 3 occurrences I believe it may be okay to leave as global usages (treating them as exceptions).

  • Using global $wgConf (3 different files)
    • Found in VotePage.php, FormStore.php, and RemoteMWAuth.php
    • Even though $wgConf is an instance of MediaWiki\Config\SiteConfiguration, it's not exposed as a service - so it's not possible to access it via config

Change #1117294 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Use config instead of globals

https://gerrit.wikimedia.org/r/1117294

I see 4 PHP "global" keywords left in the repo:

image.png (654×477 px, 38 KB)