aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
Commit message (Collapse)AuthorAgeFilesLines
* index.php: Remove global $mediaWiki variableAdam Wight2022-03-261-3/+0
| | | | | Bug: T294702 Change-Id: I16a9362eacda49e291955423983a9a3157abd120
* docs: Improve entry point documentationTimo Tijhof2020-07-021-2/+2
| | | | | | | | | | | | * Unlink the word "Action" in api.php description, which was unhelpfully being autolinked to the index.php Action baseclass. * Add links in the first sentence to the primary classes involved in their handling so that the "Entry points" overview page includes these links (subsequent sentence/paragraphs require an additional click). Change-Id: Ibe882746ea7753d5d4c90a04f6974ea807122d1c
* In Web entry points, move file scope code into a main functionTim Starling2020-06-251-2/+9
| | | | | | | | | | Avoid leaking local variables into the global scope by accident, by moving the entry point code to a function. In index.php, document the intentional $mediaWiki global so that nobody removes it by accident. Change-Id: Ie1a181ae3ebdda90cd2321f0c1b50e31fb0d586e
* docs: Improve "Entry points" documentation pageTimo Tijhof2020-02-041-14/+15
| | | | | | | | | | | | Turn this into a doc group, and let the descriptions come directly from the files in question. This makes the list easier to maintain, and alsom means that the overview page becomes discoverable whenever one is looking at the entry point file as well. Previously the doc page pointed to the entry points, but not the other way around. This is also fixed. Bug: T244294 Change-Id: I891c5a37e17592edc1136d7367949927121c8bc8
* Make it so that index.php displays something useful if php not installedBrian Wolff2019-11-011-0/+2
| | | | | | | | | | If php is not installed, and index.php is treated as an html file, it will just display "run()", since the rest is eaten up by the <?php pseudo-tag/processing instruction. Add a comment to close that and open a <pre> tag, so users can see the little help text telling them they need to install php Change-Id: Ib23fc9b1464309b7ef31f1c22b5a96bd3d6d2611
* Add MW_REST_API and MW_ENTRY_POINTTim Starling2019-09-031-0/+2
| | | | | | | | | | | | | Define the global constant MW_REST_API in rest.php, by analogy with MW_API. Also generalize this by adding MW_ENTRY_POINT, which contains the entry script name, "cli" or "unknown". This allows tests such as if ( MW_ENTRY_POINT !== 'index' ) which is probably what is really intended by defined('MW_API') in many cases. Change-Id: I24099f4cdd170de17afd6e1bbad67c9b204071fc
* PHPVersionCheck: Remove obsolete load.php code and simplifyTimo Tijhof2018-10-281-1/+1
| | | | | | | | | | | | | * Remove obsolete handling for 'load.php', which no longer uses this check. This hasn't been used for several releases. * Remove the 'entryPoint' parameter in favour of 'format', which it was already a proxy for. * Move the double dirname() logic to mw-config/index.php. Bug: T189966 Change-Id: I343216442475d36e61213900f196ab6ec5f6b747
* build: Updating mediawiki/mediawiki-codesniffer to 15.0.0Umherirrender2018-01-011-2/+1
| | | | | | | | | | | | | Clean up use of @codingStandardsIgnore - @codingStandardsIgnoreFile -> phpcs:ignoreFile - @codingStandardsIgnoreLine -> phpcs:ignore - @codingStandardsIgnoreStart -> phpcs:disable - @codingStandardsIgnoreEnd -> phpcs:enable For phpcs:disable always the necessary sniffs are provided. Some start/end pairs are changed to line ignore Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
* Add Localisation to the links, add the link to Localisation in ↵zppix12016-09-171-1/+1
| | | | | | Languages/Language.php Change-Id: I996d09f38a007195ba9734e13f10611c4ca1242c
* phpcs: Use __DIR__ constant instead of callingumherirrender2015-11-151-0/+2
| | | | | | | | | | Replaced all dirname(__FILE__) by __DIR__ or added @codingStandardsIgnore Found by tests: https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull Change-Id: I90ff10f183ed60175fe580c43d73c0e57fd04234
* Check for dependencies in entry point and Maintenance.phpaude2015-05-231-9/+4
| | | | | | | | | | | | | | | | | | | | | | | This way, if someone tries to install MediaWiki via either web installer or install.php maintenance script, after obtaining from git, they get some useful information on what to do. Put the checks alongside the php version check, as stuff installed via composer (mustache / lightncandy) is used for NoLocalSettings.php and install.php attempts to use logging stuff. Also tried to make PHPVersionError look slightly nicer, with some <h2> elements and more padding for the <p> elements. and centralized this code in one place, as much as possible, for improved ease of maintenance. Bug: T90438 Bug: T88951 Change-Id: Iae4eb42c4266dbe9213c5de8a96fccfbeaa9acb0
* Require PHP >= 5.3.3Kunal Mehta2014-10-301-1/+1
| | | | | Bug: T839 Change-Id: Iac827ef8505ff0653a40e45d759b0f79619351ee
* Use PHP_VERSION constant instead of phpversion() function callChad Horohoe2014-07-091-1/+1
| | | | Change-Id: Ifb3d1bd92d6abaa561e7337b311b4cb10c38a2b6
* Clean up access pointsWaldir Pimenta2014-03-281-3/+0
| | | | | | | | | | | | | * Harmonize spacing * Use // for comments rather than # * Harmonize call style for 'require', 'include' etc. * Add missing profileinfo.php5 * Use "./" for path to api.php in api.php5 (to match other php5 files). * Move documentation related to Setup.php from index.php to WebStart.php * Remove "Initialise common code." comment in api.php (was already remove in most entry points) Change-Id: I8dc4a79fd13cee49e34f250a4039b3666bd42aca
* Remove a few stray $wgTitle commentsChad Horohoe2013-11-221-1/+1
| | | | Change-Id: Idcb9232e641b5f54845408a2a1c1b9fc28f0040b
* index.php: Remove copyright line and use HTTPS url for mediawiki.orgTimo Tijhof2013-09-271-7/+1
| | | | | | | | | | None of the other entry points (or any file for that matter) lists the main MediaWiki copyright holders. This is already in README and SpecialVersion. Afaik there is no special value for index.php to have this as well (plus, it has become outdated and incomplete). Change-Id: Ic3e1ab5b452002160563750fa1537dfbdd66e312
* phpcs: More require/include is not a functionTimo Tijhof2013-05-211-2/+2
| | | | | | | | | | | | | Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81. Also updated usage in text in documentation and the installer LocalSettingsGenerator. Most of them were handled by this regex: - find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$ - replace: $1 $2; Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
* Remove hphpc support and deprecate related functionsTim Starling2013-05-091-5/+1
| | | | | | | | | | | | | | | | | hphpc has been superseded by hhvm, so support for hphpc is no longer needed. * Continue to use Preprocessor_Hash under HipHop since it is still faster under hhvm * Keep $wgCompiledFiles for now, so that wikihiero doesn't give an error before Ic9d1e795 is merged * Migrate the run-server script and associated configuration file to hhvm. Enable EnableStaticContentFromDisk since it doesn't seem ridiculously inefficient at first glance. Run from $IP rather than $IP/.. since hhvm is apparently not picky about sourcing files from outside of the current directory. Change-Id: Ic3e769f1fbad4f7ad26dd819406796fee48c6b45
* Follow up to dirname( __FILE__ ) clean upHoo man2012-08-281-0/+1
| | | | | | | | Remove a trailing whitespace added by me in dirname( __FILE__ ) clean up and add some comments to the PHP version checks (they can't use __DIR__ as they have to run in older PHP versions. Change-Id: I6a7e8cb7dbf384d91dda4d0ecbef7ce588bc3073
* Use __DIR__ instead of dirname( __FILE__ )jeroendedauw2012-08-271-1/+1
| | | | | | We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :) Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
* Various updates needed to bump min php version to 5.3.2Reedy2012-04-161-1/+1
| | | | Change-Id: I22015387e4ac5839a907059086d787f352746886
* Standardize comments, wrap lines at 80 charsChad Horohoe2011-08-051-6/+7
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94000
* Clean up the mess that is wfDie (resolves r85918). wfDie() doesn't exist ↵Chad Horohoe2011-07-061-84/+2
| | | | | | | | | anymore, so don't use it. The only two usages left since r91590 are php version checks for index/load/api.php, and $wgAPIEnabled check in api.php. Consolidate all of the "bailing for invalid version" into PHPVersionError.php. Leaving $wgAPIEnabled as the only user was silly, so just echo and die like wfDie() would've done Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91602
* As discussed in r85918 CR. Move everything from wfIndexMain() at index.php ↵Platonides2011-06-181-93/+2
| | | | | | | | | | to MediaWiki class. This makes index.php compatible again with PHP4 (as in showing a nice error message instead of a parser error), which had been broken in r88959. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90338
* Changed some magic __get method calls to accessors, were throwing noticesAlexandre Emsenhuber2011-06-121-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89934
* * Fix for r89624: fixed logo HTML escapingTim Starling2011-06-071-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89625
* * Restored the page shown when LocalSettings.php is missing to how it was ↵Tim Starling2011-06-071-1/+7
| | | | | | | | | before r85918. That template is a welcome page, not a "catastrophic error". * Fixed attempted remote loading of the logo image in index.php's wfDie(). Use the distributed mediawiki.png instead, that's what it's there for. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89624
* Provisional revert of r89406, r89414: reference-related warnings need ↵Brion Vibber2011-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89430
* Start unpicking r85288 (magic __get() accessor for RequestContext). ↵Happy-melon2011-06-031-2/+2
| | | | | | | Instead, bring back some of r86872 (abstract base class for classes providing access to RequestContext methods), which is a more 'classical' solution. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89406
* Revert r88648 per CRChad Horohoe2011-06-021-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89361
* Close wfProfileInPlatonides2011-06-021-0/+2
| | | | | | | Exit point missed by r85204 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89344
* HipHop improvements:Tim Starling2011-05-301-1/+5
| | | | | | | | | | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89166
* Misc. exception handling cleanup--moved it out of global function namespaceChad Horohoe2011-05-301-1/+1
| | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89144
* Some HipHop fixes:Tim Starling2011-05-271-1/+5
| | | | | | | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88959
* Merged MediaWiki::performRequestForTitle() and ↵Alexandre Emsenhuber2011-05-261-3/+2
| | | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88898
* exit -> return now that we are in a functionAlexandre Emsenhuber2011-05-231-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88648
* Moved MediaWiki::articleFromTitle() to Article::newFromTitle(), this has ↵Alexandre Emsenhuber2011-05-221-1/+1
| | | | | | | nothing to do in the MediaWiki class Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88594
* $wgArticle is deprecated! Possible removal in 1.20 or 1.21!Chad Horohoe2011-05-221-61/+76
| | | | | | | | | | | * 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88588
* Removed configuration storage in the MediaWiki class:Alexandre Emsenhuber2011-05-161-10/+1
| | | | | | | | * 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) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88247
* Revert r87635, r87637, r87639, r87643 (MW_MIN_PHP_VERSION etc.): breaks ↵Tim Starling2011-05-151-8/+7
| | | | | | | HipHop support. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88176
* Centralise the minimum-required-php-version in a MW_MIN_PHP_VERSION constant ↵Happy-melon2011-05-071-7/+8
| | | | | | | | | 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). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87637
* Follow-up r85918:Happy-melon2011-05-071-0/+4
| | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87630
* 5.2.3, like we do everywhere elseChad Horohoe2011-05-051-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87514
* Follow-up r85929: update MediaWiki::articleFromTitle() calls in extensions ↵Happy-melon2011-04-171-1/+1
| | | | | | | (and a few edgecases which were missed in core) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86273
* Improvements to handling of 'catastrophic' errors, like unsupported PHP ↵Happy-melon2011-04-121-2/+82
| | | | | | | | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85918
* Update index.php and Wiki.php to make better use of the context.Daniel Friesen2011-04-041-5/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85301
* Follow-up r85278, r85240:Happy-melon2011-04-031-2/+2
| | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85285
* Expand wfShowMaxLagError() into index.php. It was only being called from ↵Happy-melon2011-04-031-5/+15
| | | | | | | 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). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85280
* Store the WebRequest and OutputPage in the MediaWiki class, don't pass the ↵Happy-melon2011-04-031-5/+5
| | | | | | | global variables in to each function separately. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85271
* Cleanup in Wiki.php and index.php:Happy-melon2011-04-031-7/+11
| | | | | | | | | | * 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85259