Commit graph

24 commits

Author SHA1 Message Date
Aaron Schulz
f31a0463aa Fixed importScopedSession() and moved exportUserSession() to RequestContext.
* Renamed WebRequest::exportUserSession -> RequestContext::exportSession.
  Updated the only callers of this new function.
* Init the user with User::newFromId() instead of relying on the session
  (which breaks when things like CentralAuth are enabled).
* Made RequestContext::exportSession() include the user ID.
* Removed now-redundant user ID checks in upload jobs.
* Added unit tests for the session import function.

Change-Id: I543e6766f7a8a828ea5d270328c3bc7738c6fe94
2013-03-15 12:49:54 -07:00
Aaron Schulz
fbf34d84ab [Upload] Moved async upload stuff to the job queue.
* (bug 44080) Also carry-over the IP and HTTP header info.
* This adds a RequestContext::importScopedSession() function.

Change-Id: Ie9c0a4d78fb719569c8149b9cc8a5430f0ac5673
2013-02-15 15:00:35 -08:00
Tim Starling
4d15d53259 Weaken the recursion guard on RequestContext::getLanguage()
Just log and soldier on, since for some reason we are seeing a lot of
these exceptions at the moment, with multiple root causes. Based on Matt
Walker's I49dbc2d7. Updates Idc11b547. See bug 44754.

Change-Id: I2e8c062741c1b2ec2acd68dc76d3fb6efb113571
2013-02-08 16:38:41 +11:00
Niklas Laxström
c014e6b060 (bug 44010) Pass context to UserGetLanguageObject
Only way to avoid messing with wrong request contexts.
Had to add recursion guard too.

Change-Id: Idc11b54752450321e01d92004e08fc95fb6170e6
2013-01-18 10:56:27 +01:00
Siebrand Mazeland
f741f6c092 Update doc comments and code formatting.
Change-Id: I1896d7b1ab5d11d3a609fd97db7c503ad6c590e5
2013-01-11 16:56:04 +01:00
Daniel Friesen
0b6b78d13a It should not be possible for a RequestContext's WikiPage and Title to be different.
Looks like someone messed with RequestContext when I wasn't looking at it.
WikiPage is a representation of the Title. It should not be possible for wikipage
to point to a different title than the context's title.

Fix this issue by unsetting WikiPage when setting title and updating title when
setting wikipage.

Change-Id: I40471b12d08763cb1b47b8382f96d8db94b4f319
2012-10-24 08:17:27 -07:00
umherirrender
85d8ee1f87 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
2012-10-10 20:14:40 +02:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Alexandre Emsenhuber
caf5df17ab Per Aaron, fix for r108274: added canUseWikiPage() to context objects to know whether getWikiPage() can be safely called 2012-01-14 14:27:46 +00:00
Sam Reed
f67893fd4a Push msg from ContextSource/RequestContext into IContextSource 2012-01-13 02:37:04 +00:00
Alexandre Emsenhuber
418b3503b1 * Added WikiPage to RequestContext and related so that it can be shared to avoid creating a new object each time and thus avoiding database queries to load the state of the object
* Added Article::getPage() as accessor to the WikiPage object so that it can be set in the context from MediaWiki::initializeArticle()
* Use it WikiPage::main() to call doViewUpdates()

I'm doing to this now so that I can revert r105790 and use the WikiPage object before the 1.19 release
2012-01-06 20:00:04 +00:00
Daniel Friesen
e96d2d6802 Add RequestContextCreateSkin hook to allow extensions to override the loading of skins. 2012-01-03 01:58:27 +00:00
Sam Reed
6c507f38c0 Followup r106619, mark said method public due to callers 2011-12-19 19:07:18 +00:00
Sam Reed
8126793bbf @private is a lie, based on usage, it'd need to be at least protected
Removing useless documentation replacing with param/return doc
2011-12-19 01:07:30 +00:00
Jeroen De Dauw
c65cceab1f doc++ 2011-12-18 21:29:41 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Daniel Friesen
b9e1326d30 Add missing @since tags for getLanguage and deal with this sanitizeLangCode fatal that no-one bothered to fix. 2011-12-05 18:56:09 +00:00
John Du Hart
51a6eadec1 Followup r103817, updating setLang usages 2011-11-23 10:28:21 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Sam Reed
450814de00 More documentation updates 2011-10-28 18:11:47 +00:00
Alexandre Emsenhuber
b212bace90 Per Nikerabbit's comment on r100621:
* Removed OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() and make OutputPage::setPageTitle() and OutputPage::setHTMLTitle() accept a Message object
* Updated core calls (including some that I missed last time because of non-matching case)
* Added Message::setContext() and use it in RequestContext so that I don't need to duplicate the call in OutputPage
* Yes, I'm calling $this->msg() on places and then setting the context one more time in OutputPage::setPageTitle() or OutputPage::setHTMLTitle(), but at least I won't be confused about which objects $
2011-10-27 20:23:16 +00:00
Sam Reed
f6300aaeae Leave a fixme comment on context stuff 2011-10-26 04:15:54 +00:00
Platonides
97ab876991 Fix fatal: Fatal error: func_get_args(): Can't be used as a function parameter in includes/context/ContextSource.php on line 121 2011-10-21 22:18:02 +00:00
Daniel Friesen
8dfa97ff0a Separate RequestContext.php into separate files inside of context/
Update the AutoLoader too. This is also a follow up to r97161 since I forgot to add the AutoLoader line.
2011-09-15 17:42:17 +00:00