Commit graph

182 commits

Author SHA1 Message Date
Kunal Mehta
370f4c4618 Add APIQuerySiteInfoStatisticsInfo hook
Allows extensions to modify the output of
action=query&meta=siteinfo&siprop=statstics

Accompanies the SpecialStatsAddExtra hook for Special:Statistics

Change-Id: I712748077a0ac2fb729bfe3b6616ac4981cb754e
2013-10-11 19:12:21 -07:00
jenkins-bot
b28a59a0e9 Merge "API: Add output of wgLogo to meta=siteinfo" 2013-10-04 19:39:06 +00:00
Brion Vibber
3cfc7d5df1 Remove duplicate file extensions from output messages
If a file type was added to $wgFileExtensions by both local configuration
and defaults in an extension (eg TimedMediaHandler and LocalSettings.php
both adding 'ogg' and 'ogv') it was being listed twice in the UI messages
listing acceptable types.

Runs array_unique() over the array on various outputs.

Bug: 54378
Change-Id: I14cd098d8b27099f8f803630535f33549740295c
2013-09-27 17:49:21 +00:00
Brad Jorsch
53d586ccfc API: Add output of wgLogo to meta=siteinfo
Bug: 54428
Change-Id: I0ee576828e298dba76734315408838f61dfa95d2
2013-09-24 09:31:41 -04:00
MatmaRex
df8ec1e216 No spaces after (casts)
Also removed some unnecessary ones. I think I've caught them all.

The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.

Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
2013-09-04 20:05:43 +02:00
Erick Guan
025ff3ca6e Sort namespace aliases by id in appendNamespaceAliases for pretty output
Bug: 45382
Change-Id: I8850eac676f219482d380a0c4a9cad1009285c68
2013-08-28 15:28:03 +00:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
C. Scott Ananian
35dd66e4aa Code style cleanup for ApiQuerySiteinfo.php.
This fixes the code style error (2 blank lines in a row) introduced by
I17aae9512e0994222785c5edc9de644685b2498c as well as a number of other
line-too-long errors flagged by phpcs.

Change-Id: I3c628eab101ee97d0182ee2db37b53105346af99
2013-07-16 16:38:35 -04:00
C. Scott Ananian
3608ba2a34 Export information about external image settings via siteinfo API.
This configuration information is needed in order for Parsoid to
appropriately parse external image URLs.

Bug: 51092
Change-Id: I17aae9512e0994222785c5edc9de644685b2498c
2013-07-16 14:06:32 +00:00
Brad Jorsch
810879a349 (bug 47216) API: indicate default and skipped skins in meta=siteinfo
action=query&meta=siteinfo&siprop=skins can easily indicate which of the
returned skins is the default and which are unusable (e.g. because
they're listed in $wgSkipSkins). So we may as well do so.

Bug: 47216
Change-Id: Ib4ea5fe85e1b02895dba15f3a245c7a7d8724470
2013-05-17 09:51:18 +10:00
umherirrender
a35cce4be0 Fixed spacing in api folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
2013-04-20 07:47:36 +00:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
Mark Holmquist
badfb9b13f Return empty string for trail/prefix if disabled
This is necessary so Parsoid can know when the API doesn't have the linktrail/
prefix feature and when the API is actually telling us that the trail/prefix
is/are disabled.

Bug: 41151
Change-Id: If0895d507fe1b473e42bceb135d4030106ded442
2013-03-05 15:32:52 -08:00
Mark Holmquist
92920e3adb (bug 43661) Add link trail and link prefix to API
This is more than just fetching messages -- we also check whether the messages
are enabled via the preferences and configuration. If not, the variables won't
be there.

Change-Id: If617f43004dbd42f7eaa6f75010cdc5a0a662f60
2013-02-25 11:46:07 -08:00
Mark Holmquist
bd0d6c182e (bug 41716) Add variant config to siprop=general
Parsoid again needs some extra information, this time so we can support
language variant conversion on our side of things. Added to properties to the
general siteinfo property.

Change-Id: I1ec7da2ec5b08228e74fec4fb366dae26cab8936
2013-02-25 10:11:45 -08:00
Alex Monk
7e83c69fa3 (bug 45130) Fix siprop=protocols in XML format
Change-Id: I2362be19f1e8f759e574d85ed210978c0fbd53a3
2013-02-18 21:04:31 +00:00
Mark Holmquist
1b64ddf09c (bug 44449) Add siprop=protocols to SiteInfo API
The existing method for getting allowed URL protocols will not help Parsoid,
so we're adding a new API call that will help us fix bug 44449.

Change-Id: I5fd130cb30313f8e8a376ff0146195f2264e8e0e
2013-02-14 15:06:15 -08:00
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
Ori Livneh
6c163ad265 (Bug 37957) Replace php_sapi_name() with PHP_SAPI
The PHP_SAPI constant has been available since PHP 4.2.0. It's more
concise to use the constant and has less overhead than a function call.

Furthermore, PHP_SAPI rhymes with "happy", whereas "php_sapi_name"
rhymes with "lame". QED, etc.

Change-Id: Ie8c121cb8fcef50536af8d3f66723b458f0bf9af
2013-02-04 12:50:45 -08:00
umherirrender
f97a3a4027 fix some spacing
Change-Id: I670a7baf3ba1e70d18346bb00938d518ba2063bd
2013-02-04 19:59:14 +00:00
umherirrender
2e8da558ba fix some spacing
Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
2013-01-26 22:11:09 +01:00
Yuri Astrakhan
503cd2f4ae (bug 35885) remove api version string and parameter
API was using SVN's version keyword which GIT does not support.
All related methods were either removed, or for those that
could have been used from extensions, emptied out.
api.php?version now shows unrecognized param warning.

Change-Id: I910ca1448ed2ed697ac19b17c486d130aa1d7e03
2013-01-18 12:41:18 -05:00
umherirrender
bf9bd497f0 (bug 42089) meta=siteinfo should output the default content model
Adding MWNamespace::getNamespaceContentModel which returns the namespace
content model from the global, if set

Change-Id: Ie012fd0ff846d50cae8081fc32b76900dbcad209
2012-12-13 21:05:15 +01:00
Brad Jorsch
5dc1a63f20 (bug 30836) API siteinfo specialpagealiases should not return nonexistent special pages
Some special pages are conditionally registered (e.g.
Special:Popularpages only exists when $wgDisableCounters is false), or
sometimes an alias exists for a special page that does not. The API
should probably not return entries for these from
meta=siteinfo&siprop=specialpagealiases.

This also fixes bug 38464 correctly, rather than blindly reverting.

Change-Id: Ic021a47754ea7a1574e818dad47151ab6698e06f
2012-07-18 23:09:13 -04:00
Aaron Schulz
e6faa2fd76 Merge "escape HTML elements in docblock with double quotes" 2012-07-18 19:17:46 +00:00
Reedy
39080a18dd Revert "(bug 30836) API siteinfo specialpagealiases should not return nonexistent special pages"
Caused Bug 38464 - API showing internal error with ?action=query&meta=siteinfo&siprop=specialpagealiases&format=xmlfm

This reverts commit 48523016ef

Change-Id: I470e87d21d98d4436bd5e27d0a3796559f9c41bb
2012-07-18 17:50:09 +01:00
Antoine Musso
4f5d2386f3 escape HTML elements in docblock with double quotes
Doxygen choke on text enclosed by '<' and '>' since it tries to
interpret them as HTML or XML elements. This patch adds double quotes
in includes/api/*.php files around the two following strings:

 <Firstname>.<Lastname>@gmail.com
 <Firstname><Lastname>@gmail.com

Which becomes:

 "<Firstname>.<Lastname>@gmail.com"
 "<Firstname><Lastname>@gmail.com"

Tested locally, it prevents doxygen 1.8.0 related warnings.

Change-Id: I36d82eb3fd4989ee3ffc65b0b527b83711d1ba69
2012-07-15 22:15:45 +02:00
Brad Jorsch
48523016ef (bug 30836) API siteinfo specialpagealiases should not return nonexistent special pages
Some special pages are conditionally registered (e.g.
Special:Popularpages only exists when $wgDisableCounters is false), or
sometimes an alias exists for a special page that does not. The API
should probably not return entries for these from
meta=siteinfo&siprop=specialpagealiases.

Change-Id: I59eb82eae45fb47c6a769195cc1bd28711b4fcac
2012-07-07 02:40:35 +04:00
Brad Jorsch
68597a1345 Allow API meta=siteinfo to return list of know variable IDs
To know whether something like {{foo}} is a template, variable, or
function, you have to first check if it's a magic word, and then look up
the magic word ID in the list of variables and the list of function
hooks. The API already can return the list of known magic word mappings
(siprop=magicwords) and function hooks (siprop=functionhooks), this
completes the set by allowing siprop=variables.

Change-Id: If13df9c3796ea6815393d847a3c6f70380bba58a
2012-07-05 02:03:50 +01:00
Max Semenik
dd6519709b Bug 36453 - Provide the git info on action=query&meta=siteinfo
Change-Id: I3d6c79d0d2cafd533f39e255940869087778d884
2012-06-30 00:04:42 +04:00
umherirrender
e9fa97f76e Add unit test for MWNamespace::isNonincludable
rename MWNamespace::isNonincludableNamespace
to MWNamespace::isNonincludable, because "Namespace" is already in the
class name

Change-Id: Ie982835c7dc84cb10c823996e5360cc1b342f704
2012-05-11 19:52:34 +02:00
umherirrender
ffa3486aa8 (bug 33224) add variants of content language to meta=siteinfo
Change-Id: I0b92e1e626f0c5bc543c5d134eb44d7ca7722217
2012-05-06 05:13:55 +02:00
umherirrender
cd40d0040c Add MWNamespace::isNonincludableNamespace
Method is a wrapper around $wgNonincludableNamespaces,
replaced the one place in parser and
add it as info to api's meta=siteinfo

Change-Id: I501b811137c39f5c2d9ea35c78fef8ae22d21bfe
2012-05-05 10:22:28 +02:00
Robin Pepermans
d7a5dd0aaf fix r113403 2012-03-10 02:07:31 +00:00
Robin Pepermans
9184dc83d6 Update core usage of getLanguageName[s]. 2012-03-08 20:56:26 +00:00
Sam Reed
ff322e3e1e * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API. 2012-02-10 14:27:50 +00:00
Robin Pepermans
7bf35ceb8d The URL wasn't loading when the database is used (interwiki cache works). "PHP Notice: Trying to get property of non-object in /www/w/includes/api/ApiQuerySiteinfo.php on line 295"
This reverts r97806. It took me some time to find out, but r96475 accidentally backported the change from $row->iw_url to $row['iw_url'] (etc) to 1.18, which was fixed in r97789. That revision was merged to trunk, which shouldn't have been done either. I.e. until 1.18 it is an object, from 1.19 it is an array.
2011-11-29 16:48:37 +00:00
Sam Reed
53000baecf Oh noes, moar http:// -> https:// 2011-11-28 15:43:11 +00:00
Sam Reed
fcb28f12ea Fix the rest of 'inlanguage ' in r93765 2011-11-17 19:06:30 +00:00
Sam Reed
9157749df6 Fix trailing space in r93765 2011-11-17 19:00:09 +00:00
John Du Hart
2e7d867478 Removed the 'eclipse helper' bit on top of every API module
It's a parctice that dates back to 2006 when the API was first written, and frankly isn't covered by the coding conventions. Same thing with the docblocks, they're all copypasted with some bits changed and don't even make sense if you look at them in the genereated code docs.
I don't feel that any of us depend on this anymore (get a better IDE), so in the inerest of consistancy it's time we said goodbye to it.
2011-11-16 00:17:26 +00:00
Sam Reed
bd9136167c Merge r97789 into trunk
Follows up r92528 where this was introduced
2011-09-22 11:04:30 +00:00
Roan Kattouw
d8a2733757 Make the PROTO_ parameter to wfExpandUrl() explicit in all calls. There are now no calls to wfExpandUrl() in core that rely on PROTO_CURRENT being the default. Also switch to using getCanonicalUrl() for.... rel="canonical" :D (I picked the right name, I KNEW IT) 2011-08-19 15:46:08 +00:00
Niklas Laxström
b56b84c5b8 Attempt to fix Bug 30216 - Improve language fallback loop detection.
Made fallbacks a list per language, instead of scanning them recursively through the languages.
2011-08-18 16:41:07 +00:00
Sam Reed
2f8417957a Upstream another minor Wikia change 2011-08-17 22:28:08 +00:00
Sam Reed
a5628f5734 Based on diff to wikia, set more functions consistently public rather than protected 2011-08-17 22:24:21 +00:00
Sam Reed
eaf78d51d3 * (bug 18634) Create API to fetch MediaWiki's language fallback tree structure
Patch by "merl"

Tested with pt-br, seems to work fine, listing pt and en for the fallback languages
2011-08-05 13:34:22 +00:00
Roan Kattouw
fbdba8b26f Revert r93802 per CR. Will avoid cache pollution by splitting the cache instead 2011-08-03 07:54:23 +00:00