Commit graph

59 commits

Author SHA1 Message Date
Sam Reed
20d56c63b3 * (bug 27708) list=users does not have a property to return user id
Add userid to ApiQueryUsers

Move userid in ApiQueryAllUsers before name
2011-02-25 16:19:44 +00:00
Sam Reed
35296f391f Followup to r82739 (bug 27688)
Remove u1 table aliases
2011-02-24 18:46:12 +00:00
Sam Reed
57923b31fa * (bug 27688) Simplify queries to list user block information
Also expose block expiry information, listed on Users, but not all users

Some minor simplifications to come
2011-02-24 18:43:44 +00:00
Sam Reed
521044a529 Explicitally define $fld_rights on all code paths 2011-02-09 22:42:26 +00:00
Sam Reed
22832a2527 * (bug 26560) On allusers if limit < total number of users, last user gets duplicate
If $lastUserData is set to null, it won't get added again!
2011-01-04 04:05:32 +00:00
Sam Reed
df0a765cfe * (bug 26559) list=allusers auprop=rights does not match list=users usprop=rights 2011-01-04 03:36:39 +00:00
Sam Reed
0014c1113c * (bug 26558) list=allusers auprop=groups does not list groups a user is automatically a member of 2011-01-04 02:48:02 +00:00
Sam Reed
f1b7c91cf8 Followup r79545, we don't really care for duplicate userrights 2011-01-04 02:18:03 +00:00
Sam Reed
97a0295e34 Add rights to array. Grrr 2011-01-04 02:13:51 +00:00
Sam Reed
b30c1e7e72 Crappy spaces from r79549 2011-01-04 02:08:38 +00:00
Sam Reed
58df1dc895 Rest of * (bug 25767) Add userrights properties to allusers and users query lists
Add missing parameter from r79545
2011-01-04 02:06:55 +00:00
Sam Reed
e1bcab1ab8 * (bug 25767) Add userrights properties to allusers and users query lists
First part of this bug. Listing of all rights that users have
2011-01-04 01:39:02 +00:00
Sam Reed
1da2cd2dde Move comment about groups potentially returning less results from server.
Comment out description line about rights from ApiQueryUsers, as that prop doesn't exist (Might do in future. Possible artifact from large scale comment addition?)
2011-01-03 20:41:22 +00:00
Sam Reed
6309c920dd Delete all the "API for MediaWiki 1.8+" comments
Add since to ApiQueryQueryPage
2010-12-22 20:52:06 +00:00
Sam Reed
fd976ad072 Part of Bug 19195 - Make user IDs more readily available with the API
ApiQueryAllUsers, ApiQueryImageInfo and ApiQueryRevisions exposing user_id
2010-08-28 00:37:48 +00:00
Sam Reed
ec744522af I really do hate whitespace 2010-08-26 22:12:01 +00:00
Sam Reed
ca6dc55a0d * (bug 24724) list=allusers is out by 1 (shows total users - 1) 2010-08-26 22:09:29 +00:00
Sam Reed
4ef46d0006 Followup to r68338, remove useless code (row is overwritten by loop) 2010-08-18 20:34:42 +00:00
Sam Reed
1e0f0c4574 Prefix searches for users, not pages 2010-08-10 10:05:31 +00:00
X!
0f6085a585 (bug 24722) Only show blockinfo if user is actually blocked for list=allusers 2010-08-08 15:33:43 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
X!
7147b264bc * (bug 24677) axto= parameters added to allcategories, allimages, alllinks, allmessages, allpages, and allusers 2010-08-06 18:58:10 +00:00
Tim Starling
b2dc451c82 Rewrote r69339 etc. to clean up API cache header handling.
* Introduced a "cache mode" concept to simplify the header generation code, and to avoid odd results when conflicting cache header requests are received from submodules, or at least to formalise the handling of such cases.
* Made the cache mode private by default, so that code written in ignorance of caching tends to be safe. If different query modules are used in a single request, private caching is preferred over public caching.
* Removed the "must-revalidate" option from all CC headers, this is really specific to page views with a hacked squid in front, I don't think it's applicable here.
* Made the watchlist module private. This is really the definition of private data. There's nothing in the HTTP spec that says the URL for a CC:public request is private and can't be leaked. CC:private provides protection against unknown proxy behaviour.
* In ApiQueryAllmessages: avoid calling $wgLang->getCode() to check if it's necessary to make a new $wgLang when lang= is specified, since this is the only thing that unstubs $wgUser.
* Removed "FIXME: should this check $user instead of $wgUser?" Answer is no.
2010-07-23 07:17:56 +00:00
Sam Reed
8f1d2cb199 Big blitz on unused variables (a lot of $db = $this->getDb() ) 2010-07-22 22:13:21 +00:00
Sam Reed
2d8f0de854 Rem superfluous code, as per comments on r68338 2010-06-29 20:22:52 +00:00
Sam Reed
2d21295243 * (bug 23473) - Give description of properties on all modules
Commit patch by John Du Hart with a few minor tweaks/fixes
2010-06-23 19:36:26 +00:00
Derk-Jan Hartman
921619b119 Correct the address of the FSF in some of the GPL headers
59 Temple Place -> 51 Franklin Street
2010-06-21 13:13:32 +00:00
Sam Reed
53c5e4b942 Do ApiQueryAllUsers per r68337 (was using while (true)..) 2010-06-20 18:52:46 +00:00
Sam Reed
a90a0783de Nuke $db->freeResult() from Api stuffs 2010-06-20 17:48:21 +00:00
Roan Kattouw
37cf6f133b API: (bug 23534) Fix regression from r46809 (!) causing DB query error 2010-05-15 18:00:55 +00:00
Sam Reed
e55ed729c4 Mixture of things.
Couple of class comments

Normalisation of "." usage at end of lines (removed)

Normalisation of {prefix}parameter as per bug 23461
2010-05-11 22:30:18 +00:00
Jack Phoenix
96b4f302af API: fix copyright symbol, coding style cleanup, more braces 2010-02-24 13:34:11 +00:00
Greg Sabino Mullane
7766537c2c Use 'AS' for column alias 2010-01-26 20:36:22 +00:00
Aryeh Gregor
3758769f0d stylize.php on API code
"I wouldn't object to stylizing the API code to bring it in line with
the rest of MW on principle, but I'm not gonna bother myself." --Roan
<http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60657#c5108>

If you're seeing this commit in blames, tell your blame tool to ignore
whitespace, e.g., git blame -w or svn blame -x -w.
2010-01-11 15:55:52 +00:00
Roan Kattouw
0dc85a3658 Followup to r60587: wrong user_groups join 2010-01-03 20:16:25 +00:00
Roan Kattouw
e91308e012 API: Per Domas, don't FORCE INDEX when doing an INNER JOIN with the user_groups table 2010-01-03 20:12:59 +00:00
Roan Kattouw
1acd0e17b6 API: Fix breakage due to MySQL 5.1 behavior change: replace an implicit comma join with an explicit INNER JOIN and add a FORCE INDEX 2009-12-29 11:18:50 +00:00
Roan Kattouw
4bed047624 API: Fix for r58551: WDDX formatter barfs on null 2009-12-02 12:17:27 +00:00
Alexandre Emsenhuber
3978f827a6 * (bug 21083) API: list=allusers no longer returns current timestamp for users without registration date 2009-11-04 17:18:05 +00:00
Max Semenik
ae57ab1eec (bug 20275) Fixed LIKE queries on SQLite backend
* All manually built LIKE queries in the core are replaced with a wrapper function Database::buildLike()
* This function automatically performs all escaping, so Database::escapeLike() is now almost never used
2009-10-21 19:53:03 +00:00
Roan Kattouw
2df33ff098 * API: BREAKING CHANGE: (bug 11430) Return fewer results than the limit in some cases to prevent running out of memory
* This means queries could possibly return fewer results than the limit and still set a query-continue
* Add iicontinue, rvcontinue, cicontinue, incontinue, amfrom to faciliate query-continue for these modules
* Implemented by blocking additions to the ApiResult object if they would make it too large
** Important things like query-continue values and warnings are exempt from this check
** RSS feeds and exported XML are also exempted (size-checking them would be too messy)
** Result size is checked against $wgAPIMaxResultSize, which defaults to 8 MB

For those who really care, per-file details follow:

ApiResult.php:
* Introduced ApiResult::$mSize which keeps track of the result size.
* Introduced ApiResult::size() which calculates an array's size
  (which is the sum of the strlen()s of its elements).
* ApiResult::addValue() now checks that the result size stays below
  $wgAPIMaxResultSize. If the item won't fit, it won't be added and addValue()
  will return false. Callers should check the return value and set a
  query-continue if it's false.
* Closed the back door that is ApiResult::getData(): callers can't manipulate
  the data array directly anymore so they can't bypass the result size limit.
* Added ApiResult::setIndexedTagName_internal() which will call
  setIndexedTagName() on an array already in the result. This is needed for the
  'new' order of adding results, which means addValue()ing one result at a time
  until you hit the limit or run out, then calling this function to set the tag
  name.
* Added ApiResult::disableSizeCheck() and enableSizeCheck() which disable and
  enable size checking in addValue(). This is used for stuff like query-continue
  elements and warnings which shouldn't count towards the result size.
* Added ApiResult::unsetValue() which removes an element from the result and
  decreases $mSize.

ApiBase.php:
* Like ApiResult::getData(), ApiBase::getResultData() no longer returns a
  reference.
* Use ApiResult::disableSizeCheck() in ApiBase::setWarning()

ApiQueryBase.php:
* Added ApiQueryBase::addPageSubItem(), which adds page subitems one item
  at a time.
* addPageSubItem() and addPageSubItems() now return whether the subitem
  fit in the result.
* Use ApiResult::disableSizeCheck() in setContinueEnumParameter()

ApiMain.php:
* Use ApiResult::disableSizeCheck() in ApiMain::substituteResultWithError()
* Use getParameter() rather than $mRequest to obtain requestid

DefaultSettings.php:
* Added $wgAPIMaxResultSize, with a default value of 8 MB

ApiQuery*.php:
* Added results one at a time, and set a query-continue if the result is full.

ApiQueryLangLinks.php and friends:
* Migrated from addPageSubItems() to addPageSubItem(). This eliminates the
  need for $lastId.

ApiQueryAllLinks.php, ApiQueryWatchlist.php, ApiQueryAllimages.php, ApiQuerySearch.php:
* Renamed $data to something more appropriate ($pageids, $ids or $titles)

ApiQuerySiteinfo.php:
* Abuse siprop as a query-continue parameter and set it to all props that
  couldn't be processed.

ApiQueryRandom.php:
* Doesn't do continuations, because the result is supposed to be random.
* Be smart enough to not run the second query if the results of the first
  didn't fit.

ApiQueryImageInfo.php, ApiQueryRevisions.php, ApiQueryCategoryInfo.php, ApiQueryInfo.php:
* Added continue parameter which basically skips the first so many items

ApiQueryBacklinks.php:
* Throw the result in a big array first and addValue() that one element at a time if necessary
** This is necessary because the results aren't retrieved in order
* Introduced $this->pageMap to map namespace and title to page ID
* Rewritten extractRowInfo() and extractRedirRowInfo() a little
* Declared all private member variables explicitly

ApiQueryDeletedrevs.php:
* Use a pagemap just like in Backlinks
* Introduce fake page IDs and keep track of them so we know where to add what
** This doesn't change the output format, because the fake page IDs start at 0 and are consecutive

ApiQueryAllmessages.php:
* Add amfrom to facilitate query-continue

ApiQueryUsers.php:
* Rewrite: put the getOtherUsersInfo() code in execute()
2009-02-05 14:30:59 +00:00
Roan Kattouw
b677d0191d * API: (bug 17355) Added auwitheditsonly parameter to list=allusers
* Use consistent code style
2009-02-04 19:10:14 +00:00
Roan Kattouw
8e9a43114a API: (bug 16594) Use strict comparison in list=allusers. This'll hopefully make [[User:]] on enwiki show up again; he's currently being dropped from the user list because false == '' 2008-12-11 21:51:01 +00:00
Roan Kattouw
826bcef0fa Fix regression from r36678: we can't use $this->dieUsageMsg() in a static method, so let's make ApiQueryBase::keyToTitle() and titleToKey() non-static. 2008-06-29 22:26:23 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Roan Kattouw
5b8213e9ef * Re-applying r34449, r34500 and r34518 which Brion reverted by accident
* Adding ApiQueryBase::addJoinConds() as wrapper for Database::select()'s $join_conds parameter
* Migrating query modules to addJoinConds()
* Using implicit join rather than INNER JOIN in ApiQueryBacklinks
* Using FORCE INDEX (times) on logging table in ApiQueryLogEvents; although MySQL 4 seems to pick this index automatically (evidenced by the fact the WMF servers are still alive), MySQL 5 doesn't and filesorts
* Replacing LEFT JOIN with implicit (inner) join in ApiQueryContributions: revisions without a corresponding page table entry shouldn't be shown anyway
2008-05-10 10:49:26 +00:00
Brion Vibber
4bc02c88ca Revert to r34430 in order to revert r34431 which is breaking the site (unindexed filesorts) 2008-05-09 18:00:15 +00:00
Roan Kattouw
10274469e5 (bug 14022) Added usprop=registration and auprop=blockinfo 2008-05-09 10:00:34 +00:00
Roan Kattouw
b7d460aaeb API:
* Added ApiQueryBase::addJoin() which provides a cleaner interface to construct JOIN queries. Behind the scenes this still uses the old, ugly way, but it'll be easy to rewrite when/if the Database class gets its own function for JOINs
* Used addJoin() in query modules where necessary
* Removed FORCE INDEX (rc_timestamp) from ApiQueryRecentchanges: it's nigh impossible to integrate with addJoin() and it doesn't seem to be necessary anyway (my MySQL instance automatically chooses rc_timestamp)
2008-05-08 12:33:20 +00:00
Roan Kattouw
fa2ac03100 Reverting r34388, DanTMan fixed Database::select() in r34442. 2008-05-08 10:05:32 +00:00