Commit graph

239 commits

Author SHA1 Message Date
Alexandre Emsenhuber
f88d921ca2 Fix for r88898: fix variable name 2011-05-26 19:56:42 +00:00
Bryan Tong Minh
9045d4ec3a (bug 27891) Follow-up r72475: destroy the LBFactory singleton before doing any jobs so that jobs do not access the current session while still preserving ChronologyProtector. 2011-05-26 17:11:51 +00:00
Alexandre Emsenhuber
abea84bccd Merged MediaWiki::performRequestForTitle() and MediaWiki::handleSpecialCases() into MediaWiki::performRequest():
* this allows to perform tests in the correct order, i.e. first BadTitle check and then userCanRead()
* the Article object is now returned by the function instead of passed back in pass-by-reference parameter
* Removed the "return false;" when MediaWiki detects a redirect, was causing an useless full execution
2011-05-26 16:41:11 +00:00
Sam Reed
00707e04a6 * (bug 29144) Move action=dublincore and action=creativecommons to extensions
Moved CreativeCommonsRDF out to extension
2011-05-26 00:08:16 +00:00
Sam Reed
27c3b22bff * (bug 29144) Move action=dublincore and action=creativecommons to extensions
Moved dublincore out to extension
2011-05-25 23:55:15 +00:00
Alexandre Emsenhuber
7cc07a65c5 Use $act instead of a second call to $this->getAction() 2011-05-23 17:55:26 +00:00
Alexandre Emsenhuber
076fe2de0d Moved MediaWiki::articleFromTitle() to Article::newFromTitle(), this has nothing to do in the MediaWiki class 2011-05-22 18:38:04 +00:00
Chad Horohoe
3e11266ae5 $wgArticle is deprecated! Possible removal in 1.20 or 1.21!
* Encapsulate index.php in wfIndexMain() (similar to r77873)
* Kill $wgArticle check in Exception, not necessary anymore
* Kill $wgArticle in Setup, also not necessary
* Add angry note about $wgArticle to rebuildFileCache.
* Remove note about $wgArticle in Parser since it's dying anyway
2011-05-22 17:59:47 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Alexandre Emsenhuber
3139582d50 Removed configuration storage in the MediaWiki class:
* It serves no purpose, since to be useful we would need to propagate it to all to all objects called by the MediaWiki class
* It is in the wrong place; the MediaWiki class is an helper class for the index.php script, not the base class for the software (and the class could maybe even be renamed)
2011-05-16 16:46:30 +00:00
Alexandre Emsenhuber
b58ff81f6a Follow-up r86155: also remove revisionmove from MediaWiki::getAction() 2011-05-09 15:57:38 +00:00
Raimond Spekking
6ff27bb8b3 Follow-up r87411: Remove stray f 2011-05-04 17:23:14 +00:00
Paul Copperman
59de997191 Follow-up r87394: Add reference back to MediaWiki::performRequestForTitle per IAlex' comment. 2011-05-04 17:17:27 +00:00
Paul Copperman
9a7c8b1112 Remove references from function parameters in Wiki.php. They aren't needed for objects and sometimes cause warnings when called with non-vars. 2011-05-04 11:50:34 +00:00
Sam Reed
018a22d827 Documentation tweaks, additions and updates 2011-05-01 23:54:41 +00:00
Aaron Schulz
59eb86b8e2 Removed action=print; I can't find anything using this 2011-04-19 05:29:04 +00:00
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Chad Horohoe
efe4525d2c Merge r81448 from REL1_17: reverting RevisionMove feature back out until somebody has the time to work on it again. Reverts r67094 and its followups in trunk: r67099, r67111, r67112, r67115, r67398, r81425, r81427 2011-04-15 23:28:13 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Neil Kandalgaonkar
1165c17e97 followup to r85929 -- missing the break;s for non-default cases. 2011-04-13 05:31:22 +00:00
Happy-melon
e207945f32 Follow-up r85928: back out unrelated changes. 2011-04-12 23:28:23 +00:00
Happy-melon
66e176b153 Implement a $context and getContext/setContext methods for Article (and its subclasses). 2011-04-12 23:00:49 +00:00
Happy-melon
5fc6bb9f16 Fix for catchable fatals thrown on invalid titles, follow-up to miscellaneous Context commit pulled out of a hat (let's go for r85252). We must always have a Title object, even on invalid titles, for the purposes of not melting the Skin. The previous method was to make that a barely-existent half-title from SpecialPage::getTitleFor( 'Badtitle' ), where that is a special page which is not actually defined, but exists in the localisation alias lists. Instead, subclass Title as an explicit BadTitle which we can test for. The badtitle error page, which has empty string for its name in all forms, would probably be quite a good test of our JavaScript error checking. 2011-04-04 23:09:21 +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
Daniel Friesen
93ffe8107c Remove $this->context->output->setTitle( $this->context->title ); calls from Wiki.php, this are unnecessary, OutputPage no longer keeps track of it's own desynchronized mTitle. 2011-04-03 23:47:50 +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
Happy-melon
d6defb9679 Store the WebRequest and OutputPage in the MediaWiki class, don't pass the global variables in to each function separately. 2011-04-03 19:39:39 +00:00
Happy-melon
08e7495043 Cleanup in Wiki.php and index.php:
* Add visibility to MediaWiki::*() methods.
* Refactor out MediaWiki::preliminaryChecks(), was actually just one preliminary check :D
* maxlag is a property of the database, not the wiki, so MediaWiki::checkMaxLag() doesn't belong.  Since it was only called in index.php I just expanded it there, it's only a trivial wrapper anyway.
* Run stylize.php over code.
2011-04-03 15:56:29 +00:00
Brian Wolff
1111518f51 (bug 28242) Make url's of the form http://mediawiki.org/wiki/w:Somewhere_on_pedia give a 301 (permenant) redirect instead of a 302.
This is to make google when indexing a page like http://mediawiki.org/wiki/w:Somewhere_on_pedia to report its target, not the
original url as the url of the page. This only affects urls where the (local) interwiki target is directly in the url.
Pages that contain #Redirect[[w:Somewhere_on_pedia]] will still use 302 (Temporary) redirects since such pages are by
no means permenantly redirected.

Also clarify docs on $wgDisableHardRedirects since the setting confused me.

See also google's spiel on 301 redirects http://www.google.com/support/webmasters/bin/answer.py?answer=93633
2011-03-26 21:06:37 +00:00
Brion Vibber
8226d7e533 * (bug 27761) Fix regression: pages with Esperanto titles containing convertible character sequences became unreachable
Fixes regression from r70871 -- a comparison originally made against the raw GET 'title' variable was changed to use WebRequest::getText() instead, which performs character conversion. This caused infinite redirect loops for titles containing convertible forms such as "ux", which in a recodable field would be round-tripped via "uxx".
This fix changes the comparison to use WebRequest::getVal(), restoring the original direct comparison and avoiding the redirect loops.

(Another nice reminder that this old system with the pseudo charset conversion is obsolete -- it should be replaced with a more modern browser-based input conversion that can apply to all text input fields.)
2011-03-01 21:20:40 +00:00
Alexandre Emsenhuber
03dfa9f60c * Modified Article::loadPageData() to use a slave database connection and pageDataFromTitle() instead of pageDataFromId() in the default case, as in Wiki.php (this also saves a query since the ID will be fetched with other fileds)
* Removed the loadPageData() call for the initial article in Wiki.php, will be triggered by the isRedirect() call 7 lines below if needed (this was not needed if $target is set by the InitializeArticleMaybeRedirect hook), but kept the second one (same as above, Article::exists() triggers Title::getArticleId() that would use one query to get id and a second one is needed to get the complete page data)
* Modified Article::fetchContent() to use common code (loadPageData()) and to only call it if really needed
2011-01-03 19:50:01 +00:00
Alexandre Emsenhuber
fed60b047c Per ^demon, follow-up r78260: introduced MediaWiki::getAction() to get the action that will be executed 2010-12-16 20:11:53 +00:00
Alexandre Emsenhuber
7d6c9314be Moved the check for the "printable" parameter to performRequestForTitle() instead of checkInitialQueries(), I don't know why we need to do this check that early 2010-12-12 18:54:33 +00:00
Alexandre Emsenhuber
6f686426ea Call finalCleanup() after outputting a cached page to run the deferred update list since Article::viewUpdates() adds a SiteStatsUpdate object to that list 2010-12-09 15:59:44 +00:00
Chad Horohoe
db1bd080b6 Per CR, no need for an empty constructor 2010-12-07 20:49:10 +00:00
Alexandre Emsenhuber
1f9be9ead2 Per Nikerabbit, follow-up to r77972: use a string instead of boolean for readability 2010-12-07 15:47:34 +00:00
Alexandre Emsenhuber
30caa2a8b9 Merged wfDoUpdates() and MediaWiki::doUpdates() in wfDoUpdates(); avoids code duplication 2010-12-07 11:49:13 +00:00
Alexandre Emsenhuber
4d3788c0ff Check for the "search" along with other checks to create the Title object. Since this was done after the call to $wgOut->setTitle(), the Title object holded in that instance was incorrect when a such request happened 2010-12-06 17:42:14 +00:00
Mark A. Hershberger
a465346c6e random w/s cleanup 2010-12-01 20:22:45 +00:00
Sam Reed
e76775e06f More unused variables 2010-11-30 18:44:50 +00:00
Alexandre Emsenhuber
0bb158e8d6 Fix for r70871: need explicit check against null since current check also catches "0", thus making an infinite redirect loop for that article 2010-11-10 08:28:26 +00:00
Alexandre Emsenhuber
e514a287e9 * (bug 17996) HTTP redirects are now combined when requesting a special page 2010-11-10 08:22:00 +00:00
Antoine Musso
a94452a820 reinsert some statements removed by r74745
You removed a free() statement in filerepo/LocalRepo.php
In Wiki.php the explicit $ret = null was welcomed
2010-11-06 11:30:21 +00:00
Sam Reed
39c005ca79 bug 25517 Assignment in conditions should be avoided/ http://www.mediawiki.org/wiki/Manual:Coding_conventions#Assignment_expressions 2010-11-01 00:07:17 +00:00
Platonides
eda718909c Remove unused globals. 2010-10-31 15:35:01 +00:00
Philip Tzou
2808a0d43f Follow up r75617. remove extra brackets. 2010-10-28 17:11:21 +00:00
Philip Tzou
e6c51a4143 1. Revert the complicated redirection I made in r59754;
2. Add more Accept-Language XVO cache name for IE;
3. Use hreflang to specify canonical and alternate links, it's search engine friendly
   when a wiki has multiple variant languages.
2010-10-28 16:58:39 +00:00