Commit graph

174 commits

Author SHA1 Message Date
Roan Kattouw
d0045bcd78 API: Don't unstub $wgContLang in ApiBase::getValidNamespaces() 2010-02-26 18:24:58 +00:00
X!
0543d7bdce Whoops, committed wrong version 2010-02-24 17:06:19 +00:00
X!
fe72f84205 PARAM_TYPE 'user' now works for multi-values 2010-02-24 17:04:21 +00:00
Mark A. Hershberger
c871b75a3e follow up r62231, r61779, r62175
* Fix up messages
* For new FileRepo::append(), use flags to determine whether to delete or not
* Add more error checking for appending
* Fix a couple of places in Revision.php and LogPage.php where DB errors were produced when comment was null
* Remove bogus checking for !$comment, etc on the DONE phase of chunked uploading
* Don't pretend to return a value when raising an exception
* Add more tests for chunked uploads
* Verify that Status::getErrorsArray() (at least where it is used in ApiUpload::execute()) returns an array that we can pass to dieUsageMessage()
* Ensure that checkWarnings(), etc work only on the complete file
2010-02-22 02:15:30 +00:00
Jack Phoenix
4228459b24 ApiBase.php: coding style cleanup, added more braces, trimmed trailing spaces, changed copyright symbol to the proper one 2010-02-20 19:39:51 +00:00
Sam Reed
878c7da630 Followup to r62557 as per Roans comment 2010-02-16 21:59:16 +00:00
Sam Reed
eb9aa1686c Followup to r62557
Add array( 'sessionfailure' ) to getPossibleErrors for token using modules (missed adding when removing from individual modules!)
2010-02-16 01:27:19 +00:00
Sam Reed
0e8b0b41ac Refactor requiresToken to getTokenSalt - Returns salt if exists, null if no salt, else false if no token required
Move sessionfailure (token validation checking) up a couple of levels

Part of bug 21991

Followup to r62482 and r62504
2010-02-15 23:53:43 +00:00
Roan Kattouw
3a953c8e30 API performance fixes: avoid unstubbing $wgContLang and $wgUser 2010-02-15 20:50:21 +00:00
Mark A. Hershberger
26a4587d80 follow up r62353 Make ApiBase::requireOnlyOneParameter() accept parameters that are set, but false. This means that you can pass in more than one parameter, as long as it is the same as the default (false). Have to do it this way since we'd like to default boolean parameters to false in getAllowedParams() but by the time requireOnlyOneParameter() is called, the defaults are set, so we can't tell the difference between passing in a parameter set to the default and just getting the defaults. 2010-02-15 07:06:49 +00:00
Sam Reed
80f9448690 Start of "Bug 21991 - Move common query parameter (uc, rc) validation, token requiringness/checking to ApiBase/Similar"
Move token requringness check to the ApiMain

Adding an exception if we're using "gettoken" (block/unblock)

Remove array( 'missingparam', 'token' ), from the getPossibleErrors of modules that set requireToken method to true
2010-02-14 22:20:27 +00:00
Sam Reed
fcdb5b846c Move ( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ) to messageMap 2010-02-14 15:16:09 +00:00
Mark A. Hershberger
8b36a2b969 various eol whitespace now instead of when someone needs to do CR 2010-02-12 06:44:16 +00:00
Sam Reed
bd7da13869 Simplification as per Bryan on r62339 comment 2010-02-11 23:09:38 +00:00
Sam Reed
c1af4821bf Cater for some more errors in ApiBase.php 2010-02-11 22:28:30 +00:00
Sam Reed
20206755ee $this->mModuleName to $this->getModuleName() 2010-02-11 22:18:16 +00:00
Sam Reed
8eb8e2e0d4 Update code documentation with Bryans help for r62282 and r62331 2010-02-11 22:06:45 +00:00
Sam Reed
72df21ef49 Followup to bryans comment for r62328
Rename possibleErrors to getPossibleErrors
2010-02-11 21:53:57 +00:00
Sam Reed
fe722d85a5 Move mustBePosted error into messageMap
Switch call to dieUsage to dieUsageMsg
2010-02-11 21:51:15 +00:00
Sam Reed
aa973b9eb7 More of bug 18771 - List possible errors in action=paraminfo
Followup to comments of r62282
2010-02-11 21:34:35 +00:00
Sam Reed
ee60482546 Start implementation of bug 18771 - List possible errors in action=paraminfo
Base has empty array() returning method, ApiBlock has implementation of possibleErrors from code above (possibly not complete)

Can be finished incrementally, so serves as a review point for Roan
2010-02-11 01:13:45 +00:00
Mark A. Hershberger
15fec3ab7f * Fix up ApiTest a bit, cookie handling works
* Start upload chunks testing
* found some problems with messages
2010-02-09 08:37:38 +00:00
Sam Reed
b15f2c8c46 Normalise comment usage (# --> //) 2010-01-23 22:52:40 +00:00
Sam Reed
47c24175d3 Add/remove whitelines to increase readability in API code files 2010-01-23 22:26:40 +00:00
Roan Kattouw
51107443dc API: Fix bug where deprecated boolean parameters would always trigger the deprecated warning. 2010-01-23 17:48:02 +00:00
Mark A. Hershberger
b15cccb688 ws only cleanup 2010-01-22 03:14:52 +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
Tim Starling
bd8fffe24d Reverted r58646 as per my comments on bug 20554. 2009-12-01 01:55:04 +00:00
Roan Kattouw
1b89cd274a API: (bug 20554) Expose average slave lag (avglag) as well as maxlag. Patch by Sam Reed. 2009-11-06 14:38:55 +00:00
Raimond Spekking
a0d01f9cae Follow-up r58237: fixing PHP Notice: Undefined variable: deprecated in /var/www/w/includes/api/ApiBase.php on line 633 2009-10-28 05:20:17 +00:00
Chad Horohoe
c660ee428f (bug 21106) tag deprecated parameter in action=paraminfo. Add new PARAM_DEPRECATED const for automagically tagging deprecated parameters. Keeps action=help and action=paraminfo up to date 2009-10-28 00:56:07 +00:00
Alex Z
216e60d01e (bug 18019) Warn users when moving a file to a name in use on a shared repo.
Allow only users with the 'reupload-shared' right to complete the move.
2009-10-24 04:36:11 +00:00
Siebrand Mazeland
f854edfe87 New permission 'sendemail' added. Default right for all registered users. Can for example be used to prevent new accounts from sending spam.
* hide some user settings if user is not allowed to send e-mail, but can receive e-mail
* update API 'cannot send e-mail' message
* FIXME: gives 'mailnologin'/'mailnologintext' as error. Error handling should be made more fine grained
2009-09-26 23:11:45 +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
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
Roan Kattouw
9e881e1b2e Elaborate docs added in r53753 per CR comment 2009-07-26 18:24:47 +00:00
Roan Kattouw
4353f7b321 Followup to r53702: document $extradata parameter 2009-07-25 18:29:13 +00:00
Aryeh Gregor
da31137022 Better documentation for dieUsage()
If I got it wrong, please improve.
2009-07-23 23:50:04 +00:00
Michael Dale
369402239c other part of the r53342 commit 2009-07-15 23:15:51 +00:00
Michael Dale
aefc40d749 here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview

= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions

== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php

* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)

== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.

= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader

* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html  )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.

= js2 system  / mwEmbed=
$wgEnableJS2system = false

* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)

* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.

= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs  <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)

== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.

== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
Bryan Tong Minh
31d9947618 (bug 18533) Add readonly reason to readonly exception 2009-07-12 12:38:03 +00:00
Roan Kattouw
91271d809e API: (bug 18731) Show correct SVN links for extension modules in api.php?version . Guesswork to get the path assumes extensions are in a directory called extensions/extensionname , which should be a valid assumption on sane installs. 2009-05-09 12:52:38 +00:00
Chad Horohoe
c5ae50df41 Don't explicitly check for false. Most modules without params return an empty array rather than false, in which case we still don't want to output this. 2009-05-07 20:02:20 +00:00
Roan Kattouw
e484ef763d API: Fix regression from r32224 with caused bug 18597 (internal error for empty generator= parameter) 2009-04-27 14:21:16 +00:00
Roan Kattouw
1083d741dc Followup to r49013: forgot to commit ApiBase.php 2009-03-29 16:40:31 +00:00
Roan Kattouw
5e7acff52b API: Add nosuchuser message to ApiBase::$messageMap 2009-03-26 13:01:53 +00:00
Alexandre Emsenhuber
c53e76ad34 Changed ereg(i)_replace to preg_replace, the former is throwing E_DEPRECATED since PHP 5.3 2009-03-18 19:25:29 +00:00
Alexandre Emsenhuber
9dd9379eb4 Per anomie's report on IRC: $wgMaxArticleSize is in kilobytes, not bytes 2009-03-07 17:37:29 +00:00
Roan Kattouw
21fd7af97e * API: (bug 17774) API pretends action=query doesn't exist for users without read rights
* Instead of hiding read-restricted modules, throw an error when a user without read rights tries to use them
* Do the same for write modules when $wgEnableWriteAPI is false
* Indicate whether a module needs read or write rights in action=help and action=paraminfo
* BREAKING CHANGE: action=purge now requires write rights and, for anonymous users, a POST request
2009-03-06 13:49:44 +00:00
Roan Kattouw
5349ea2dd8 * API: (bug 13209) Add rvdiffto parameter to prop=revisions
* Add $wgAPIMaxUncachedDiffs (default 1) which controls how many non-cached diffs will be served per request
* Tweak DifferenceEngine.php a bit to make cache status accessible, and remove a useless 'parseinline' which broke diff generation in the API
2009-02-28 13:25:21 +00:00