aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Wiki.php
Commit message (Collapse)AuthorAgeFilesLines
...
* [JobQueue] Optimized JobQueueGroup::pop().Aaron Schulz2013-01-141-30/+13
| | | | | | * This also simplifies MediaWiki::doJobs(). Change-Id: I58ee2313453c64d4e8d91f3a65181aaa9c2e847f
* Reuse the WikiPage object to save a db queryBrian Wolff2013-01-041-2/+12
| | | | | | | | | | | | | | | | | | Early in the request we call Action::getActionName to get the action name for HTMLFileCache to see if the current action is cached. This causes data to be loaded from the WikiPage object stored in the main request context. However, later when we're initializing the Article object, we overwrite that WikiPage object with the one used by the Article object. Later on the WikiPage object has to be re-loaded, and hence the exact same db request is run twice in one request, which seems wasteful. Instead, initialize the Article object using the WikiPage object from the context, in order to save the already loaded data. Change-Id: I292f0d70feb505fae5fa955fd735d85ad3b22fea
* Rewritten $wgAdaptiveMessageCacheNiklas Laxström2012-10-261-3/+0
| | | | | | | | | | | | | | This was developed for translatewiki.net, which has but millions of messages in MediaWiki namespace. To avoid exploding the message cache, not all of them can be loaded. Instead of logging what messages have been requested, now it uses the fact that if the message has not been customised in the site language, there is most likely no reason to load it in any other language either. Change-Id: I6dd81b3858acfd2b73332e46668d46015e99c748
* Fixed the caching of redirects in SquidTim Starling2012-10-171-4/+5
| | | | | | | | | Was accidentally broken in Ie38ae198, where the request URL was compared against the final target title, not the title of the redirect. Also tested squid purges of redirects, since that code presumably hasn't been tested for a while, and committed my very advanced testing framework. Change-Id: Ib2ffe8e109bcc4859e22df5470bddfdb09e67afa
* [JobQueue] Job queue refactoring and generalizing.ASchulz2012-10-161-13/+36
| | | | | | | | | | | | | | * Added support for different queue types and methods for storing queues. * Treat each job type as being on its own queue, at least logically. * Added $wgJobTypeConf to configure queue types for each job type. * Improved the job DB table so that duplicate job checks actually work and are faster. Also improved the method for popping rows of the table. * Disabled duplicate job removal for everything except refreshLinks. The DELETE statements just add DB overhead and are not useful for cheap jobs, especially ones with start/end params (which are unlikely to have exact duplicates). Change-Id: I49824c7fa855fea4ddcac5c9901ece8c2c0101d0
* Update docs for return and exception infoSiebrand Mazeland2012-10-091-0/+1
| | | | | | | * Removed some inline tabs in the process. * IDE fixed some incorrect leading spaces, too. Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
* (bug 29898) Set cookie to force HTTPS from HTTPcsteipp2012-09-211-0/+17
| | | | | | | | Sets a cookie on user login (removed on logout) if wpStickHTTPS was checked, which causes the browser to get a redirect if they visit the HTTP version of the site. Change-Id: I60f44a1062a93d15198edae6674bb3310a148b2d
* Merge "No need to call parseTitle() directly in MediaWiki::__construct()."Demon2012-07-301-1/+0
|\
| * No need to call parseTitle() directly in MediaWiki::__construct().Alexandre Emsenhuber2012-07-191-1/+0
| | | | | | | | | | | | | | | | | | | | We have MediaWiki::getTitle() which will call parseTitle() if needed. That method will be called in MediaWiki::main() when the Title object is really needed. This allows to not have to call parseTitle() when the DB replication lag is higher than the maxlag parameter or on action=ajax requests. Change-Id: Iebca2b3029e95879ea7739367b09c8c37502e71c
* | Reorder methods in the MediaWiki class for better consistency.Alexandre Emsenhuber2012-07-241-86/+86
| | | | | | | | Change-Id: I651606b3d675212891c5075b3114c451810a3ec5
* | Execute jobs on all index.php requests.Alexandre Emsenhuber2012-07-211-18/+18
|/ | | | | | | | | | | | | | The problem is that currently deferred updates are not executed after action=ajax requests or file cache hits. This means that, e.g. ViewCountUpdates are not executed after file cache hits. The code to execute jobs (both deferred updates and job queue) is now in MediaWiki::restInPeace() so that it's also executed after what is mentioned above, and the remaining code of MediaWiki::finalCleanup() is moved directly MediaWiki::main() since that function is only used in one place and it make no sense to keep a method for such little code. Change-Id: I6f511a74c59a2e3653c10bfcff9b0d15118e699f
* Fix comments added in change 10088Liangent2012-06-191-3/+1
| | | | | | | | | | I found my comments in change 10088 is inadequate because we don't have any known squid URLs in Title::getSquidURLs() and we may never want to have... There's no hook there so extensions are unable to add any squid URLs for them (maybe we want one someday? but new extensions shouldn't be using the UnknownAction hook). Change-Id: I44ba376f92776ec6bb32f91beb06f11ebd086fb4
* Big oops - merged to wrong branch.awjrichards2012-06-051-0/+11
| | | | | Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up" This reverts commit ee0d3d330f76b97c451c168dc9b052ee84609b5b
* Revert to arbitrarily old point before initial remote branch creation to ↵awjrichards2012-06-021-11/+0
| | | | | | help clean up Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
* setSquidMaxage() globally if we can purge it, instead of in actions.Liangent2012-06-041-0/+11
| | | | Change-Id: I404c994616eab0902a9e3650c97028e9bcfb22db
* Give a warning when people use $wgArticle. Add's a class that can be used to ↵Brian Wolff2012-02-131-1/+1
| | | | | | | | | | | | | | | | | give warnings for other globals too. See discussion on r111168. Of course no one will see warning because trunk has $wgDeprecationReleaseLimit set to 1.17 by default (<rant>have I mentioned how I don't like that variable. People enable warnings to be *warned* about things. Making it so people won't get warned about things until a couple months after we've decided people should stop using function/interface/etc defeats the purpose of having warnings</rant>) p.s. Wasn't sure if this waranted something in the release notes, I don't think it does (It's just adding a warning) but wasn't sure. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111342
* Revert r111168 (removed of $wgArticle) since it seems that this is too early ↵Alexandre Emsenhuber2012-02-121-0/+7
| | | | | | | for some people; also removed the comment stating the removal was due in 1.20 (might want to be merged in 1.19). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111297
* GOOD BYE $wgArticle!Alexandre Emsenhuber2012-02-101-8/+0
| | | | | | | It was stated that it would be removed in 1.20 and we are in 1.20. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111168
* Please review carefully, I cannot see negative side effects from this patch. ↵Thomas Gries2012-02-051-1/+1
| | | | | | | It gives extensions which use the (depreacted) UnknownAction hook a chance to see the original action= value. This fixes bug 34203 and bug 34161 UnknownAction hook problem: the hook must pass the unknown action to the callee and not the value "nosuchaction" Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110716
* wfTime() -> microtime( true ), no need to use the former which is just a ↵Alexandre Emsenhuber2012-02-031-2/+2
| | | | | | | wrapper to the latter Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110642
* fix doc and var namesJeroen De Dauw2012-01-291-5/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110246
* Unused globalPlatonides2012-01-261-2/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110066
* bug 33646 Badtitle error page now emits a 400 HTTP status.Antoine Musso2012-01-251-2/+2
| | | | | | | | | | | | | Sending a 200 OK status on bad title, prevents mobile browsers to actually now the page is an error page. Tested using: curl -I http://localhost/wiki/\]\] curl -I http://localhost/wiki/Special:BadTitle Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110001
* [Action] Fix action=ajaxKrinkle2012-01-211-6/+14
| | | | | | | | | * Move Ajax stuff to before regular title/page action handling. Ajax actions circumvent most stuff and return early from the regular execution. * Needed because getAction / Action-classes can't handle action=ajax properly, which isn't until MediaWiki::performAction * Also undo's debug 'true' in the if-statement from r109688 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109689
* [Wiki.php] Minor clean upKrinkle2012-01-211-10/+12
| | | | | | | | | * Comment syntax consistency * Re-use saved getTitle() * Doing in separate commit for review ease Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109688
* Reinstate r109223 per CR + fixesKrinkle2012-01-211-48/+7
| | | | | | | | | | | | | | * Action/Context stuff is pretty deeply nested everywhere. * Should be okay now, at last. * Reverts reverting r109243 * Same as r109223, except adding this: + if ( !$context->canUseWikiPage() ) { + return 'view'; + } Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109678
* Reverted r109223 per CRAaron Schulz2012-01-171-7/+48
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109243
* [Actions] Move action logic out of ↵Krinkle2012-01-171-48/+7
| | | | | | | | | | | | MediaWiki::getAction/MediaWiki::performAction into Action::getActionName. * Follows-up r109195 * Reverts/Redoes r108342, r108343, r108345 * Contributes to solution of bug 27930 - Ability to get current action (The Right Way) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109223
* [Actions] Move the remaining actions out of MediaWiki::performAction into ↵Krinkle2012-01-171-39/+4
| | | | | | | | | | | | | single action classes (finally). - [Actions] - * I am aware that eventually these classes should be more than just a few lines re-directing control to WikiPage, but I'm keeping these commits as uncontroversial as possible due to feature freeze. Refactor could be done later. * Contributes to solution of bug 27930 - Ablity to get current action (The Right Way) * Final goal: Get the current action without needing access to Wiki.php internals (i.e. with Action::factory in one hand and an instance of IContextSource in the other) * Required for proper fix of r108342/108343 (currently marked FIXME) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/109195
* Reverted r108743 per CR comment. This should at least be discussed first.Aaron Schulz2012-01-121-0/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108745
* Kill "* @return void"Sam Reed2012-01-121-2/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108743
* DocumentationSam Reed2012-01-121-0/+12
| | | | | | | Wrap some long lines Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108741
* Apparently we can commit code that doesn't compile but I am not allowed to ↵Niklas Laxström2012-01-111-4/+4
| | | | | | | have commit summary as "){} -> ) {}" Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108661
* Add @since to getPerformedAction, added in r108342Sam Reed2012-01-111-0/+2
| | | | | | | Caused site errors as not in 1.18 when trying to merge r108345 as a followup to r94131 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108632
* Fix typo from r108342.Krinkle2012-01-081-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108346
* Implement MediaWiki::getPerformedAction()Krinkle2012-01-081-2/+27
| | | | | | | | * Fixes: -- Bug 27930 - Ablity to get current action (The Right Way) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108342
* * Added WikiPage to RequestContext and related so that it can be shared to ↵Alexandre Emsenhuber2012-01-061-5/+8
| | | | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108274
* Updated comment since $wgArticle is going to be removed in 1.20.Alexandre Emsenhuber2012-01-021-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107819
* * Inlinise the only usage of $user in MediaWiki::main()Alexandre Emsenhuber2011-12-191-3/+2
| | | | | | | * Change the name of the variable containing the WikiPage object for more consistency Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106660
* Revert r106545 and pass a null variable by ref (also updated the ↵Alexandre Emsenhuber2011-12-181-2/+3
| | | | | | | | | documentation) so that the hook is called at the correct moment and after everything is executed. This is *exactly* the same behaviour as before r88898 since $article was an out parameter to fill $wgArticle correctly. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106563
* followup r88898 -- move BeforeInitialize hook to where it can beMark A. Hershberger2011-12-181-3/+2
| | | | | | | | | | | | | | called in a way that matches the documented parameters As it was, when an extension tried to use BeforeInitialize with the documented parameters this resulted in an exception: Detected bug in an extension! Hook HookFunctionName has invalid call signature; Parameter 2 to HookFunctionName() expected to be a reference, value given Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106545
* w/sMark A. Hershberger2011-12-181-6/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106544
* Get rid of a few more $wgTitlesChad Horohoe2011-12-151-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106336
* added missing deprecation noticesJeroen De Dauw2011-12-131-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106070
* * (bug 32276) Skins were generating output using the internal page title ↵Sam Reed2011-11-281-1/+15
| | | | | | | | | | which would allow anonymous users to determine wheter a page exists, potentially leaking private data. In fact, the curid and oldid request parameters would allow page titles to be enumerated even when they are not guessable. * (bug 32616) action=ajax requests were dispatched to the relevant internal functions without any read permission checks being done. This could lead to data leakage on private wikis. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104505
* Follow-up r102521Platonides2011-11-091-1/+1
| | | | | | | Remove $wgUseExternalEditor globals. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102603
* Some updates to EditPage and ExternalEdit:Alexandre Emsenhuber2011-11-091-14/+7
| | | | | | | | | | | | | * Made ExternalEdit use a context * Updated DifferenceEngine to use ExternalEdit to send the diff stuff to reduce code duplication * Introduced ExternalEdit::useExternalEngine() to check whether to use the external edit or diff (except for the action, section and oldid which are still checked in Wiki.php) to remove code duplication; external diff can now also be controlled with externaledit or internaledit URL parameters * Use $wgContLang to get the name of the "Special" namespace instead of user's language * Modified the line breaks in the comment on the top of the control file so that the URL is on its own line * Updated extension to call EditPage::edit() instead of EditPage::submit(), the latter will just call the former * Updated extension to let core handle itself the ExternalEdit mode instead of doing this themself Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102521
* * Merged Title::userCanRead() check in Title::getUserPermissionsErrors()Alexandre Emsenhuber2011-11-061-8/+15
| | | | | | | | | | | | * (bug 26020) Setting $wgEmailConfirmToEdit to true no longer removes diffs from recent changes feeds * Added second parameter to Title::userCan() and Title::quickUserCan() to allow callers to pass the User object to use for checks; this changes Title::userCan()'s second parameter from "do expensive queries" flag to User, but all callers should have been updated in r102183 * Updated callers that might throw a PermissionsError to use getUserPermissionsErrors() instead and pass the error array to the exception * Refactored duplicate code in missingPermissionError() * Moved Title::isNamespaceProtected() a bit upper and Title::userCanRead() near Title::userCan() to have related functions in the same location * Some minor refactoring in permission-related functions in Title Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102187
* * Made OuputPage::showPermissionsErrorPage() show a different messages for ↵Alexandre Emsenhuber2011-11-051-1/+1
| | | | | | | | | | | | | | 'read', 'edit', 'create' and 'upload' actions to saying "You need to log in to do this action" when 1) The user is not logged in 2) The only error is a permissions error (no block or something else) and 3) The error can simply be avoided by logging in * This replaces OuputPage::loginToUse() functionnality, made it simply throw a PermissionsEror exception and updated all calls in core * Same for the check in SpecialUpload::execute(), EditPage::userNotLoggedInPage() and EditPage::noCreatePermission() * Throw the same exception in EditPage::attemptSave() whether the user is logged in or not and let OuputPage::showPermissionsErrorPage() decide which message to display * Replaced call to deprecated OutputPage::blockedPage() in SpecialUpload * Displayed messages are the same as now, except the title is always "loginreqtitle" * 'nocreatetitle' and 'uploadnologin' messages are still used by extensions, so I kept them, but the message 'whitelistedittitle' is not used anymore and has been removed Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102112
* Make use of Title::isSpecialPage() in various placesAaron Schulz2011-11-021-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101680