Commit graph

1047 commits

Author SHA1 Message Date
Happy-melon
d3f901b029 Merge in Login rewrite, second time lucky. 2009-09-20 20:28:27 +00:00
Bryan Tong Minh
bc20609885 Follow up to r56639: Remove some existence check duplication and fix ApiUpload for changed return format of getExistsWarning. 2009-09-19 15:49:54 +00:00
Roan Kattouw
9661f21b82 * API: (bug 20700) Add amprop=default to list default messages in list=allmessages. This adds default="defaultmessagecontent" or defaultmissing="" to customized messages; non-customized messages get no extra attribute.
* Don't parse magic words in messages returned by meta=allmessages , but output the message contents verbatim
2009-09-18 15:24:00 +00:00
Roan Kattouw
fba3528881 Partial revert of r56602: remove what is probably accidentally committed debugging code. 2009-09-18 14:38:59 +00:00
Andrew Garrett
4c36759b69 Force changedfilter parameter to integer on Special:AbuseFilter.
Resolves bug 20496
2009-09-18 14:30:05 +00:00
Roan Kattouw
ef4886778f API: Per CR comments on r56091, make the timeout for the API help cache configurable 2009-09-17 19:39:34 +00:00
Alex Z
68596ac79c merge most of r56515 back to trunk (changing UserrightsPage::fetchUser to non-static)
Fixing ApiQueryUsers so it should work properly for interwiki users
2009-09-17 16:21:27 +00:00
Roan Kattouw
87d401f2e6 Fix r56091: cache URLs with and without ?version separately 2009-09-17 15:47:44 +00:00
Alex Z
406b6916c7 Actually use the filename supplied by the user. 2009-09-17 01:03:52 +00:00
Michael Dale
1e4165061b more (bug 20336)
* added json folder 
* moved Services_JSON.php there
* moved Format JSON into its own class
* updated AutoLoader
2009-09-10 14:33:25 +00:00
Roan Kattouw
9e78c71b1e API: Make it possible to fetch userrights tokens for interwiki users; make UserrightsPage::fetchUser() static 2009-09-10 13:44:49 +00:00
Roan Kattouw
990714436e API: When returning an emtpy opensearch result because mwsuggest is disabled, return a valid opensearch response. 2009-09-10 13:07:36 +00:00
Tim Starling
7b7f9f0d4d Comments and whitespace fixes only. 2009-09-10 06:43:01 +00:00
Michael Dale
7efc871cba * (bug 20336) changed json_decode json_encode to static class in global functions
** we should update extensions as well
* added config for fileCheckModify date check to scriptLoader unique script id generation
2009-09-09 22:26:16 +00:00
Roan Kattouw
29c594f9a4 Follow-up to r55639: per CR comment, make API help caching disableable, and let the cache key depend on the version string 2009-09-09 12:54:56 +00:00
Brion Vibber
ecf95fd877 Cleanup for r55641: call static function statically 2009-09-08 23:54:03 +00:00
Brion Vibber
841014ad91 Revert broken rewrite of login forms:
r55990 "* Totally refactor includes/specials/SpecialUserlogin.php:"
r55991 "Followup to r55990 - Remove debugging hack :("
r55994 "Followup to r55990 - rename method to avoid PHP Strict warnings"
r55997 "Follow-up to r55990, per comments:"

Continued reports of breakage with the new version...
Non-vital changes of this magnitude should probably be worked up on a branch to ensure everything's consistent before pushing them to trunk.
2009-09-08 18:40:05 +00:00
Happy-melon
72431ff920 Followup to r55990 - rename method to avoid PHP Strict warnings 2009-09-07 19:20:20 +00:00
Happy-melon
fca012212f * Totally refactor includes/specials/SpecialUserlogin.php:
** Split backend stuff out into includes/Login.php
** Split account creation and login stuff up, into includes/specials/CreateAccount.php and includes/specials/Userlogin.php.
* Reimplement the special pages as subclasses of SpecialPage
* Use HTMLForm to generate the input forms
** Deprecate and delete includes/templates/Userlogin.php, which is horrible and old :D

This changes the syntax of the UserLoginForm and UserCreateForm hooks, and AuthPlugin::modifyUITemplate; they now receive the SpecialPage subclass rather than the template to work with. Update everything I could find in SVN to accommodate this.
2009-09-07 19:00:49 +00:00
Daniel Kinzler
0234640637 adding public access methods for use by XMLRC extension. 2009-09-03 16:15:55 +00:00
Tim Starling
f4d32ce48b Fix for r53194: according to the XSLT 1.0 spec, the MIME type should be text/xml or application/xml. In XSLT 2.0, it is application/xslt+xml. Either way, text/xsl is wrong. 2009-09-02 08:05:47 +00:00
Bryan Tong Minh
efd86ed3aa * Add buffering to ApiFormatBase, which allows buffering the result without needing ob_* functions. This is for async downloads, but I couldn't get it to work yet so this commit does not contain the files that actually use the buffering.
* Hide internalhttpsession parameter from web requests
2009-08-28 21:18:39 +00:00
Roan Kattouw
e3ab8ed99a API: BREAKING CHANGE: (bug 20426) Instead of throwing an error when a limit is set too high/low, throw a warning and continue with the limit set to the maximum/minimum 2009-08-28 16:37:48 +00:00
Roan Kattouw
d7f593a312 API: Add user-agent and method (GET/POST) to request logging, and only log the action= parameter for mustBePosted modules 2009-08-27 22:09:28 +00:00
Roan Kattouw
3ac3ccaaf0 API: Refactor the XML formatter a bit so that ApiFormatXml::recXmlPrint() is now actually usable as a generic XML formatter 2009-08-27 21:15:20 +00:00
Roan Kattouw
adf309bdc8 API: Cache API help in memcached, inital use of the API log added earlier seems to indicate that the help is expensive. Cache doesn't seem to help for me locally, so we probably need to test this on a real server and see if it really works. 2009-08-27 18:25:51 +00:00
Roan Kattouw
73560aeb2c API: Do a STRAIGHT_JOIN in ApiQueryBacklinks's first query to counter a MySQL 4 bug where the optmizer chooses to do a table scan on page instead. 2009-08-27 14:58:19 +00:00
Michael Dale
8fbc2feb5a enabled async downloaded via configuration var: wgEnableAsyncDownload (pending windows fix) 2009-08-27 14:46:54 +00:00
Bryan Tong Minh
fdc9df9629 * Output warnings as filenames rather than an array representation of a File object.
* Renamed variable in UploadBase::checkWarnings to better indicate its meaning
2009-08-27 14:21:53 +00:00
Roan Kattouw
f8f279e865 API: Per rainman, mark list=search as an expensive query and lower its limits to 50/500 from 500/5000 2009-08-26 21:13:06 +00:00
Bryan Tong Minh
05a916153f * Cleanup ApiUpload
* UploadBase::verifyUpload now always returns a status array
* Disabled async upload by url because wfShellBackgroundExec is broken
2009-08-26 19:38:38 +00:00
Bryan Tong Minh
05336e91ad Unify properties in ApiQueryAllimages, ApiQueryImageinfo and ApiUpload. 2009-08-26 17:30:36 +00:00
Bryan Tong Minh
04cae75f25 (bug 19999) Made metadata and properties of search results optional. Added srprop and srinfo. 2009-08-25 20:18:12 +00:00
Michael Dale
cf7448516a hard coded requested imageinfo prop in api upload result (to avoid static call to non-static: ApiQueryImageInfo::getAllowedParams(); 2009-08-22 06:36:19 +00:00
Brion Vibber
aa1740d88d Cleaning up some old PHP 4 object-reference usage in some edit filtering hooks.
There was a mix of uses of the reference and non-uses of the reference. :)
Reverts r53714 and fixes it from the other end by cleaning up the uses to not expect references.
2009-08-21 21:51:29 +00:00
Brion Vibber
8919302663 Revert r54291 "(bug 19004) Added support for tags to the API. Patch by Matthew Britton."
Per notes on code review, this doesn't handle multiple tags correctly right now.
2009-08-19 17:34:08 +00:00
Michael Dale
52c5db1a47 * removed plain-text output because IE is retarded treats plain-text as html (in fact no mime type I have found lets you send text to IE and have it treat it like text :( .... 2009-08-15 22:38:01 +00:00
Michael Dale
b2d1c1a4b1 * added content-type plain/text output param for json format
* added content-type "application/json" or 'text/javascript' per callback param
2009-08-15 20:24:30 +00:00
Michael Dale
305179ffa3 * added missing setIndexedTagName for some upload api array results
* switched apiFormatJson output from 'application/json' to 'text/javascript'
2009-08-15 10:22:20 +00:00
Tim Starling
831b6d2bf7 * Per my CR comments on r44560: merged FileCache into RepoGroup and fixed wfFindFile() global function bloat. Did not port unused functions such as the batch loading functions.
* Fixed the formal parameter bloat in the file finding functions by making wfFindFile(), RepoGroup::findFile() and FileRepo::findFile() take an associative array of options instead of a rapidly growing collection of formal parameters. Maintained backwards compatibility for the $time parameter, which was the only one used in an extension.
* Took the advice of the todo comment on FileRepo::findFiles() and implemented a calling convention for specifying times (and other options)
* Removed the file object cache from Parser, redundant with the RepoGroup file cache
* Deleted clueless and non-functional LocalRepo::findFiles(). Does not respect redirects, deletion bitfields, or anything else nuanced about FileRepo::findFile(). Does not have the same calling convention as FileRepo::findFiles().
2009-08-15 09:59:59 +00:00
Bryan Tong Minh
c99341e5b4 Overide getDB() method to make sure to make sure the repo's DB is used which may not necesarilly be the same as the local DB. 2009-08-04 08:40:38 +00:00
Alexandre Emsenhuber
d8ad5fc9b3 fix for r54291: missing ending $ in $Id$ 2009-08-03 19:57:35 +00:00
Bryan Tong Minh
1ac223539e (bug 19004) Added support for tags to the API. Patch by Matthew Britton. 2009-08-03 17:48:01 +00:00
Bryan Tong Minh
95e16a5837 Revert r53678, r53704, r53705, r53773, r53930, r54199, r54201: Addition of ApiQueryBrokenRedirects and ApiQueryDoubleRedirects.
This is pure code duplication and should be done by fetching data from the respective query pages. This has as advantage that other query pages can be readily added to the API as well. See the querypage-work branch.
2009-08-03 11:06:24 +00:00
Alex Shih-Han Lin
78bb312b86 forget to shutdown classes in ApiQuery.php 2009-08-02 12:29:42 +00:00
Alex Shih-Han Lin
2cfe03622e forget to set table name to variable 2009-07-29 12:23:33 +00:00
Brion Vibber
2715818986 * Added fields to list=search output: size, wordcount, timestamp, snippet
* Where supported by backend, list=search adds a 'searchinfo' element with
  optional info: 'totalhits' count and 'suggestion' alternate query term

Snippets added to result items earlier by Roan; extended this with the other
byte size, word count, and timestamp available on the result items and exposed
through the regular UI.

Had to work out a backwards-compatible method for the search meta-information
with Roan; added a second 'searchinfo' element since adding attributes to
'search' would break compatibility for JSON output (despite being safe in XML).

'searchinfo' is present only if the backend supports the extra info and has
something available; 'totalhits' with a total hit count and 'suggestion' for
an alternate query suggestion (exposed as "Did you mean X?" link in UI).

Note that total hit counts can be enabled for MySQL backend now by setting
the experimental option $wgSearchMySQLTotalHits, but did-you-mean suggestions
are not yet supported and need to be tested with a hack or another backend.

Sample XML and JSON output with the new searchinfo items (which can be
present whether or not there are any result items):

<?xml version="1.0"?>
<api>
  <query>
    <searchinfo totalhits="0" suggestion="joe momma" />
    <search />
  </query>
</api>

{
	"query": {
		"searchinfo": {
			"totalhits": 0,
			"suggestion": "joe momma"
		},
		"search": [
			
		]
	}
}

The suggestion value is suitable for plugging back in as a search term,
if present.
2009-07-28 21:13:48 +00:00
Michael Dale
9bdeb8a885 improved upload api documentation 2009-07-28 17:52:09 +00:00
Michael Dale
996d17d401 * ignorewarnings fixes
* removed extra debug statement 
* supports do_close_session_update for php based requests
2009-07-27 21:32:25 +00:00
Michael Dale
6af2322f85 * ( bug 19930 ) default to SYNC_DOWNLOAD 2009-07-27 19:00:27 +00:00