Last modified: 2008-01-22 21:22:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 12718 - A way to know which features api.php supports
A way to know which features api.php supports
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Roan Kattouw
Depends on:
  Show dependency treegraph
Reported: 2008-01-21 07:49 UTC by Andrew Dunbar
Modified: 2008-01-22 21:22 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Andrew Dunbar 2008-01-21 07:49:11 UTC
Sometimes it's good to make flexible JavaScript that can do something better or more efficiently if api.php has a new feature but fall back to a rougher or less efficient way if the feature is missing.

Currently we only have wgVersion but many changes occur on live wikis between version.

We could expose the svn revision as a JavaScript wg constant but forked wikis such as Wikia may have different svn revisions thus breaking any connection between the MediaWiki revision and the api.php feature set.

It may be possible to have some kind of feature array but that could be bulky.

Best might be a universal wgApiRevision which is not dependent on svn and thus will be the same even if you're on a forked wiki, forked api.php would be another story however.

In any case it's surely a good idea to expose the information provided by api.php's "version" parameter. Currently it only outputs flat text when viewing help but could output structured data for JSON and all formats.

In my case I have three ways to achieve my goal. If api.php is not available I can do several ajax hits to the server which results in partial information. If api.php is available I can do a single ajax server hit but need to request more data than strictly necessary. If api.php supports the "amlang" parameter for "meta=allmessages" I can get everything I need with a single efficient ajax server hit.

Currently, however, there is no deterministic way to know if "amlang" is supported.
Comment 1 Victor Vasiliev 2008-01-21 13:38:09 UTC
You can try standard error handling way now. Though, action=capable should be implemented
Comment 2 Roan Kattouw 2008-01-21 14:53:42 UTC
(In reply to comment #1)
> You can try standard error handling way now. Though, action=capable should be
> implemented
It should. Still, you can regex the action=help output for "amlang".
Comment 3 Roan Kattouw 2008-01-22 21:22:32 UTC
Implemented in r30062

Note You need to log in before you can comment on or make changes to this bug.