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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14718, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12718 - A way to know which features api.php supports
A way to know which features api.php supports
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  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: ---


Attachments

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.


Navigation
Links