Alexandre Emsenhuber
cb9edb16df
* Expanded documentation, added GPL header and changed the @author tag to use my real name
...
* Made RequestContext implement IContextSource
* Added ContextSource::msg()
* Made ContextSource fall back to RequestContext::getMain() when there's no context set
2011-07-17 07:47:13 +00:00
Alexandre Emsenhuber
c2710a9635
Added Request::setLang() and RequestContext::setSkin(); the latter will clone the object and set the context on it.
2011-07-09 19:38:58 +00:00
Alexandre Emsenhuber
a04e33dd86
Follow-up r91657: missed this one
2011-07-08 07:02:23 +00:00
Alexandre Emsenhuber
6394ac791b
* Don't use isset() to check only for null
...
* Also pass the Title object in RequestContext::msg()
2011-07-07 17:42:19 +00:00
Alexandre Emsenhuber
efc5144e7a
* Pass the WebRequest object to User::newFromSession() and use it instead of $wgRequest (will still fall back to $wgRequest if not passed or another method to get an User object)
...
* Always call User::newFromSession(), not only when not in CLI mode
* Removed User::$mSkin, unused and not set
2011-07-06 16:42:16 +00:00
Happy-melon
90f04fbb18
Follow-up r89408, r86872: restore IContextSource and ContextSource, to be more carefully reimplemented.
2011-06-27 19:38:30 +00:00
Happy-melon
1c6dcbb71d
Revert r85288 (magic accessors for RequestContext); much more trouble than they're worth.
2011-06-27 19:23:54 +00:00
Sam Reed
98af1534a3
Add setOuput method
2011-06-17 15:07:51 +00:00
Brion Vibber
94c04f7cd1
Provisional revert of r89406, r89414: reference-related warnings need cleanup before applying code like this
...
Per CR http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89406#c17545 :
'Here is a third one: Strict Standards: Only variables should be passed by reference in /www/sandwiki/includes/Wiki.php on line 177 '
Offending bit is this:
- SpecialPageFactory::executePath( $this->context->title, $this->context );
+ SpecialPageFactory::executePath( $this->getTitle(), $this->getContext() );
That function demands reference paramters for $title and $context, which is being violated here where we now pass function return values:
public static function executePath( Title &$title, RequestContext &$context, $including = false ) {
The $title does sometimes get replaced within the function body, but $context does not appear to ever be replaced (its *contents* are modified, which does not require passing by reference)
If replacing it is something it should be doing, then we need to be able to replace it upstream presumably, so $this->getTitle() probably isn't appropriate.
The $context probably should have the reference simply removed.
2011-06-03 18:48:59 +00:00
Happy-melon
295f513e8b
More unpicking of r85288. I think this is all of the magic method calls, but they're very hard to grep for (part of the problem with them!), so let's leave the calls in with a wfDeprecated() for a while...
2011-06-03 11:04:49 +00:00
Happy-melon
6e7eb67b43
Start unpicking r85288 (magic __get() accessor for RequestContext). Instead, bring back some of r86872 (abstract base class for classes providing access to RequestContext methods), which is a more 'classical' solution.
2011-06-03 10:54:13 +00:00
Sam Reed
8bbcf517c2
And even mooore
2011-05-28 16:32:09 +00:00
Jeroen De Dauw
0b54ec0e80
added since tag for people that care about compat
2011-04-29 21:29:20 +00:00
Siebrand Mazeland
02e44a71b0
Revert r86872: Breaks LiquidThreads page moves with the below failure. Threads are lost and nowhere to be found any more.
...
[25-Apr-2011 18:12:45] /wiki/Special:MoveThread/Thread:User_talk:Siebrand/test/One_new_message: Exception: MWNamespace::getTalk does not make any sense for given namespace -1
#0 /www/w/includes/Namespace.php(81): MWNamespace::isMethodValidFor(-1, 'MWNamespace::ge...')
#1 /www/w/includes/WatchedItem.php(73): MWNamespace::getTalk(-1)
#2 /www/w/includes/User.php(2304): WatchedItem->addWatch()
#3 /www/w/includes/actions/WatchAction.php(53): User->addWatch(Object(Title))
#4 /www/w/includes/Action.php(376): WatchAction->onView()
#5 /www/w/extensions/LiquidThreads/classes/Thread.php(115): FormlessAction->execute()
#6 /www/w/extensions/LiquidThreads/classes/Thread.php(435): Thread::create(Object(Article), Object(Article), NULL, 1, 'One new message')
#7 /www/w/extensions/LiquidThreads/classes/Thread.php(414): Thread->leaveTrace('move test', Object(Title), Object(Title))
#8 /www/w/extensions/LiquidThreads/pages/SpecialMoveThread.php(107): Thread->moveToPage(Object(Title), 'move test', true)
#9 [internal function]: SpecialMoveThread->trySubmit(Array)
#10 /www/w/includes/HTMLForm.php(279): call_user_func(Array, Array)
#11 /www/w/includes/HTMLForm.php(228): HTMLForm->trySubmit()
#12 /www/w/includes/HTMLForm.php(242): HTMLForm->tryAuthorizedSubmit()
#13 /www/w/extensions/LiquidThreads/pages/ThreadActionPage.php(37): HTMLForm->show()
#14 /www/w/includes/SpecialPageFactory.php(459): ThreadActionPage->execute('Thread:User_tal...')
#15 /www/w/includes/Wiki.php(252): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#16 /www/w/includes/Wiki.php(98): MediaWiki->handleSpecialCases()
#17 /www/w/index.php(145): MediaWiki->performRequestForTitle(NULL)
#18 {main}
2011-04-25 18:20:53 +00:00
Happy-melon
70bdc008c4
Implement an interface and abstract class to hold the widely-reused get(Request|User|Title|Lang|Skin|Output) accessors for objects acting as a context source. Article is rather messier because both getTitle() and getUser() are in use for other things, and Article::$mTitle is in extremely wide use both within Article.php and outside.
2011-04-25 17:37:43 +00:00
Daniel Friesen
3c48938f9f
Instead of creating an OutputPage and then setting a context start initializing OutputPages 'with' a context and send depreciated calls to extensions directly creating OutputPage instances.
...
Now that we've taken care of the mess of mTitle inside OutputPage and Skin and made RequestContext track Skin instead of $wgUser we don't need the hack in SpecialPage anymore.
2011-04-04 00:37:42 +00:00
Daniel Friesen
ff33175e96
Update index.php and Wiki.php to make better use of the context.
2011-04-04 00:18:33 +00:00
Happy-melon
df5f627e56
Implement magic accessors for RequestContext variables: you can now just call $context->request->stuff(), and that is internally mapped to the get accessor. Rename the private variables to the old $mName syntax: I know that that's "discouraged in new code", but in this case it stops over-clever IDEs highlighting the magic accesses as potential visibility errors and sticking big error tags on them.
2011-04-03 22:09:35 +00:00
Happy-melon
bfdcdd1371
Follow-up r85278, r85240:
...
* Internalise $title in MediaWiki base class
* Fix access fatal in SpecialPage by getting the context from the MediaWiki base class rather than the OutputPage
* Fix a couple of typos in RequestContext which would have thrown errors/fatals if anyone had ever called them.
2011-04-03 21:32:50 +00:00
Daniel Friesen
b185adf24f
Continue with r85240; Move getSkin from User to RequestContext, do it without globals, strip out the non-functional $title related stuff, and update Skin to use a RequestContext.
2011-04-03 12:46:36 +00:00
Daniel Friesen
f14eb05489
Followup r85240; Commit the additional file that was part of that change. ;) this wouldn't have happened if we were using git... seriously!
2011-04-03 11:09:49 +00:00