Last modified: 2011-05-01 22:30:14 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 T18288, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16288 - API: consider making closure status of wikis more clear with meta=siteinfo
API: consider making closure status of wikis more clear with meta=siteinfo
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Roan Kattouw
http://aa.wikipedia.org/w/api.php?act...
:
: 28772 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-09 04:08 UTC by Melancholie
Modified: 2011-05-01 22:30 UTC (History)
6 users (show)

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


Attachments

Description Melancholie 2008-11-09 04:08:03 UTC
Although this is very Wikimedia specific, consider adding information whether a wiki's database has been closed (locked permanently) or not. There are many closed wikis out there, e.g. http://aa.wikipedia.org/w/api.php?action=query&meta=siteinfo

Currently, readonly="" shows that a database has been locked; temporarily or indefinetly. But an empty "" looks like "undefined"/"no". You  could either add "yes"/1, and/OR for closed wikis even "closed".
Comment 1 Bryan Tong Minh 2008-11-09 11:56:26 UTC
We probably need a hook which allows adding to siteinfo and have the SiteMatrix extension hook that.
Comment 2 Lupo 2009-01-06 10:53:22 UTC
Would be good if sitematrix not only indicated whether a wiki is readonly, but also whether the API is enabled at all there. Currently, trying an API call on a wiki where the API is disabled completely just returns a text "MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php<pre>%lt;b>$wgEnableAPI=true;</b></pre>" which is rather unhelpful for automated processing. For instance, when using dynamically generated script-elements with a callback: what we get back isn't even Javascript. Hence we need a way to ensure that we don't even try API calls on such wikis. Sitematrix flagging wikis with disabled APIs would be one way. Or is there some other way to do this already?
Comment 3 Sam Reed (reedy) 2011-01-06 23:54:09 UTC
r63650 for reference
Comment 4 Sam Reed (reedy) 2011-03-20 00:50:29 UTC
(In reply to comment #0)
> Although this is very Wikimedia specific, consider adding information whether a
> wiki's database has been closed (locked permanently) or not. There are many
> closed wikis out there, e.g.
> http://aa.wikipedia.org/w/api.php?action=query&meta=siteinfo
> 
> Currently, readonly="" shows that a database has been locked; temporarily or
> indefinetly. But an empty "" looks like "undefined"/"no". You  could either add
> "yes"/1, and/OR for closed wikis even "closed".


readonly="" is the typical boolean way we do stuff. If it doesn't exist, it's false.

(In reply to comment #2)
> Would be good if sitematrix not only indicated whether a wiki is readonly, but
> also whether the API is enabled at all there. Currently, trying an API call on
> a wiki where the API is disabled completely just returns a text "MediaWiki API
> is not enabled for this site. Add the following line to your
> LocalSettings.php<pre>%lt;b>$wgEnableAPI=true;</b></pre>"
> which is rather unhelpful for automated processing. For instance, when using
> dynamically generated script-elements with a callback: what we get back isn't
> even Javascript. Hence we need a way to ensure that we don't even try API calls
> on such wikis. Sitematrix flagging wikis with disabled APIs would be one way.
> Or is there some other way to do this already?

Logged as bug 28126, as it has some overlap of the issue, but not completely...
Comment 5 Sam Reed (reedy) 2011-03-20 01:21:34 UTC
Doing the hook for this is trivial.

I'm just struggling (probably because it's late etc), how we can easily get the language/name out of wikiid()

if $wgDBname starts with wgLanguageCode, remove it, then we've got the project, based on what $wgSiteMatrixSites uses.


If anyone wants to sanity check that for me, I'd appreciate it.

I've added an isSpecial method in r84367


Added a hook locally, so will see if I can get SiteMatrix to play nicely locally... And do a bit more testing. In theory, just stealing the DBlists from noc should help there

eval.php:
> $matrix = new SiteMatrix();

> echo $matrix->isClosed( '', $wgDBname ) ? 'true' : 'false';
false
> echo $matrix->getUrl( '', $wgDBname );
http://www.mediawiki.org


Seems to verify what I'm suggesting
Comment 6 Sam Reed (reedy) 2011-03-20 13:42:03 UTC
r84380, r84381
Comment 7 Sam Reed (reedy) 2011-05-01 22:30:14 UTC
*** Bug 28772 has been marked as a duplicate of this bug. ***

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


Navigation
Links