Commit graph

214 commits

Author SHA1 Message Date
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
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
Chad Horohoe
c8eb28b2b3 Revert r88648 per CR 2011-06-02 20:15:00 +00:00
Platonides
eeb16a279e Close wfProfileIn
Exit point missed by r85204
2011-06-02 15:39:24 +00:00
Tim Starling
ff1dc8a175 HipHop improvements:
* Added the ability to compile extensions. The build process is bootstrapped by running MediaWiki in interpreted mode. Extension setup file inclusions are slightly modified in a way that makes them register themselves for compilation. Then the same LocalSettings.php uses the compiled extension setup file when the compiled binary runs.
* Tested with Cite and ParserFunctions. The code which lets you have an extensions directory in a place other than $IP/../extensions is untested.
* Simplified WebStart.php slightly by using a custom $_SERVER variable to mark compiled mode. It will break if you don't use the supplied server.conf, but that will break a lot of things so don't do that.
* Fixed the core web entry points to include WebStart.php in compiled mode instead of interpreted.
* Made the build directory configurable. This is mostly so that I can grep the source tree without seeing loads of generated C++.
* In server.conf, added a rewrite rule allowing a /wiki/$1 article path.
* Removed server.conf log file location "/dev/stdout", breaks when you switch user
* Disable static content cache, breaks horribly when you set SourceRoot to a directory containing 7GB of files.
* Rewrote the run-server script in PHP, mostly to support the configurable build directory feature.
* Added an option to the run-server script to allow running in interpreted (hphpi) mode.
2011-05-30 13:49:09 +00:00
Chad Horohoe
0bafff5109 Misc. exception handling cleanup--moved it out of global function namespace
Also removed htmlHeader() and htmlFooter() since it has zero callers anywhere.
Not sure why useOutputPage() was checking isArticleRelated(), we should be able do use it with other stuff too
2011-05-30 00:18:10 +00:00
Tim Starling
4c63ef444a Some HipHop fixes:
* Scan the C++ for volatile classes and show a warning with a list of them
* Fixed volatile classes Revision, CoreLinkFunctions and FileRepoStatus, made them non-volatile by patching the referring code
* Added some configuration for the build process to DefaultSettings.php. 
* Split a few functions off MakeHipHop::execute()
* Only include UtfNormalDefines.php in interpreted mode, since in compiled mode, the constants exist from startup
* Apparently HipHop does not support set_exception_handler(). Added a try/catch block around the main part of index.php instead.
* Fixed ini_get() dependencies in Special:Upload. Upload now works, if you disable ZipDirectoryReader.
2011-05-27 06:25:21 +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
Alexandre Emsenhuber
8f143934ec exit -> return now that we are in a function 2011-05-23 16:37:56 +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
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
Tim Starling
6fec4e3fde Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks HipHop support. 2011-05-15 13:21:16 +00:00
Happy-melon
7055add799 Centralise the minimum-required-php-version in a MW_MIN_PHP_VERSION constant in Defines.php. This requires loading Defines.php before the PHP4 version checks, so include a big note reminding people not to include anything other than vanilla define() statements in there.
I have a sneaking suspicion that including Defines.php in the entry points might not play nicely with HipHop, but I can't test it (wrong OS).
2011-05-07 15:16:01 +00:00
Happy-melon
068f89d108 Follow-up r85918:
* Clean up the ugly adding-then-removing-then-readding HTML <head> and <body> tags in DBConnectionError, deprecates MWException::htmlBodyOnly()
* Also deprecates MWException::htmlHeader(), removes code duplication since MWException::reportHTML() can safely call wfDie() and get an output format appropriate for the entry point
* Copy a couple of HTML headers (Cache-control, Pragma and Content-type) to the wfDie() implementation.
2011-05-07 14:01:49 +00:00
Chad Horohoe
266f945f75 5.2.3, like we do everywhere else 2011-05-05 22:27:54 +00:00
Happy-melon
400357e90a Follow-up r85929: update MediaWiki::articleFromTitle() calls in extensions (and a few edgecases which were missed in core) 2011-04-17 19:25:30 +00:00
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