Commit graph

47 commits

Author SHA1 Message Date
Jack Phoenix
7ced9bc569 API: fix copyright symbol, coding style cleanup, more braces 2010-02-26 13:18:56 +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
Sam Reed
878c7da630 Followup to r62557 as per Roans comment 2010-02-16 21:59:16 +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
Mark A. Hershberger
293641976a follow-up r62498 — use the new functionality of requireOnlyOneParameter of allowing “false” defaults 2010-02-15 17:50:35 +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
40dd0530f9 Stylize API files 2010-02-13 01:41:37 +00:00
Sam Reed
d299fc6a55 Complete dieUsage errors in 7 more Api files 2010-02-13 01:21:52 +00:00
Sam Reed
d2d950d256 Start of blanket coverage of dieUsageMsg in getPossibleErrors
Only basic ones done.

Couple of other modules done manually
2010-02-13 00:09:05 +00:00
Mark A. Hershberger
57c2247c81 Final(?) changes to enable chunked uploading. 2010-02-12 06:28:03 +00:00
Sam Reed
8238e6657b Remove old/deprecated $this->getMain()->isWriteMode(); from ApiUpload 2010-02-11 22:25:31 +00:00
Mark A. Hershberger
fd27d340b5 Make sure Firefogg gets the json it needs. 2010-02-11 06:14:15 +00:00
Mark A. Hershberger
c0cd377c0f follow-up r61355
Actually test UploadChunks code against Firefogg.  Uploads work, but
feedback on the Firefogg side seems not too.  Also, Firefogg makes a
complete upload, but then attempts more uploads.
2010-02-11 05:35:21 +00:00
Mark A. Hershberger
c74fe71cd8 * new FauxResponse class to help with unit testing
* Add append() method to FileRepo classes to enable chunked uploading
* Change chunksessionkey to chunksession
* Remove echo json stuff
* Fix a multitude of bugs in my own code
* still to test: mwEmbed use of chunked upload
2010-02-10 10:36:11 +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
Mark A. Hershberger
5b5d7ef6f7 follow up r61355, initial, incomplete dealing with TimStarlings CR 2010-02-01 07:05:23 +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
7be0ea84e0 Fix indentation in r61407. PLEASE don't use spaces for indentation, always use tabs. 2010-01-23 15:09:16 +00:00
Mark A. Hershberger
eecb86354a follow up r61355 2010-01-23 05:20:31 +00:00
Mark A. Hershberger
c5d228be4c UploadChunks added from js2 branch. Refactored. Still needs to be
tested w/o the UI first.
2010-01-22 04:37:23 +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
455bb78b12 API: Minor cleanup for r59258, general whitespace cleanup 2009-12-02 12:28:27 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Sam Reed
9546d0bffc Apply patch from bug 21589 API: Separate summary and initial page text for uploads 2009-11-22 15:14:19 +00:00
Tim Starling
251c21e84b Rework of libAddMedia. The changes are entirely untested and there may be bugs, but at least the code is nicer to look at now. This commit message is probably incomplete.
In libAddMedia:
* Made many style changes, renamed many variables.
* Wrote a doc comment for most functions
* Renamed messages: 
   * fogg-check_for_fogg -> fogg-check_for_firefogg
   * fogg-for_improved_uplods -> fogg-for_improved_uploads
   * fogg-use_latest_fox -> fogg-use_latest_firefox
   * mwe-upload-stats-fileprogres -> mwe-upload-stats-fileprogress

* Renamed functions:
   * doRemapFormToApi -> remapFormToApi
   * doUploadSwitch -> doUpload
   * proccessIframeResult -> processIframeResult
   * getEditForm -> getForm
   * dispProgressOverlay -> displayProgressOverlay
   * cancel_button -> getCancelButton
   * cancel_action -> onCancel
   * doControlHTML -> createControls
   * getTargetHtml -> getControlHtml
   * doControlBindings -> bindControls
   * getOSlink -> getFirefoggInstallUrl
   * doPreviewControl -> createPreviewControls
   * doRenderPreview -> renderPreview
   * selectFogg -> selectSourceFile
   * selectFoggActions -> updateSourceFileUI
   * saveLocalFogg -> doLocalEncodeAndSave
   * doChunkWithFormData -> doChunkUploadWithFormData
   * proccessPresetControl -> getPresetControlHtml
   * proccessCkControlHTML -> getConfigControlHtml
   * selectByUrl -> selectSourceUrl

* Promoted anonymous functions to methods:
   * onSubmit
   * onAjaxUploadStatusTimer
   * onAjaxUploadStatusResponse
   * onPreviewClick

In mvBaseUploadInterface:
* Made http_copy_upload lazy-initialised
* Made detectUploadMode() do only what it says, moved the actual upload stage to a callback.
* Refactored doUpload(), splitting out doApiCopyUpload() and doPostUpload()
* Refactored apiUpdateErrorCheck() into isApiSuccess() and showApiError()

In mvFirefogg:
* Made have_firefogg, sourceFileInfo lazy initialised
* Rearranged autoEncoderSettings() to make it the accessor getEncoderSettings()
* Rearranged firefoggCheck() to make it the accessor getFirefogg()
* Split encodeDone into the anonymous doEncode() done callbacks, and also the new function onLocalEncodeDone()

In mvAdvFirefogg:
* Refactored autoEncoderSettings() into getEncoderSetings() and updateSourceFileUI()

Elsewhere:
* Fixed spelling error UploadBase::MIN_LENGHT_PARTNAME
2009-11-20 07:23:08 +00:00
Raimond Spekking
534bce0273 Follow-up r55613: Fix typo. I guess that 'baddaccess-groups' was a typo because such a message does not exists.
But 'badaccess-groups' has two parameters: $1 a list of groups and $2 the count of them. These parameters are missing.
2009-11-04 16:07:42 +00:00
Bryan Tong Minh
3d6ca209f3 * Validate sessionkey for stashed uploads
* (bug 21235) Switch around fetchfileerror to the proper order
2009-10-28 22:23:00 +00:00
Michael Dale
7e0fcad32b ( bug 21320 ) adds early checks for wgAllowCopyUpload and 'upload_by_url' permission so that web server does not make extra requests. 2009-10-28 03:38:23 +00:00
Bryan Tong Minh
91e4d80448 Rewrote Special:Upload to allow easier extension. Mostly backwards compatible towards the end user: tested with Commons' upload scripts.
* Special:Upload now uses HTMLForm for form generation
* Upload errors that can be solved by changing the filename now do not require reuploading.
2009-10-18 19:41:01 +00:00
Michael Dale
ab2745e92b * ( bug 21089 ) fixes js2 upload stash support.
* Tested with chunk firefogg uploads, normal js2 uploads and http copy by url uploads
2009-10-15 00:14:05 +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
Alex Z
406b6916c7 Actually use the filename supplied by the user. 2009-09-17 01:03:52 +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
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
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
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
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
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
Chad Horohoe
4ba1e9fb35 (bug 19914) ApiUpload needs to use write mode. 2009-07-25 00:07:35 +00:00
Michael Dale
9d2c313829 fixed error msg 2009-07-15 23:11:24 +00:00
Michael Dale
91dd5f411a fixed httpstatus boolean & updated error to use dieUsageMsg 2009-07-15 20:27:55 +00:00
Jack Phoenix
de7fa9061b follow-up to r53282:
*coding style tweaks
*added __METHOD__ to some wfDebug calls
*removed php ending tag from mwScriptLoader.php
*some doxygen docs added
2009-07-15 00:55:58 +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