Page MenuHomePhabricator

Remove $wgAPICacheHelp in favour of $wgAPICacheHelpTimeout
Closed, ResolvedPublic

Description

Setting $wgAPICacheHelpTimeout = 0 should have the same effect as toggling $wgAPICacheHelp (boolean). i.e. if we set the timeout to 0, it won't be cached at all, if we set it to > 0, it will be cached.

No real need for the boolean to do this, per Niklas on http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56559#c4072

Added in r56559, r56091

Not quite sure what the process of disabling globals is...

Do we stop listening to the on/off in the main code, but only make it have any effect in the setup phases...

ie if $wgApiCacheHelp = false, $wgApiCacheHelpTimeout = 0...


Version: 1.17.x
Severity: enhancement

Details

Reference
bz26650

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:17 PM
bzimport set Reference to bz26650.

Or just don't rename the global, just change its purpose? We can detect whether it's set to a boolean or a number and act accordingly.

(In reply to comment #1)

Or just don't rename the global, just change its purpose? We can detect whether
it's set to a boolean or a number and act accordingly.

Or wait, I'm sorry, I misunderstood. I missed the fact that $wgApiCacheHelpTimeout was already there.

Due to register_globals considerations we have to either keep the old var around in DefaultSettings or stop listening for it. Neither sounds particularly nice, so I think the best solution is to phase it out gradually (mark as deprecated now, but still define it in DS and listen to it for a while longer, then kill it in a later release).

(In reply to comment #2)

(In reply to comment #1)

Or just don't rename the global, just change its purpose? We can detect whether
it's set to a boolean or a number and act accordingly.

Or wait, I'm sorry, I misunderstood. I missed the fact that
$wgApiCacheHelpTimeout was already there.

Due to register_globals considerations we have to either keep the old var
around in DefaultSettings or stop listening for it. Neither sounds particularly
nice, so I think the best solution is to phase it out gradually (mark as
deprecated now, but still define it in DS and listen to it for a while longer,
then kill it in a later release).

Yeah, exactly. I'll put a rough patch together for a proposal for this, and see what you think...

Methods used in extensions need to be phased out
Really old or widely-used globals need to be phased out.

This doesn't need to be phased out. Just remove the boolean, repurpose the value of 0 for $wgApiCacheHelpTimeout and note it in RELEASE-NOTES config changes. I doubt this is getting massive use outside of WMF.

Hmm, probably true, WMF/MW developers. And of that, there's probably only a minority of us that do anything.

Is it worth backporting to 1.17 to kill it earlier? It was only introduced in 1.16...

Removed in r79942

Re: 1.17

<^demon> Reedy: If it applies cleanly to 1.17, I say go for it.

I'll leave the call of whether to backport this upto Roan