Last modified: 2007-06-14 14:00:03 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 T12096, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10096 - InterWiki table retrieval through meta=siteinfo
InterWiki table retrieval through meta=siteinfo
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-01 13:15 UTC by Roan Kattouw
Modified: 2007-06-14 14:00 UTC (History)
2 users (show)

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


Attachments
Implements list=interwiki (4.79 KB, patch)
2007-06-13 19:34 UTC, Roan Kattouw
Details

Description Roan Kattouw 2007-06-01 13:15:31 UTC
Would it be possible to retrieve the InterWiki table through a request like this?
api.php?action=query&meta=siteinfo&siprop=interwiki

This shouldn't be hard to implement, simply retrieve the table from the DB as an array and spit it out.

Thanks in advance.
Comment 1 Roan Kattouw 2007-06-13 19:34:02 UTC
Created attachment 3758 [details]
Implements list=interwiki
Comment 2 Roan Kattouw 2007-06-13 19:36:24 UTC
I've attached a patch (see attachment) that implements:
 * list=interwiki (iw) *
  List interwiki bindings.
Parameters:
  iwcontinue     - Fill in the value returned by an earlier query to continue that query
                   Default: 0
  iwlimit        - The maximum number of bindings to list.
                   Default: -1
  iwfilter       - Filter to apply
                    "local": Only list local interwiki bindings
                    "nonlocal": Only list nonlocal interwiki bindings
                    "all": List all interwiki bindings
                   One value: local, nonlocal, all
                   Default: all
Example:
  api.php?action=query&list=interwiki

Apply this patch from the MediaWiki root with patch -p1

Hmm,apparently attaching this comment to the attachment would've been better... well, I'm new to BugZilla ^^
Comment 3 Yuri Astrakhan 2007-06-14 05:20:31 UTC
I kept the original siteinfo - I don't think we should introduce an extra module for something like this. Also, no point in doing limits - the table wouldn't be that long (I wouldn't think) not to return it whole.

Fixed in r22975
Comment 4 Roan Kattouw 2007-06-14 14:00:03 UTC
(In reply to comment #3)
> I kept the original siteinfo - I don't think we should introduce an extra
> module for something like this. Also, no point in doing limits - the table
> wouldn't be that long (I wouldn't think) not to return it whole.
> 
> Fixed in r22975
> 

Thanks. However, the returned array uses number as keys rather than 
prefixes, which I initially implemented. Now that might not make much 
sense in XML format, but it does make sense in (say) PHP serialized 
format, as it makes it easier to retrieve information about a known 
interwiki prefix. Is there a way that we can make something that looks 
like this in XML:

<query>
   <interwiki>
       <iw prefix="fr" url="http://fr.wikipedia.org/wiki/$1" local="">
   </interwiki>
</query>

But looks like this:

Array(
   ['query'] => Array(
       ['interwiki'] => Array(
           ['fr'] => Array(
               ['prefix'] => fr
               ['url'] => http://fr.wikipedia.org/wiki/$1
               ['local'] =>
           )
       )
   )
)

in PHP?

Is this possible with setIndexedTagName? Thanks in advance,

Roan Kattouw

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


Navigation
Links