Page MenuHomePhabricator

A JavaScript constant to declare whether api.php is available
Closed, ResolvedPublic


For JavaScript extensions it will often be useful to know if api.php is installed on the wiki whereby the same function may be implemented more efficiently with it and less efficiently without it.

Currently it is not possible for a JavaScript extension to know whether api.php is installed without sending an ajax request. But since the results of such a check can't be remembered for views of subsequent wiki pages it would be quite wasteful to use such a method.

I propose a variable such as wgEnableAPI which would be set to "true" if api.php is installed and "false" if not. The name of the variable is not terribly important.

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:07 PM
bzimport set Reference to bz12622.
bzimport added a subscriber: Unknown Object (MLST).

We might want to pass wgEnableWriteAPI in a similar fashion.