Commit graph

197 commits

Author SHA1 Message Date
Happy-melon
938a8eb347 Improvements to handling of 'catastrophic' errors, like unsupported PHP versions, no MySQL functions, no LocalSettings, etc.
* Fix parsing of the three major entry points (index.php, api.php, load.php) back to PHP 4.4.9.  We don't care what happens if you actually try to run these files on old versions, but the entry files need to parse correctly.
* consign /includes/templates/PHP4.php and /includes/templates/NoLocalSettings.php to the fiery pit of hell where they belong.
* Prevent loading of any other files for PHP < 5.  WebStart.php was rendered unparseable in PHP 4 by the introduction of try/catch blocks in r85327.
* Die outright with a pretty error message on PHP < 5.2.3 as well as PHP 4.  All versions of PHP below that throw parse errors of various sorts.
* Reimplement wfDie() to provide an entry-point-dependent die-with-readable-error-message function (for instance, we want a pretty human-readable page in index.php, something wrapped in CSS/JS /*...*/ comment block in load.php, etc).  
* Standardise the appearance of the catastrophic errors thrown at the top of the stack with the ones lower down (exception-within-exception, etc).  There isn't really a way to do this without duplication, AFAICT.
2011-04-12 20:38:16 +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
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
3319058b88 Expand wfShowMaxLagError() into index.php. It was only being called from here and it's pretty non-portable. Doing so reveals that it's safe to move the declaration of $mediaWiki below the maxlag test, which will fractionally improve performance in that instance (partly compensating for having to parse OutputPage as introduced in r85278). 2011-04-03 20:43: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
Alexandre Emsenhuber
82ee110998 Made index.php's profiling cosistent with other entry scripts 2011-04-02 18:59:47 +00:00
Alexandre Emsenhuber
56a0a92abb Fix for r78512: set the default value to "view" for the action parameter 2011-03-06 16:51:56 +00:00
Alexandre Emsenhuber
3b5fc40667 Update copyright year 2011-01-01 12:40:21 +00:00
Bryan Tong Minh
0ff3a40b6e Add main contributors in SpecialVersion to README and index.php as well 2010-12-29 11:57:52 +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
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
Alexandre Emsenhuber
0fdb7455af Use the AutoLoader to load the AjaxDispatcher class 2010-12-08 10:00:25 +00:00
Alexandre Emsenhuber
1343d55200 Removed OutputPage::setEncodings(); its current implementation just converts $wgInputEncoding and $wgOutputEncoding to lowercase but the inclusion of Language.php will set them back to uppercase.
So instead of playing with these variables, let's just remove that function.
2010-12-08 08:03:52 +00:00
Alexandre Emsenhuber
c819104407 * Don't unset $wgTitle if it's null, just let it as is so that the variable is always defined (it is already set to null in in Setup.php). It was added in r12612 when all the code that set $wgTitle was moved in MediaWiki::checkInitialQueries()
* Removed comment that documented a line removed in r45126
2010-12-07 12:35:14 +00:00
Alexandre Emsenhuber
30caa2a8b9 Merged wfDoUpdates() and MediaWiki::doUpdates() in wfDoUpdates(); avoids code duplication 2010-12-07 11:49:13 +00:00
Chad Horohoe
db461a7165 Rm two unused vars 2010-12-06 21:56:07 +00:00
Alexandre Emsenhuber
cb6f556784 * (bug 26253) Removed $wgPostCommitUpdateList
As I said on the bug, this variable is not used since ages
2010-12-06 16:17:43 +00:00
Aryeh Gregor
a6aac77d16 Revert r70960 "AjaxDispatcher, now ~30 lines shorter and not using $_GET or $_POST"
Broke CategoryTree, see code review for the error message.
2010-08-13 21:39:51 +00:00
Chad Horohoe
5806e63383 AjaxDispatcher, now ~30 lines shorter and not using $_GET or $_POST 2010-08-12 14:34:54 +00:00
Chad Horohoe
c9b31e0216 Remove unnecessary require(). Autoloader already handles this 2010-08-09 18:55:09 +00:00
Chad Horohoe
c3ca2c3632 Remove extra linebreak 2010-03-21 14:56:44 +00:00
Aryeh Gregor
f2d8c17bc1 Annual copyright year update 2010-01-01 21:09:14 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Tim Starling
bd8fffe24d Reverted r58646 as per my comments on bug 20554. 2009-12-01 01:55:04 +00:00
Roan Kattouw
1b89cd274a API: (bug 20554) Expose average slave lag (avglag) as well as maxlag. Patch by Sam Reed. 2009-11-06 14:38:55 +00:00
Aaron Schulz
9025f9dc54 reverted r55161 - not needed 2009-08-17 02:25:02 +00:00
Aaron Schulz
7ead47486d Fixed html filecache handling of ?curid urls 2009-08-17 01:54:31 +00:00
Chad Horohoe
0e50b04b03 Handle todo: Mediawiki::initialize() is now called Mediawiki::performRequestForTitle() 2009-07-31 00:56:50 +00:00
Tim Starling
b02dd9c492 Reverted r50065, restInPeace does this since r49684. 2009-05-27 05:32:32 +00:00
Tim Starling
c2433e3be2 Commit master changes on all ajax requests. There's no reason that this should be the responsibility of the callee. Causes annoying bugs when omitted. 2009-04-30 05:28:02 +00:00
Alexandre Emsenhuber
0bf494a1f6 * Added "@file" so that doxygen doesn't attribute the comment to the first instruction
* whitespaces fixes
2009-03-20 12:00:38 +00:00
Aryeh Gregor
ffa193fcb4 Increment years 2009-01-08 01:29:11 +00:00
Aaron Schulz
43c6f33ddb Fix doc comment, sigh 2008-12-28 15:17:21 +00:00
Aaron Schulz
ba77d25db2 FileCache - Leave raw page cache control alone to avoid hits 2008-12-28 15:14:15 +00:00
Aaron Schulz
0dd5d00e67 FileCache tweaks:
* Fix typo self -> MediaWiki
* View updates run on client cache hits
* Removed unneeded $wgOut->disable() call
* Disabled unused output on rawpage cache hits
* Removed redundant checkLastModified()
2008-12-28 15:03:57 +00:00
Aaron Schulz
9b206552ac Opps, forgot to commit this 2008-12-28 14:32:49 +00:00
Aaron Schulz
a7e6cd9d5d * Move filecache hits to faster lower level index.php code
* Disable outputpage after file cache hit, since output was streamed already.
2008-12-27 07:07:16 +00:00
Brion Vibber
a4e2060e45 Revert r44801 "Tweaks from profiling"
Mostly seems to be formatting tweaks, loss of useful debug log output, and mysterious unexplained changes.
If some of these tweaks actually are based on profiling data, please provide details, such as "rearranging this call reduces service time from 80ms to 50ms for client cache hits on my machine" or whatever.
2008-12-23 19:39:00 +00:00
Aaron Schulz
eef9a8cdd7 Tweaks from profiling 2008-12-19 09:21:20 +00:00
Aaron Schulz
b3d0a9767e Whitespace/style consistency 2008-12-09 23:00:28 +00:00
Alexandre Emsenhuber
11a9a8dac4 * (bug 12568) configuration script now produce valid XHTML
* Updated copyright (taken from SpecialVersion.php)
2008-07-20 14:29:04 +00:00
Alexandre Emsenhuber
c44fc31ac7 tweaks:
* group master queries with other queries in "SQL Queries" in profileinfo.php
* end 'main-misc-setup' section before executing ajax requests so that they don't get closed by the profiler for ajax requests.
2008-04-29 16:35:11 +00:00
Tim Starling
fbfb509df5 * Introduced LBFactory -- an abstract class for configuring database load balancers and connecting to foreign DBs.
* Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. 
* Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. 
* Added ForeignDBViaLBRepo, a file repository which uses LBFactory.
* Removed $wgLoadBalancer and $wgAlternateMaster
* Improved the query group concept to allow failover and lag control
* Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each.
* Removed the $fail parameter to getConnection(), obsolete. 
* Removed the useless force() function. 
* Abstracted the replication position interface to allow for future non-MySQL support.
* Rearranged Database.php. Added a few debugging features. 
* Removed ancient benet-specific hack from waitForSlave.php
2008-03-30 09:48:15 +00:00
Brion Vibber
c893cdddd6 Drop some useless parameters to silly methods on the pretty much broken MediaWiki object.
These are just globals, and will never be anything other than the globals, so just use them...
Works around mysterious segfault we started having on some wikis, for no apparent reason, and simplifies ugly code. Sigh.
2008-03-26 18:18:24 +00:00
Alexandre Emsenhuber
e59670fa15 * Document Exception.php
* Pass $wgArticle by reference in MediaWiki::initialize() so that it can be set before executing an action and can be used when throwing an exception.
2008-03-21 16:56:44 +00:00
Alexandre Emsenhuber
88a0e17557 Rewrite a bit the MediaWiki class:
* Document function parameter and undocumented functions
* Move use of global settings to localized one setted in index.php
* fix whitespaces
* Use __METHOD__ instead of hardcoded method names
* Call MediaWiki::articleFromTitle() staticly
2008-03-19 19:55:26 +00:00
Aaron Schulz
e3a39d4803 Whitespace tweak 2008-02-19 21:19:55 +00:00
Niklas Laxström
9021990c13 * Use full path (for example for apc.filters) 2008-02-09 16:24:09 +00:00
Victor Vasiliev
30a45db7c9 Update some copyright dates to 2008 2008-02-04 04:50:55 +00:00