Follow-up r70137: Made asynchronous upload working a bit more. It now fully works...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 6 Sep 2010 10:18:53 +0000 (10:18 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 6 Sep 2010 10:18:53 +0000 (10:18 +0000)
commit3e1eff2a013cc8f632ae09d31555839fbee00203
treea68746122964e51fbc750e1f3e26bfa353a74fcf
parent31e26a24015ea79af5aa321f9dbd2b170e00ee62
Follow-up r70137: Made asynchronous upload working a bit more. It now fully works from the API; works still needs to be done for the normal UI. PHPUnit tests are updated and should cover most code paths that can be called from the API.

ApiUpload:
* Added "statuskey" parameter; this is the key that is returned by an async upload
* Refactored warnings transformation into its own function
* filename is no longer required on all uploads

UploadFromUrlJob:
* Moved upload results to its own entry in $_SESSION, instead of using the one from upload
* Fix storing in session by calling wfSetupSession and session_write_close where needed

Tests:
* Set $wgUser in ApiSetup, so that individual tests don't have to do this for themselves
* Added tests to cover most code paths from the API
* Fixed UploadFromUrlTestSuite so that its tests are included in a regular phpunit invocation (something strange with the AutoLoader; not sure what)

Other files:
* Allow passing session id to wfSetupSession
* Explicitly close the session before doing jobs, so that jobs can't manipulate the current session
RELEASE-NOTES
includes/GlobalFunctions.php
includes/Wiki.php
includes/api/ApiUpload.php
includes/job/UploadFromUrlJob.php
includes/upload/UploadFromUrl.php
maintenance/tests/ApiSetup.php
maintenance/tests/UploadFromUrlTest.php
maintenance/tests/UploadFromUrlTestSuite.php