Commit graph

387 commits

Author SHA1 Message Date
Alexandre Emsenhuber
bc9d9f1f9c Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent and removed a duplicate comment from SpecialPageFactory.php in SpecialPage.php.

Change-Id: I99dd2de7fe461f2fad4e0bd315ebc2899958a90f
2012-05-10 17:51:44 +02:00
tstarling
42fcd43299 Remove request_with_session/request_without_session
Remove wfIncrStats() calls for request_with_session and
request_without_session. These cause a high load on the profiler and are
not currently needed for performance analysis.

Change-Id: I0ed1e87574c7c9eeaee4e503db86b862ff0995bb
2012-04-10 10:38:07 +10:00
Catrope
458f162b63 Merge "[LanguageConverter] Added some cache code based on the problems in r97512." 2012-04-09 22:25:24 +00:00
Aaron Schulz
0c2a0e4d6b Merged ImageFunctions.php into GlobalFunctions.php
Change-Id: I02d468f9c54a6a0448a6d99505d0201a7949855a
2012-04-06 16:43:27 -07:00
Catrope
edd81d2a5d Implement routing for HTCP purges
This allows HTCP purges for different domains to be sent to different
multicast groups, based on regexes. Mark requested this so we could
separate the multicast groups for upload caches and text caches.

This code is UNTESTED, I'm mostly submitting this as a proof of concept
and to invite review by other core devs (specifically Tim).

Change-Id: Ie333a04131d6ca8394884ed1054f2baff55ab2d1
2012-04-06 15:04:27 -07:00
Aaron Schulz
10f49bd065 [LanguageConverter] Added some cache code based on the problems in r97512.
* Added $wgLanguageConverterCacheType global to control LC cache type. We can use it to enable direct apc use for language converter (to match the live hack).
* Added $wgLangConvMemc object, available via Setup.php

Change 1:
* Updated unit tests
* Minor documentation cleanup in DefaultSettings.php

Change-Id: Icd5dd28407e9759ce294c784ec41d9ca15c89616
2012-04-06 13:26:17 -07:00
Alexandre Emsenhuber
15a4786f2f Make the first line of debug log more consitent between CLI and web call by putting the method and the URL directly on the first line 2012-03-19 20:52:59 +00:00
Alexandre Emsenhuber
73f6907199 * Put the timer stuff after leading line breaks in debug log entries (mainly for the first call on a request) so that they are placed near the remaing text and not on its own line
* Normalise line breaks in the first entry on a web request so that it's consistent with the one for command line requests
2012-03-12 19:01:44 +00:00
John Du Hart
6fd8ea4b3f Followup r105123, fix for MWDebug logging SQL queries on command line mode 2012-02-21 16:48:46 +00:00
Antoine Musso
7488eddb04 revert r111028 (attempt to fix bug 34254)
That patch was obviously wrong, it disabled compression for any
requests *blushes*  :-]
2012-02-12 19:33:52 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Antoine Musso
311bc79c88 (bug 34254) fix gzipped file cache double compressing output
A gzipped file cache is enabled by setting $wgUseGzip and $wgUseFileCache.
To save CPU cycles, HTMLFileCache would print the compressed output as is
but WebStart uses an ob_gzhandler so we end up with a double compression.
2012-02-09 11:02:36 +00:00
Aaron Schulz
67ac87beba Disable $wgDebugToolbar if file cache is turned on, as with $$wgShowIPinHeader 2012-02-07 21:30:41 +00:00
Alexandre Emsenhuber
a172d738eb Recommit r110758 (again) now that the problem has been fixed in r110761 2012-02-06 17:34:33 +00:00
Antoine Musso
5912473690 reverts r110488
Breaks maintenance/rebuildFileCache.php with stack trace saying that
FauxRequest::getRequestURL() not implemented

Backtrace:
#0 includes/WebRequest.php(1261): FauxRequest->notImplemented('FauxRequest::ge...')
#1 includes/debug/Debug.php(266): FauxRequest->getRequestURL()
#2 includes/Skin.php(561): MWDebug::getDebugHTML(Object(RequestContext))
#3 includes/SkinTemplate.php(461): Skin->generateDebugHTML()
#4 includes/OutputPage.php(1982): SkinTemplate->outputPage()
#5 maintenance/rebuildFileCache.php(119): OutputPage->output()
#6 maintenance/doMaintenance.php(105): RebuildFileCache->execute()
#7 maintenance/rebuildFileCache.php(146): require_once('/srv/trunk/main...')
#8 {main}
2012-02-06 16:42:58 +00:00
Alexandre Emsenhuber
4d9259d36d Recommit r109062 (Only run some MWDebug code when really needed) but leaving the addition of ResourceLoader module inside the MWDebug class this time 2012-02-01 15:48:12 +00:00
Aaron Schulz
8d5837cc27 Reverted r109062 per code slush (also has a CR complaint) 2012-01-19 02:26:10 +00:00
Alexandre Emsenhuber
7e16cba902 Only run some MWDebug code when really needed:
* Add the mediawiki.debug module from OutputPage::addDefaultModules() along with other modules
* Get the request information when building the JS output instead of in Setup.php
2012-01-16 21:29:05 +00:00
Antoine Musso
ff39c31a97 Move MWDebug enabling logic to Setup.php
MWDebug initialization method was made to look up for a global variable. This
patch move the logic to Setup.php so we can replicate it when doing tests.

Side effect, MWDebug is disabled by default. Users will explicitly have to
enable it by using init().

Ping r105123
2012-01-16 13:44:46 +00:00
Alexandre Emsenhuber
66587c2574 No need to do the safe_mode check on every request in $wgAdditionalMailParams is set; that variable will not be passed to mail() if safe_mode is enabled since r99411 2012-01-14 14:53:32 +00:00
Niklas Laxström
63407b7112 Revert r107835 - breaks my wiki "unknown function' 2012-01-02 18:26:09 +00:00
Chad Horohoe
cd205aedf1 remove an extra space 2012-01-02 15:34:35 +00:00
Chad Horohoe
e5167d224b simplify r107833 per CR, just use wfExpandUrl() 2012-01-02 15:31:28 +00:00
Chad Horohoe
b582210a4e Revert r107042 (bug 32219, make InstantCommons protocol-relative) and do it properly + release notes.
apibase is used for fetching content from the server as well as determining description pages, so should use a full-qualified protocol when the site's in https.
2012-01-02 14:38:19 +00:00
Raimond Spekking
d3d9c5e40f Make apibase of $wgForeignFileRepos (InstantCommons) protocol relative too 2011-12-22 08:33:37 +00:00
Aaron Schulz
eeb4bd77e1 * FU r106752: de-uglified Setup.php by moving most of the b/c code into FileBackendGroup. Deferred registration of file backends and lock managers to the respective singleton() functions for the group objects.
* Refactored FileRepo::initZones() to require the specific zones; nothing was using it differently.
* Removed deleted zone check in deleteBatch(), a similar error will instead trigger with the initZones() call as needed.
* Added $wgLocalFileRepo comment.
* Updated tests.
2011-12-22 01:06:19 +00:00
Aaron Schulz
53f96171cc FU r106752: use "media-" instead of "images-" in container names. Long live books, video, 3D meshes, and animated holograms from the future! 2011-12-20 23:47:53 +00:00
Aaron Schulz
14863b9aa5 Cleaned up some references to FSRepo in code and comments. This should have no noticeable functional changes. 2011-12-20 19:25:23 +00:00
Aaron Schulz
8bf318d90f FU r106752: Fixed directory b/c for ForeignAPIRepo, which was moved to Setup.php 2011-12-20 07:53:48 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
John Du Hart
0de3082ca4 Adding new debugging toolbar
Needs a UI cleanup still, but for the most part is working.
2011-12-04 18:29:57 +00:00
Bryan Tong Minh
7f61f319ff Per r97671, add $wgEnableAutoRotation setting that can be used to explicitly disable auto-rotation. 2011-10-15 20:30:37 +00:00
Niklas Laxström
d19db48793 Followup r98135
* Added gender parameter to newuserlog-create2-entry
* Hide old comments (for all log types!)
* logentry-newusers-newusers needs a message after all
* Move user tool links away from the action links and drop the User: prefix from create2
2011-09-28 20:28:40 +00:00
Niklas Laxström
5ad4536ef2 Converted display part of new user log to new system 2011-09-26 15:12:44 +00:00
Roan Kattouw
fbc65f8972 Per CR on r44412 and my promise in the commit summary of r94990, stop abusing $wgInternalServer (intended for Squid URLs) for IRC/e-mail URLs and introduce $wgCanonicalServer for these purposes instead. This revision introduces two new hooks for WMF hacks, in exchange for making the core code saner.
* Introduce $wgCanonicalServer, which should typically be a fully qualified version of $wgServer but in practice can be anything that you'd like to be used in IRC/e-mail notifs
** Default value is $wgServer, expanded to http:// if protocol-relative
** This means you can easily set HTTPS as the 'default' protocol to use in IRC and e-mail notifs by setting $wgCanonicalServer to https://example.com
* Introduce Title::getCanonicalURL(). Similar to getInternalURL(), including a hook for WMF usage (which will be needed as long as secure.wikimedia.org is used)
** Also add escapeCanonicalURL(). Due to some ridiculous accident of history, the other escapeFooURL() functions don't have a $variant parameter; I decided not to follow that bad example
* Reinstate the spirit of r44406 and r44412: instead of calling getInternalURL() (or getCanonicalURL()) and regexing the title parameter out, obtain the path to index.php using $wgCanonicalServer . $wgScript and append params to that. Sadly, we need to add a hook here to support the secure server hack for WMF, but that's the price of saner code in this case
* Introduce the {{canonicalurl:}} and {{canonicalurle:}} parser functions, which work just like {{fullurl:}} and {{fullurle:}} except that they use getCanonicalURL() instead of getFullURL()
* Use {{canonicalurl:}} in the enotif_body message, fixing bug 29993 (protocol-relative URLs appear in e-mail notifications)
2011-08-19 11:23:17 +00:00
Alexandre Emsenhuber
2f7f99b1f1 * Don't create a WebRequest obhject in CLI mode but a FauxRequest; avoids some useless notices about headers already sent (I know this is more a PHP silliness, but anyway)
* Added HTTP response code parsing (sending a "HTTP/1.x code" header was throwing a NOTICE about undefined index on the result of the explode() call) and storage; added FauxResponse::getStatusCode() to retrieve it
2011-07-05 15:05:14 +00:00
Tim Starling
9420ff446e Removed $wgProto. Previously, setting this undocumented global variable to anything other than the part of $wgServer before the first colon would cause various things to subtly screw up. Similarly, forgetting to set it when you override $wgServer in LocalSettings.php would break things too.
Exposing it in the default LocalSettings.php as I did in r90105 was not a good solution, really the only way to avoid breakage is to just get the protocol from $wgServer whenever you need the protocol.

Fixed $wgCookieSecure so that it will be enabled automatically if the user sets $wgServer to an https URL in LocalSettings.php. Added documentation for other cookie-related globals.

Grep indicates that $wgProto is not used by any extensions. $wgCookieSecure is used, hence the need for the Setup.php patch.
2011-06-16 05:13:29 +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
Alexandre Emsenhuber
6494121882 Now that Hooks.php contains a class, moved wfRunHooks() definition to GlobalFunctions.php and removed its inclusion from Setup.php 2011-05-28 16:11:40 +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
Brion Vibber
c37da68754 Revert r87964: destroyed standard segregation of non-view action links outside of $wgArticlePath, which would have created huge extra search spider traffic to sites and put more bogus URLs into indexes.
This also reverts some convenience functions that were being added at the same time (??) to attempt to parse local links from JS.
2011-05-23 19:03:17 +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
Antoine Musso
3899d898bd wgIniGetBool -> wfIniGetBool (typo, fu 88391) 2011-05-19 17:23:35 +00:00
Antoine Musso
d8c59f8f0d Makes sure wgAdditionalMailParams is null in safe mode
The global is used for a call to PHP mail() function as a way to add
additional parameters.  This will cause mail() to send E_NOTICE when
using safe mode.

Since we could use the global at different places, it makes sens to
ensure it has a sane value through Setup.php

Follow up r75557
2011-05-18 20:28:44 +00:00
Niklas Laxström
bf947a61f4 Whitespace changes 2011-05-16 09:40:19 +00:00
Rob Lanphier
9e2e94da92 Changing !isset to is_null (thanks Roan!) and fixing some coding style stuff
Followup to r88178
2011-05-15 13:56:12 +00:00
Rob Lanphier
c7999388a4 Setting $wgLocalTZoffset based on $wgLocaltimezone, using code that used to
be in a comment in DefaultSettings.  Pair programmed with hashar.
2011-05-15 13:42:10 +00:00
Tim Starling
69f2c2edee Fix for HipHop breakage in r87748 etc. Please do not use require_once(dirname(__FILE__)...) to fetch class, function or define() dependencies anymore. You do not need to have HipHop to know that doing so will break it. 2011-05-15 13:36:59 +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
Alexandre Emsenhuber
421948c238 Rewrote the article counting code and related:
* (bug 26033, bug 24754) Added $wgArticleCountMethod to have a more flexible way to define which method to use to define if a page is an article or not and deprecated $wgUseCommaCount. There is now a new 'any' method to count any article that is in a content namespace and not a redirect.
* (bug 11868) If using links to count articles, Article::isCountable() will now use the ParserOutput to check if there's a link instead of checking for the "[[" string. Changed Article::isCountable() to take a stdObject or false for the first parameters. If false is passed, the result will be based on the current article's state (i.e. database). The only call outside of the Article class is in DeleteAction (including extensions).
* Removed this horror of Article::$mGoodAdjustment and Article::$mTotalAdjustment, replaced by the new $created parameter on Article::editUpdates(); simplified Article::createUpdates()
* Updated Import.php to take advantage of the new parameter and make a single call to Article::editUpdates()
2011-05-14 17:11:32 +00:00