Commit graph

492 commits

Author SHA1 Message Date
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
Antoine Musso
efd83c55fc merge in prettyURL patch
This is basicly a merge of r84386 & r84491, see their commit messages for
more details.

r84386 makes wikilinks nicer by updating the URL forge implemented by r2621
r84491 fix an issue with the (un)?watch links. getParamValue should not be
used to guess 'title' or 'action'
2011-05-13 11:41:17 +00:00
Alexandre Emsenhuber
f40fb98c10 Moved inclusion of UtfNormalDefines.php near other inclusions 2011-05-10 19:03:23 +00:00
Happy-melon
fd34d0354b * Implement MW_VERSION constant in Defines.php and use it in preference to $wgVersion. Defines.php will have been loaded anywhere that DefaultSettings.php has been loaded.
* Move the declaration of $wgFeedClasses from Defines.php to WebStart.php
2011-05-07 14:53:08 +00:00
Sam Reed
66f31cc203 Kill $wgAllowUserSkin 2011-05-06 23:18:11 +00:00
Alexandre Emsenhuber
0cd07c7ce7 Removed LogPageValidTypes, LogPageLogName, LogPageLogHeader and LogPageActionText hooks. They are deprecated since 1.6 or so. 2011-05-06 18:17:52 +00:00
Chad Horohoe
157466dc55 Kill $wgSkinExtensionFunctions. Way back in r4934 when it was introduced, it was near the beginning of Setup.php, and $wgExtensionFunctions was near the end. Thus, they served two different purposes for doing extension setup. Refactoring over time has brought these processes side-by-side and thus the unused (and less-featured) one is getting the axe.
-1 more awful global \o/
2011-05-05 06:29:33 +00:00
Happy-melon
21813a563c Follow-up r86775: restub $wgLang. Not because it's a good idea, but because I can't see how to avoid the circular dependencies on it *without* stubbing it. Probably easier to just continue the drive to deprecate the global variable altogether. 2011-04-24 10:50:51 +00:00
Happy-melon
c80535ae10 Stop stubbing $wgLang and $wgContLang. There are no major code paths which do not call either $wgLang or $wgContLang at least once. All index.php calls unstub $wgContLang from MediaWiki::parseTitle() except in the edgecase of viewing pages referenced only by "curid=123", and since those will end up calling OutputPage::output() they will eventually be unstubbed at some point as well. All calls through load.php unstub $wgLang in ResourceLoaderContext::getLanguage() from ResouceLoader::respond() --> ResourceLoader::preloadModuleInfo(). All calls through api.php unstub $wgContLang in ApiResult::cleanUpUTF8() from ApiMain::printResult(). 2011-04-23 15:19:38 +00:00
Happy-melon
545d854a39 Documentation and type hinting. 2011-04-23 13:55:27 +00:00
Sam Reed
32e0b59150 Followup r85944, move UtfNormalDefins stuff out of extensions profiling area 2011-04-14 21:21:28 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Sam Reed
d762deeb7b Related to bug 28470 (Doxygen not updating)
Move require_once( MWInit::compiledPath( 'includes/normal/UtfNormalDefines.php' ) ); to Setup.php

Might want relocating in Setup.php though
2011-04-13 13:09:17 +00:00
Brion Vibber
ff0524b3bc Initial stab at breaking math/texvc out to Math extension.
* (bug 14202) $wgUseTeX has been superseded by the Math extension. To re-enable
  math conversion after upgrading, obtain the Math extension from SVN or from
  http://www.mediawiki.org/wiki/Extension:Math and add to LocalSettings.php:
  require_once "$IP/extensions/Math/Math.php";

This is an initial stab, and a few things remain to be cleaned up:
* messages need to be moved from core to extension
* MW_MATH_* constants should be moved to the extension from core
* old back-compat math names interfaces using those constants should be removed from message files
* classic edit toolbar's math button should be added from the extension (or else dropped) -- currently there's not a clean hook, but could do it by JS
* couple of things like the 'armourMath' function on Language & LanguageConverter may want to be redone just as an unconditional, if that's simpler.

Setting $wgUseTeX alone will no longer have any affect. The var's still there for the moment as a few bits still need to be fully moved out from core.
2011-04-09 00:39:40 +00:00
Alexandre Emsenhuber
45339d4d54 No need to force inclusion of Namespace.php since r85327 2011-04-08 07:19:26 +00:00
Tim Starling
7bb50c630a The beginnings of HipHop compiled mode support. It works now for parser cache hits.
* Work around HipHop issue 314 (volatile broken) and issue 308 (no compilation detection) by adding some large and ugly compilation detection code to WebStart.php and doMaintenance.php.
* Provide an MW_COMPILED constant which can be used to detect compiled mode throughout the codebase.
* Introduced wfIsHipHop(), which detects either compiled or interpreted mode. Used this to work around unusual eval() return value in eval.php.
* Work around lack of ini_get() in Maintenance.php, by duplicating wfIsHipHop(). 
* In Maintenance::shouldExecute(), accept "include" as an inclusion function name, since all kinds of inclusion give this string in HipHop.
* Introduced new class MWInit, which provides some static functions in the pre-autoloader environment.
* Introduced MWInit::compiledPath(), which provides a relative path for invoking a compiled file, and MWInit::interpretedPath(), which provides an absolute path for interpreting a PHP file. Used these new functions in the appropriate places.
* When we are running compiled code, don't include files which would generate duplicate class, function or constant definitions. Documented the new requirements on the contents of Defines.php and UtfNormalDefines.php.
* In HipHop compiled mode, it's not possible to have executable code in the same file as a class definition. 
  ** Moved MimeMagic initialisation to the constructor.
  ** Moved Namespace.php global variable initialisation to Setup.php.
  ** Moved MemcachedSessions.php initialisation to the caller in GlobalFunctions.php.
  ** Moved Sanitizer.php constants and global variables to static class members. Introduced an accessor function for the attribs regex, as a new place to put code formerly at file level. 
  ** Moved Language.php initialisation of $wgLanguageNames to Language::getLanguageNames(). Removed the global variable, marked "private" since forever.

* In two places: don't use error_log() with type=3 to append to a file, HipHop doesn't support it. Use file_put_contents() with FILE_APPEND instead.
* Work around the terrible breakage of class_exists() by using MWInit::classExists() instead in various places. In WebInstaller::getPageByName(), the class_exists() was marked with a fixme comment already, so I replaced it with an autoloader solution.
2011-04-04 12:59:55 +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
4a0500a514 Follow-up to r85240:
* Don't stub RequestContext.  The chances of us getting away without needing to access *any* of the six major globals is nil, and in the meantime it's screwing up strong function typing and throwing catchable fatals everywhere.  

* Stop stubbing $wgOut.  The only path where we can avoid unstubbing it is if we immediately die due to maxlag overflow, and that's a) a pretty uncommon code path, and b) a DB issue which won't be affected by a tiny bit of extra apache load.  That allows us to do strong typing on function parameters with it, which is a Good Thing (TM).

Also make OutputPage::getContext() private; I'm not convinced that a context belongs here (it's *part of* the context, not a consumer of it), let's work through it a it more before we advertise its existence.
2011-04-03 20:40:27 +00:00
Daniel Friesen
c08158368c Implement the RequestContext class. Some credit to IAlex, ;) other credit for me and that plethora of bugs and hicoughs I had to deal with in impelenting it.
http://www.mediawiki.org/wiki/Requests_for_comment/Context_object (it's little different though)
2011-04-03 10:41:14 +00:00
Sam Reed
f65dde3bf8 Adding some type documentation to some well used globals 2011-03-24 00:48:22 +00:00
Aaron Schulz
91fb54d0f9 Reverted r84386; breakage too severe 2011-03-20 21:30:24 +00:00
Antoine Musso
5da14533aa Makes wikilinks nicer when possible
This patch mostly impact Title:getLocalUrl() with two changes:

1) Abstraction:

$wgActionPath related code is now in Title::resolveActionPath(). It now
interprets query parameters using an array which is easier to read than
playing with a regexp and the evil $matches[].


2) Tweaking:

Change the 7 years old (r2621) URL forge:
  "{$wgScript}?title={$dbkey}&{$query}"
  => /w/index.php?title=FOO&q=2

To a nicer
  "str_replace( '$1', $dbkey, $wgArticlePath )"
  => /wiki/FOO?q=2


Additional changes:

* Parser tests were modified to reflect the changes.
* PHPUnit TitleTest amended to test getLocalUrl() (add more!!)
* When using wgActionPaths, makes sure the 'view' action is a sane default
2011-03-20 14:57:49 +00:00
Brian Wolff
5220bd4fbb If $wgEnotifMinorEdits=false, the enotifminoredits pref does nothing, so put it in $wgHiddenPrefs.
Its confusing to have it as an option, if its disabled, especially since there is no indication to the
user that it is disabled.
2011-03-06 04:13:46 +00:00
Tim Starling
be76d86932 * Rewrote ObjectCache.php to conform to the modern coding style, and to be less convoluted about how CACHE_ANYTHING and CACHE_ACCEL are resolved. Moved most functionality to static members of a new ObjectCache class.
* Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions). 
* Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType. 
* Made all object cache classes derive from BagOStuff. 
* Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension.
* Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches.
* Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used.
* Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff.
* Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB.
* Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches.
* Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff.
* Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class.
* Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore
* Fixed spelling error in MWMemcached: persistant -> persistent
2011-03-03 09:37:37 +00:00
Tim Starling
af04dde290 Start of ObjectCache reorganisation. Moved the object cache files to includes/objectcache/. Split BagOStuff.php into single-class files. 2011-03-03 04:38:17 +00:00
Alexandre Emsenhuber
8e7741c77d Merged retrieval of request URL and header from WebRequest and Setup.php to avoid duplicate code and reduced the number of wfDebug() calls in Setup.php.
The only side effect is that headers name are in uppercase in the debug log.
2011-02-19 13:09:17 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Alexandre Emsenhuber
6504af3998 Stylise Setup.php 2011-01-14 21:42:38 +00:00
Alexandre Emsenhuber
5a8248974d Group settings modifications at the top of the file 2011-01-06 21:00:17 +00:00
Benjamin Lees
180c128d1e Follow-up to r78285: remove blacklisted file types from $wgFileExtensions in Setup.php, rather than in specials/SpecialUpload.php. 2011-01-06 00:12:49 +00:00
Andrew Garrett
25289a20a2 Follow-up to r64937: expand ternary to conditionals because I hate nested ternaries. 2010-12-09 03:12:28 +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
Tim Starling
07bb8ce5b5 Remove some of the rubbish that has been accumulating in the default LocalSettings.php for years, especially code as opposed to configuration data:
* Don't set $IP. The entry point already sets it, so there's no point. Users can still set it if they can figure out a way to do it without breaking things.
* Don't include DefaultSettings.php. Doing that is code, not configuration, and it can easily be done in WebStart/Maintenance. Some non-standard entry points in extensions may be broken by this. That's their fault for being non-standard. Backwards compatibility is preserved thanks to require_once().
* Introduce $wgInvalidateCacheOnLocalSettingsChange, which when set, causes $wgCacheEpoch to be updated in the way that it previously was in the default LocalSettings.php.
* Don't set $wgLocalInterwiki to some nonsense value (possibly including spaces and punctuation in the new installer). It should be only for actual interwiki prefixes. Since most wikis don't have them, I set this to false by default and adjusted the referring code to accept this. 
* Removed the guard for web invocation with $wgCommandLineMode set. This ancient code is redundant with modern protections in doMaintenance.php. 
* In DefaultSettings.php, fixed fold terminator placement near $wgLoadScript
* Add a web entry point guard. That's one piece of code which really is necessary.
2010-12-06 15:00:56 +00:00
Daniel Friesen
3e7309606d Implement $wgFooterIcons to replace copyrightico and poweredbyico with a flexible list of icons that can be customized by extensions, hosting, farms, wikimedia, etc...
Implementations for MonoBook, Vector, and Modern. Modern implementation uses text instead of icons as desired.
2010-12-04 20:55:23 +00:00
Chad Horohoe
82f3f815fa Followup r75753, combine these into one if block 2010-11-01 11:50:00 +00:00
Platonides
638bb68480 Don't increment stats when called from the scripts.
This avoids things like PHPUnit opening a db connection just for this due to the default SqDlBagOStuff.
2010-10-31 22:25:29 +00:00
Alexandre Emsenhuber
4aacac8f7f added @file to the file description header 2010-10-02 07:57:43 +00:00
Platonides
32b3fa74f0 Remove $wgIP global, but add a hook instead.
This allows extensions to "make mediawiki ignore ips completely", as requested earlier today in #mediawiki
2010-09-11 13:45:51 +00:00
Trevor Parscal
ce8f81837c Applied patch for bug #25044 by Niklas Laxström -- THANKS! 2010-09-10 21:51:25 +00:00
Mark A. Hershberger
c5caf7d35e re r72335: forgot to include this 'global' keyword. 2010-09-04 00:18:01 +00:00
Chad Horohoe
985e8971c8 Get rid of StubUser. Constructing a user object isn't quite as intensive as it once was. It actually takes more time using the StubUser (construction + unstub on first call) than just initializing User::newFromSession() from the start. Either way, the real overhead starts when you start calling methods (for the nitpicky, the optimization was only about 20µs. The real gain here was eliminating a StubObject) 2010-08-12 17:10:00 +00:00
Niklas Laxström
053b7dcb15 Followup r70515, commiting forgotten file 2010-08-08 06:36:00 +00:00
Chad Horohoe
46668eb156 Fix for r70571, still have to use $_COOKIE here too, $wgContLang is undefined so far 2010-08-06 21:10:18 +00:00
Chad Horohoe
aa7b63ce83 Cleanup getCookie() and use it all over the place instead of using $_COOKIE directly 2010-08-06 15:00:43 +00:00
Chad Horohoe
631208a3db (bug 24687) Remove spurious require() calls. Everything in StubObject is a class and in the autoloader 2010-08-06 12:12:29 +00:00
Max Semenik
27210dc614 Revert r69291, other references-related problems reported 2010-07-13 18:29:33 +00:00
Max Semenik
dd76bb00c8 Fixed weird unit test failures I experienced after r68544 2010-07-12 11:14:00 +00:00
Chad Horohoe
57f473ad83 Deprecated $wgFileStore in favor of $wgDeletedDirectory. Included b/c code for wikis with $wgFileStore still set 2010-07-04 15:56:46 +00:00
Bryan Tong Minh
3136686db6 (bug 24212) Added MediaWiki:ImagePage.css which is also included on foreign client wikis. 2010-07-02 19:54:46 +00:00
Chad Horohoe
a4393915e2 Merge new-installer branch to trunk
* This is not complete yet, and should not be used outside of testing. Using it on a production database may ruin everything. This is the reason for the second entry point of new-index.php. You've been warned. 
* Known issues are at [[mw:New-installer_issues]]. Please add new items to the list if you find them.
2010-05-07 12:25:01 +00:00
Happy-melon
05879eeb55 Rewrite ajaxwatch.js to use the API watch action, and JQuery. Allows it to be used to asynchronise any watch links, not just the watch tab/links/spinny-starry-thing. Will make it nice and easy to add unwatch links to Special:Watchlist, etc. 2010-04-27 15:09:04 +00:00
Trevor Parscal
6e170eadba Added $wgLocalStylePath global variable, and solved bug #22858 by using this new variable in the Vector skin for the inclusion of skins/vector/csshover.htc. HTC files are not cross-domain friendly, so in production environments where $wgStylePath is set to point to bits.wikimedia.org, this will throw JavaScript errors on the page. By adding this new global, which is identical to $wgStylePath except that it will not become customized when $wgStylePath is, we can ensure that certain files, if needed, are always loaded from the same domain as the site. 2010-04-26 21:02:30 +00:00
Bryan Tong Minh
715e685546 $_SERVER['REQUEST_URI'] is not available using IIS with rewrite rules, so use HTTP_X_ORIGINAL_URL as alternative. 2010-04-11 15:38:58 +00:00
Tim Starling
07b4b0b3fc Fix for r61582: if $wgDebugPrintHttpHeaders is false, don't construct the header string and then throw it away, skip the whole code block and save a few microseconds. 2010-01-29 04:29:26 +00:00
Niklas Laxström
b1e2b87b95 New configuration variables $wgDebugTimestamps and $wgDebugPrintHttpHeaders for controlling debug output.
I find these useful, maybe someone else will too.
2010-01-27 17:21:18 +00:00
Bryan Tong Minh
824b9bcfa8 Upload license preview now uses the API instead of action=ajax 2010-01-13 14:28:48 +00:00
Domas Mituzas
df8ab5b2a7 Add $wgExtensionAssetsPath, to decouple js/css/etc serving from $wgScriptPath 2010-01-10 10:19:25 +00:00
Tim Starling
debf8b2eb0 * Fixed the issue of all date functions throwing E_STRICT on their first call due to the default timezone not being set. Used the same approach as phpMyAdmin: utilise PHP's server timezone detection code (which unconditionally throws E_STRICT) with warnings disabled, and store the result with date_default_timezone_set() to avoid future notices. Avoids the need for warning suppression to be dotted all over the codebase, like r58559.
* (bug 2658) Don't use the TZ environment variable at all. Setting it throws an error in some restricted setups. But using it in PHP 5.1+ doesn't make sense anyway, since you'll get the E_STRICT notice described above whenever PHP tries to access it, because Derick hates environment variables. Use date_default_timezone_set().
* If $wgLocaltimezone is null, use the server's timezone as the default for signatures. This was always the behaviour documented in DefaultSettings.php but has not been the actual behaviour for some time: instead, UTC was used by default.
2010-01-08 01:48:53 +00:00
Tim Starling
7688101426 Removed JS2 work (has been moved to the js2-work branch). Has been lightly tested, should mostly work. Some of the more complicated associated changes are listed below.
* Reverted HttpFunctions.php to r45549 and renamed wgSyncHTTPTimeout back to wgHTTPTimeout
* Edited out the asynchronous features from UploadFromUrl. Made fetchFile() use the curlCopy() function from new-upload r47811 instead of Http::doDownload(). Wrote my own URL validity check to avoid having to use either of the two buggy precedents.
* Removed UploadFromChunk
* Removed chunk upload and background status from ApiUpload.php
* Reverted r54669, use of addScriptClass()
* Left getHeadScripts() in its current location (OutputPage) instead of moving it back to SkinTemplate, just added wikibits.js to it to replace the removed addCoreScripts2Top()
2009-11-26 12:00:36 +00:00
Chad Horohoe
bafecbaf4e (bug 21638) Set hashLevels to 2 like commons, just in case 2009-11-25 18:02:03 +00:00
Alexandre Emsenhuber
9e46328edd Fix for r58652: use tabs for indentation, not spaces :) 2009-11-14 13:16:41 +00:00
Daniel Kinzler
8500fd8005 add a version attribute to the <html> tag if RDFa is used with HTML5 2009-11-13 21:58:39 +00:00
Chad Horohoe
049b8db10b Add new global $wgUseInstantCommons for quick && easy enabling of Commons for 3rd party sites using sane defaults 2009-11-06 15:38:47 +00:00
Bryan Tong Minh
91e4d80448 Rewrote Special:Upload to allow easier extension. Mostly backwards compatible towards the end user: tested with Commons' upload scripts.
* Special:Upload now uses HTMLForm for form generation
* Upload errors that can be solved by changing the filename now do not require reuploading.
2009-10-18 19:41:01 +00:00
Chad Horohoe
c319cc8968 (bug 13750) $wgCapitalLinks should be a per-namespace setting 2009-10-09 12:52:16 +00:00
Michael Dale
3d958564ec * Enhanced OutputPage to support js2 style javascript without scriptloader enabled
** loadGM output
** unique request id based on wikiTitle revision / file time
* Moved jsAutoLoadClasses to setup.php ( made conditional )
2009-09-17 01:19:02 +00:00
Tim Starling
c59dd84ce9 More useful debug output for CGI 2009-09-15 06:21:49 +00:00
Tim Starling
0603c609e3 Fixes for r51204: removed useless $wgVariant and StubUserVariant. In Skin::makeGlobalVariablesScript(), use $wgContLang->getPreferredVariant() instead, which is the variant used in the relevant server-side code. 2009-09-02 07:19:35 +00:00
Niklas Laxström
4356486697 Always define mwEmbed i18n file. Was not compatible with manual recaching and the performance impact should not matter. 2009-08-11 18:26:14 +00:00
Michael Dale
7dc42bd170 attempt to fix translatewiki script-loader translate issue. 2009-08-11 18:08:12 +00:00
OverlordQ
30e44a06fc Follow up to r54414 and r54356. Hopefully catches all of the edge cases of erroneous input. On a side note, if PHP is configured with too low a limit it can die before it even reaches the code in Setup.php 2009-08-05 01:33:18 +00:00
Benjamin Lees
37a62ba6e1 Followup to r54406: enable/disable functions were being called in the wrong order (thanks, OverlordQ). 2009-08-05 00:59:50 +00:00
Benjamin Lees
69c5d86763 Add missing semicolons 2009-08-04 23:00:30 +00:00
Benjamin Lees
95328fafaf Suppress warnings when trying to raise the memory limit 2009-08-04 22:58:43 +00:00
Chad Horohoe
1d5874a8c7 (bug 16084) Default memory limit should be increased 2009-08-04 02:47:39 +00:00
Brion Vibber
5cf7c777be * (bug 18751) Fix for buggage in profiling setup for some extensions on PHP 5.1
Patch by GreenReaper: http://bug-attachment.wikimedia.org/attachment.cgi?id=6246
2009-07-19 20:21:28 +00:00
Michael Dale
2d5154e634 * addressed r53282#c3209 moved conditional inclusion of $wgExtensionMessages in mwScriptLoader.php to Setup.php
* put a @ in front of get_headers() should hopefully avoid errors where allow_url_fopen=0
* combined $wgPhpCliPath into the similar used $wgPhpCli var
* minor js & example file mwEmbed fixes
2009-07-15 22:41:56 +00:00
Shinjiman
648bfbabc0 * (bug 10837) Introducing the StubUserVariant class to determine the variant variable instead of using this to overrules the user language preference. 2009-05-30 19:49:51 +00:00
Robin Pepermans
45e9b032ec Update per r50782:
* Remove all $wgAllowRealName, check $wgHiddenPrefs instead
* Make $wgAllowUserSkin obsolete too, check $wgHiddenPrefs instead
* And also only call globals if really needed, and remove unused globals
2009-05-24 12:09:15 +00:00
Chad Horohoe
c458e633de (bug 18761) Add setting to hide a list of preferences. 2009-05-19 17:07:46 +00:00
Alexandre Emsenhuber
998f036bec If passing a callback in an array in $wgExtensionFunctions, fix the profile name to not have 'Setup.php-extensions-Array' 2009-05-06 20:02:01 +00:00
Alexandre Emsenhuber
0ec69aed3b * (bug 18009) $wgHooks and $wgExtensionFunctions now support closures
* Whitespaces fixes in includes/Hooks.php
2009-04-06 12:41:20 +00:00
Aaron Schulz
da25eed393 (bug 17180) Disable $wgShowIPinHeader if static caching is enabled 2009-01-27 19:58:26 +00:00
Chad Horohoe
b9987c3c63 (bug 17180) Go ahead and disable $wgShowIPinHeader if we're using $wgUseFileCache. 2009-01-27 19:53:20 +00:00
Brion Vibber
ecf0df92fb Revert r44814 "code style tweaks" -- removal of class_exists check breaks actual maint scripts 2008-12-23 23:34:35 +00:00
Aaron Schulz
7fbd29d170 Code style tweaks 2008-12-19 22:32:36 +00:00
Andrew Garrett
01f9908a0f Configure extension: With DB handler, defer wfConfigureSetup() to a new hook, SetupAfterCache, which, as the name implies, is executed in Setup.php, after caches are initialised.
This avoids some weird issues with Configure and maintenance scripts.
2008-12-10 23:15:50 +00:00
Aaron Schulz
a5b4105921 Tweak check order to be slightly better 2008-12-09 02:55:49 +00:00
Ilmari Karonen
34fb6297cd Step 2 in NS_IMAGE -> NS_FILE transition (bug 44) (WARNING: huge commit).
This is a global search and replace of NS_IMAGE and NS_IMAGE_TALK with NS_FILE and NS_FILE_TALK respectively in all core files, excluding those already updated in step 1 (r44004).
2008-12-01 17:14:30 +00:00
Ilmari Karonen
d247d88f7d (bug 44) make 'Image' and 'Image_talk' compatibility aliases work for all languages, not just English 2008-11-27 20:27:05 +00:00
Tim Starling
90ed80443e (bug 12586) Use wfHostname() everywhere, remove $wguname and $wgNodeName. Use getenv('COMPUTERNAME') on Windows. 2008-10-06 07:30:38 +00:00
Tim Starling
c69d5d46e8 Proposed fix for bug 14944, specifically the reports that some servers do not have en_US.UTF-8. Make the locale configurable via $wgShellLocale. Detect available locales and set $wgShellLocale to an appropriate value on install. Also fixes safe_mode putenv() warnings. RELEASE-NOTES entry will go to 1.13. 2008-09-29 10:19:11 +00:00
Aaron Schulz
e8215b27e4 Add newuser log to core 2008-09-13 00:29:33 +00:00
Chad Horohoe
a469f0dae1 Self-revert 40530, 40531. Too many things still depend on $_GET and $_POST. Needs more cleanup before this can be put in place. 2008-09-08 13:48:07 +00:00
Chad Horohoe
40618e0c3e * Add getCookie() method to WebRequest as a wrapper for $_COOKIE. Updated all instances of $_COOKIE to use this.
* Switch from running fix_magic_quotes() on $_COOKIE and $_GET/$_POST to running it on $this->cookies and $this->data. Should keep us from interfering with other programs that might do the same (and/or trying to start up a second WebRequest object). This partially fixes bug 11558.
* Todo: Do similar things with $_SERVER/$_ENV and switch to a lazy-load style, rather than on every new WebRequest.
2008-09-06 12:38:34 +00:00
Tim Starling
9e103d3dc3 Reverting r40323, as per comments on wikitech-l. Deprecated doesn't mean removed. It doesn't even mean it'll be removed in the future. It just means you shouldn't use it. 2008-09-03 02:28:41 +00:00
Chad Horohoe
85eee307b2 Fully deprecate $wgProxyKey. Has been marked as deprecated since 1.4, but never seems to have been done. Sites with $wgProxyKey set will continue to use the setting (added a fallback in Setup). Fixes bugs 9258 and 12089. 2008-09-02 15:15:54 +00:00
Tim Starling
d3f99b0811 Make it a lot harder to unprotect the MediaWiki namespace. In response to cs.wikinews.org screwup. 2008-08-31 13:03:30 +00:00
Brion Vibber
e2f1a14d9e * $wgAjaxSearch has been removed; use $wgEnableMWSuggest instead.
I never liked the take-over-the-screen UI of the old ajax search; the new suggestion search does the same thing in a more natural, integrated way.
2008-08-20 18:11:59 +00:00
Tim Starling
e3cc5d722f Don't limit setlocale() hack to PHP 5.2.6, as per comment on bug 14944. 2008-08-08 09:37:22 +00:00
Tim Starling
6e0d253f6d Workaround for PHP 5.2.6 escapeshellcmd()/escapeshellarg() bug 2008-08-08 03:32:54 +00:00
Brion Vibber
75b58962c6 Revert r38221, 38238 -- "Add new parser function {{apiurl}}. Also, add new global $wgApiScript because manually constructing the api script's path seemed like a bad idea."
I don't really like this in general; the API isn't meant for the UI and there should be little to no call to link to it from body content.

Additionally, I believe we're trying to move all new parser functions to the convention of using the # prefix to avoid conflict with the template namespace.
2008-07-30 19:45:35 +00:00
Chad Horohoe
5fb49ecb12 Add new parser function {{apiurl}}. Also, add new global $wgApiScript because manually constructing the api script's path seemed like a bad idea. 2008-07-30 07:46:25 +00:00
Chad Horohoe
0775a89d73 Allow $wgCookiePrefix to be set by the user. Default is false which keeps current behavior in Setup. Fixes bug 14843. 2008-07-21 21:51:51 +00:00
Daniel Friesen
48019ed554 Some missing changes for the $wgShared(DB|Prefix|Tables) setup:
* $wgCookiePrefix:
** Shared stuff should always come before local stuff when setting the cookie prefix (by my count, if you set $wgSharedDB and $wgDBprefix with the old order, even though your usertable is shared, your cookies would be local and logins wouldn't be shared right.
** Because the user table isn't always shared anymore, we only want shared code when $wgSharedTables has 'user' set inside of it.
** We now have $wgSharedPrefix, this should also be accounted for in the cookie prefix.
* updaders.inc: The logic for the $doUser test has changed since the conditions that the user table is shared has changed. Now when $shared is true we only want to $doUser when we have a shared database and 'user' is being shared, otherwise if $shared is false, we only want to $doUser when there is no shared database, or 'user' is not being shared.

Check MediaWiki.org's $wgSharedDB documentation for those on 1.12, I'll post a link there to a patch I maintain for 1.12.
2008-06-30 05:16:38 +00:00
Alexandre Emsenhuber
a75a0d0457 Remove call to wfSeedRandom(), this function does nothing 2008-06-23 17:33:41 +00:00
Niklas Laxström
c175d9f886 * Actually use $wgMessageCacheType for the MessageCache 2008-06-17 08:14:33 +00:00
Tim Starling
c6b902f180 * Reorganised the includes directory, creating subdirectories db, parser and specials
* Wrote a tool to check the integrity of the autoloader class list, fixed some issues that came up.
* Start the autoloader before LocalSettings.php, so that when an extension writer thinks an inefficient one-file special page extension is the way to go, they don't have to use explicit includes to make the class inheritance work. Should continue to work with $IP set in LocalSettings.php as long as $IP is set before extensions are included.
2008-06-16 20:21:26 +00:00
Daniel Friesen
b7f509c7b6 Improve UI for Special:Recentchanges and Special:Recentchangeslinked.
* Allow configuration of the default limit and days links with the variables $wgRCLinkLimits and $wgRCLinkDays.
* When selecting a limit and a days on the special pages, if you use a number not within the default list it will be added to the display.
** The selected limit and days is bolded. (This can be considered the first step for bug 3327)
* Optional other configuration option $wgRCFilterByAge, when enabled the list of days will be filtered so that only links within what $wgRCMaxAge says will be stored in the database will be displayed. Note that this is disabled by default because MediaWiki doesn't quite seam to trim out old entries as quickly as $wgRCMaxAge says it should be and some people appear to use the extra 30days links to display older entries even though $wgRCMaxAge is set to 7days on said wiki.

This should also solve bug 9257.
2008-05-17 16:08:34 +00:00
Daniel Friesen
12e47b7f7b Now that I think about it, we're going to have to set $wgSharedPrefix inside of Setup.php so that it can inherit from a $wgDBprefix inside of LocalSettings.php. 2008-05-07 06:05:26 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +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
Tim Starling
b6dba5bcfd * Refactored the parser. See my huge entry in RELEASE-NOTES for details.
* Made it possible to configure the parser class being used, via $wgParserConf.
* Moved defines from the top of Parser.php to either class constants or Defines.php
* Added Parser_DiffTest, a differential parser class for regression testing
* Added Parser_OldPP, a parser class which operates like the parser before this commit. I made one breaking change: a bugfix to avoid losing whitespace when adding MWTEMPLATESECTION markers. 
* Made internal tidy work with PHP 5
* Added the ability to supply a hook for template fetching via ParserOptions. This is handy for testing.
* Updated parserTests.txt to account for the various breaking changes I made. Removed a few parser tests that no longer test for anything useful.
2007-11-20 10:55:08 +00:00
Brion Vibber
9be2c3676a Revert r26281 for the moment. Big patch, changes several existing practices. Will want some public testing and more review before taking it to trunk. 2007-10-01 19:50:25 +00:00
Aaron Schulz
4febfc77c2 *Clean up deletion of revisions and remove some gaps
*Allow blocking of users to hide names
*Implement revision deletion for images/deleted files/deleted revs
*Log deletion set off for now
*Add 'hidden' file dir
*Dissallow merging via undelete (which was inefficient and hard to reverse)
*Use restore points and diffs to special:undelete
*Add a special page to merge pages
*Get changeslist to use tables to avoid ugly formatting
*Add logs into RC for rebuildrecentchanges.php
*Add private logs
*List private logs at specialpages
*Tweak/add some deletion and merge messages
2007-10-01 19:38:28 +00:00
Brion Vibber
983e2d0ff7 * (bug 11355) Fix false positives in Safe Mode and other config detection
when boolean settings are disabled with 'Off' via php_admin_value/php_value
2007-09-17 19:44:15 +00:00
Tim Starling
ca76169bbe * Introduced FileRepoStatus -- result class for file repo operations.
* Ported file delete/restore to the filerepo framework. Some user-visible changes in error reporting. 
* $wgSaveDeletedFiles has been removed, the feature is now enabled unconditionally. Added a "deleted" directory for the default location, protected by a .htaccess file and the practical obscurity of content hashes.
* Fixed bug 2735: "Preview" shown in title bar for action=submit on special pages
* Removed "restore" links from the deletion log embedded in Special:Undelete
* Added img_sha1/oi_sha1 fields, preserved through upload, delete and restore
* Referenced the new oi_metadata etc. fields to preserve metadata across upload and delete/restore.
2007-07-22 14:45:12 +00:00
Brion Vibber
336cb46167 Tweaks to the AJAX license preview:
* Rename 'licence' to 'license' for consistency with the rest of the code.
* The preview code was assuming simple templates with no parameters and no subst:s, which failed on most of the selections used now on Commons. Now doing a full pre-save transform and parse on {{$license}}, just as will be done on the final save.
* When selecting 'None' again after another option, the preview pane is now cleared.

A fun 'todo' might be to also pass the currently selected filename, if any, to the license preview. Some of the templates in use attempt to use the current-page-name variables to include a self-link. At the moment using a hardcoded 'Image:Sample.jpg' for the virtual title on the preview rendering.
2007-07-18 19:19:50 +00:00
Rob Church
1ec212b612 (bug 10520) Preview licences during upload via AJAX 2007-07-14 22:06:01 +00:00
Tim Starling
80991043a9 * De-crappified JS upload dest check feature. Converted to sajax framework. Comprehensive destination checking like the previous behaviour on submission. 500ms typing delay for rate limiting, response cache. Don't display the warning on submission if the user has already seen it via AJAX.
* Added support for static member functions as AJAX callbacks.
* Moved all upload-related javascript to upload.js.
* Needs artwork, see TODO in upload.js.
* Removed UploadForm::showSuccess() as per wikitech-l discussion. Redirect to description page unconditionally.
2007-07-01 18:24:47 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Brion Vibber
13b739ec46 * (bug 10387) Detect and handle '.php5' extension environments at install time
Patch by Edward Z. Yang.
2007-06-28 14:50:06 +00:00
Tim Starling
091367e83d Set initialCapital to $wgCapitalLinks by default for the local repository 2007-06-14 16:33:16 +00:00
Tim Starling
ed4303922f Merged filerepo-work branch:
* Added support for configuration of an arbitrary number of commons-style file repositories.
* Split Image.php into filerepo/File.php and filerepo/LocalFile.php
* Renamed Image::getImagePath() to File::getPath()
* Added initial support for timestamp-based file fetching (OldLocalFile), to be expanded upon by aaron.
* Changed the interface for Image/File object creation: use wfFindFile() or wfLocalFile() depending on semantics
* ImageGallery::add() now accepts a title object as the first parameter
* Moved file handling operations on upload from SpecialUpload to File
* Removed path-related functions from ImageFunctions.php. Removed static path accessors from File. 
* Added a Content-Disposition header to thumb.php output
* Improved thumb.php error handling
* Updated the unit test suite to kind of partially work with modern computers. RunTests.php doesn't work just yet. Fixed an actual regression that the test suite detected -- moved some defines to Defines.php where they will be loaded consistently.
2007-05-30 21:02:32 +00:00
Brion Vibber
d9d553fa98 Fix for regression in variant short-URLs...
Cleaned up the new URL parsing code a bit, now able to recognize both $wgActionPaths and $wgVariantArticlePath and interpolate those variables.
Moved that bit into WebRequest::interpolateTitle() function which is called after $wgContLang stub object is created, so it can be used to get the variant list.
I'm not totally happy with all this code, but it works. The variant bits generally creep me out.
2007-05-17 20:02:59 +00:00
Brion Vibber
358793e47b * (bug 3826) Normalize some invalid cookie name characters when setting
up $wgCookiePrefix. Completes application of patch by Anders Kaseorg.
2007-04-25 18:38:11 +00:00
Brion Vibber
6038f9ed00 * Clean up session checks to better handle the case where the session was
opened during the current request. May help with some caching corner
  cases.
2007-02-05 21:42:48 +00:00
Brion Vibber
0b06a4fffc Revert r19529 ('ajax editors list'); per chat w/ hashar I recommend working on this as an extension for now. It seems pretty modular, and should be an ideal candidate for that. 2007-01-21 03:14:06 +00:00
Antoine Musso
ed8e8e5833 Optional feature : 'Ajax show editors' based on an idea by Tim Starling
Merge from hashar's branch.
2007-01-20 21:05:36 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Brion Vibber
fcd353ad19 * Fix regression with default lock file and cache directories; threw visible
warning with open_basedir
2007-01-09 06:35:18 +00:00
Brion Vibber
984ac2288d * Reduce config file clutter by setting various script and upload paths
based on $IP or $wgScriptPath in Setup.php. They can still be explicitly
  overridden in LocalSettings.php if desired...
2007-01-03 08:41:16 +00:00
Aryeh Gregor
69ea9bcf9b (bug 7169) Use Ajax to watch/unwatch articles. Patch by Dan Li with some modification by me. 2006-12-26 23:53:34 +00:00
Brion Vibber
bab6c59d8b * Add AuthPluginSetup hook to override $wgAuth after configuration 2006-11-30 07:47:34 +00:00
Tim Starling
e174a4ddfb Abolished $wgDBname as a unique wiki identifier, it doesn't work with the new-fangled feature we call "table prefixes". Instead use wfWikiID() for an identifier containing the DB name and the prefix if there is one, and wfMemcKey() for cache key construction.
Caches for wikis with table prefixes will be lost on upgrade, caches for wikis without table prefixes will be preserved. Custom cache keys in extensions can be migrated at leisure. Extensions which write to core cache keys should be migrated ASAP, as I have done with Special:Makesysop.
2006-10-04 09:06:18 +00:00
Brion Vibber
bf63ffaa2c Committed a bunch of live hacks from Wikimedia servers
A few left, but these don't look too evil
2006-10-02 17:04:13 +00:00
Daniel Kinzler
6a64a7eaee Separated ajax search box features from core ajax framework.
Note that ajax search is currently broken (some issue with message parsing)
2006-07-30 10:53:22 +00:00
Tim Starling
3e7155b3db $wgLanguageCode no longer indicates the user language, for that use $wgLang->getCode(). This is necessary because determination of the language code is deferred. 2006-07-26 08:26:51 +00:00
Tim Starling
43b2fb56b6 Merged localisation-work branch:
* Made lines from initialiseMessages() appear as list items during installation
* Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files.
* Introduced "stub global" framework to provide deferred initialisation of core modules. 
* Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point.
* Added DBA cache type, for BDB-style caches. 
* Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases.
* Simplified the initialisation API for LoadBalancer objects.
* Removed the broken altencoding feature.
* Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface.
* Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled.
* Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. 
* Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). 
* Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts.
* Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
Tim Starling
0ade783ae2 Deferred loading of DateFormatter.php and IP.php. Standardised IP.php function naming style. 2006-07-14 17:02:49 +00:00
Tim Starling
8831c8e13d MagicWord initialisation deferred. 2006-07-14 16:36:35 +00:00
Tim Starling
3ea576aa25 Consolidated web initialisation code into includes/WebStart.php. Moved profiling setup to a hook file "StartProfiler.php", following Brion's suggestion to merge Wikimedia's early profiling patch into subversion. Renamed Profiling.php and logProfilingData(), removed unnecessary wfProfileClose() calls. 2006-07-14 05:35:31 +00:00
Antoine Musso
71fd92d760 Migrate IP related tools from ProxyTools.php to IP.php
and its own class of static functions
2006-07-12 18:33:21 +00:00
Brion Vibber
f1344b73c6 * (bug 6562) Removed unmaintained ParserXml.php for now 2006-07-07 06:04:07 +00:00
Rob Church
9131716360 * (bug 6504) Allow configuring session name with $wgSessionName 2006-07-04 04:20:14 +00:00
Tim Starling
2ff288720c Various performance and initialisation issues:
* Made autoloader work for unserialize()
* Made XmlFunctions.php and HttpFunctions.php autoloadable modules, via Http:: and Xml::
* Made Image class autoloadable, global functions moved to ImageFunctions.php where they can be loaded on every invocation.
* Removed some unnecessary require_once() calls
* Deferred $wgValidSkinNames initialisation
* Fixed a couple of silly construct/initialise splits. My idea from C++ experience, bad practice in PHP.
* Deferred skin initialisation in ParserOptions
* Removed $wgMwRedir during an attempt to make MagicWord autoloadable. Didn't complete that, but removing the global is still the right direction.
2006-07-02 15:57:59 +00:00
Tim Starling
d2b2d1e7eb Experimental: use absolute paths in require_once 2006-07-01 07:22:59 +00:00
Brion Vibber
908c51e127 Revert to r15092; massive breakage, unable to connect to MySQL at all 2006-06-27 16:11:47 +00:00
Greg Sabino Mullane
ef89ec541c Add concept of a distinct port separate from a server.
Add some functions to DatabasePostgres.php.
2006-06-27 15:37:35 +00:00
Tim Starling
adaf195148 Defer initialisation of the special page list, allow autoloading of the SpecialPage class. SpecialPage.php is not loaded for ordinary page views. Implemented some interfaces which allow special pages to do the same thing, although backwards compatibility is maintained. Old special page extensions will load SpecialPage during initialisation, so all extensions will have to be ported to get the full performance benefit. 2006-06-25 08:38:17 +00:00
Domas Mituzas
9ed354c5c7 revert back to 14660 2006-06-08 15:12:26 +00:00
Domas Mituzas
7b8c86bdb2 AutoLoad OutputPage, HistoryBlob, Block, MessageCache, move $wgBlobCache to HistoryBlobStub static private. 2006-06-08 14:11:16 +00:00
Domas Mituzas
abd7248709 Autoload Linker, Skin.php, move $wgValidSkinNames to static private at Skin, use Skin::getSkinNames()... 2006-06-08 13:47:38 +00:00
Domas Mituzas
b9dbaffd29 move autoloading up :) 2006-06-08 13:27:11 +00:00
Domas Mituzas
9ff370792b woo, revert the revert, apc 3.0.8 seems to work with this :) 2006-06-08 13:08:22 +00:00
Domas Mituzas
01c5458779 revert r14636, private static arrays seem to crash APC on half of our boxen, will have to investigate (or ask nicely Tim to help there) 2006-06-07 13:58:51 +00:00
Domas Mituzas
d49e267925 autoload Profiling, ParserCache, WebRequest 2006-06-07 12:26:58 +00:00
Domas Mituzas
f8b70b6603 AutoLoad Title.php, move global cache arrays to static Title:: variables 2006-06-07 11:44:10 +00:00
Tim Starling
02547dac72 Removed most exit() calls from the MediaWiki core, by replacing them with either a throw or by classic error checking. OutputPage::fatalError() and similar functions are deprecated, use either OutputPage::showFatalError() to return control or throw new FatalError() to relinquish it. Backwards compatibility of all interfaces has been maintained, thus extensions should continue to work and can be ported at a later date. 2006-06-07 06:40:24 +00:00
Tim Starling
410986abf8 Some initial work on exceptions. More to follow. 2006-06-06 23:07:26 +00:00
Domas Mituzas
1aacbbf476 autoload WikiError 2006-06-06 11:51:31 +00:00
Domas Mituzas
b641266605 AutoLoad LinkCache & LinkBatch 2006-06-06 11:36:38 +00:00
Domas Mituzas
06e4640d8c AutoLoad Article 2006-06-06 11:29:23 +00:00
Domas Mituzas
4c31c13252 Welcome back AutoLoader, this time in small batches :-) 2006-06-06 09:50:01 +00:00
Brion Vibber
0a26267688 Revert to r14512; domas introduced massive breakage with incomplete experimental changes. They will be recommitted when they work. :) 2006-06-01 08:19:02 +00:00
Domas Mituzas
bda0b8e104 Use AutoLoader to load classes:
* remove require_once() throughout whole code, yet left in few places
* move global functions in HttpUtils, ProxyTools, Credits to class methods
* php5 only: __autoload() now used, combined with class->file map and require()
* move initialization of $wgValidSkinNames to Skin::getSkinNames()
* few more changes that will surely break stuff.
2006-06-01 07:22:49 +00:00
Brion Vibber
2fb7f4fdb2 To simplify the lives of extension developers, the logging type arrays can now be appended to directly by an extension setup function. It is no longer necessary to write four separate functions just to add a custom log type.
The old hooks for this are retained for backwards compatibility, but are deprecated.
2006-05-25 07:37:20 +00:00
Brion Vibber
ca311c2e4c * PersistentObject removed; it doesn't do anything and was broken besides.
All extensions using it have been corrected.
2006-04-12 08:32:54 +00:00
Brion Vibber
8b36a801ac Live fix: set $wgNodeName 2006-04-02 04:13:23 +00:00
Tim Starling
3e74cd1359 Allow cookies to be shared between multiple wikis with a shared user database. 2006-02-11 07:41:31 +00:00
Brion Vibber
b380b0a76a * Add ".deps.php" include-file preloaders for some dynamically-loaded
language and skin classes. Should help with the broken base-class
  problem under PHP 5 with APC as opcode cache. See details:
  http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html
2006-01-17 23:43:15 +00:00
Brion Vibber
6adf79ec39 * (bug 3990) Use existing session name if session.auto_start is on
Fixes checks for open sessions, such as the cookie warning on login.
  Patch by Zbigniew Braniecki.
2006-01-15 08:05:28 +00:00
Brion Vibber
266d41f165 * Added wfDie() wrapper, and some manual die(-1), to force the return code
to the shell to return nonzero when we crap out with an error.
2006-01-14 02:49:43 +00:00
Tim Starling
2f49de971c accidentally committed experimental code 2006-01-13 10:29:24 +00:00
Tim Starling
c0dbf45f72 require_once() makes about 20 syscalls in the process of checking if the file has been included before. Moving it outside the loop. 2006-01-13 09:31:51 +00:00
Brion Vibber
86f779f3e9 Temporarily removing Upgrader extension thingy
* including code from DefaultSettings is a no-no
* no release-notes entries for major changes?
* not following code formatting standards
* serial version numbers probably not reliable
* HEAD is our production code; maybe try this separately first?
2006-01-10 20:00:28 +00:00
Magnus Manske
65aa5bab1a New toy: Automatic database upgrades (deactivated by default)
Can create/upgrade database tables for MediaWiki and extensions based on internal version management.
For HOWTO see the beginning of include/Upgrader.php
2006-01-10 12:53:43 +00:00
Brion Vibber
26cc539cac * Skip loading of RecentChange.php except where needed
Moved constants to Define.php; removed unneeded includes until use of RecentChange:: in Article, Log, CheckUser
2006-01-09 21:09:33 +00:00
Tim Starling
3fc92e0c28 removed $wgParserCache, converted to a singleton 2006-01-05 04:26:52 +00:00
Tim Starling
f2a59db33f Removed $wgLinkCache, converted to a singleton. Removed obsolete cruft from LinkCache.php. 2006-01-05 02:05:53 +00:00
Tim Starling
d2adf83131 gave LinkBatch its own file 2006-01-04 23:53:51 +00:00
Tim Starling
837f8137ba Moved stub profiling functions to their own file 2006-01-04 23:17:35 +00:00
Domas Mituzas
b3f01f2070 check if wgProfiler is defined before checking if it is an object
define wfProfileIn/Out only if it was not defined before
2006-01-03 23:38:13 +00:00
Domas Mituzas
e6a511848a allow pre-started Profiler 2006-01-03 10:31:13 +00:00
Tim Starling
93202880e1 arrrggh suppressed fatal 2005-12-30 08:52:45 +00:00
Domas Mituzas
97414f12ee session statistics live patch 2005-12-26 13:08:06 +00:00
Domas Mituzas
214b9a8d40 * move $wgProfiler init to Setup.php
* allow specifying different profiler types
* add ProfilerSimple (that for now just builds in-memory profiling structure,
  may be extended to write it somewhere)
2005-12-24 13:41:05 +00:00
Ævar Arnfjörð Bjarmason
c89ebef38e * require_once 'PersistentObject.php' in the $wg(?:Skin|)ExtensionFunctions loops 2005-12-21 00:13:43 +00:00
Domas Mituzas
ed21293445 AutoAuthenticate hook for external User suppliers 2005-12-20 21:25:54 +00:00
Ævar Arnfjörð Bjarmason
97d93d850c * Use call_user_func( $func ) rather than $func(), like wgHooks and parser hooks 2005-12-14 16:46:27 +00:00
Brion Vibber
0c89efafc4 * (bug 4165) Correct validation for user language selection (data taint) 2005-12-04 10:53:48 +00:00
Tim Starling
55671d7040 Faster IP blocks. Requires schema change. 2005-12-01 10:37:47 +00:00
Tim Starling
9260c3b7ca Deferred initialisation of $wgIP, because it's potentially slow, especially if and when we add the 200 NTL proxies to the trusted XFF list. I was hoping to avoid initialisation altogether for anonymous page views, but that turns out to be difficult because of user_newtalk. It is, however, avoided for action=raw. Tested page view, newtalk, IP registration in history and recentchanges, IP block, autoblock and Special:Version.
Also moved the old proxy scan code from EditPage.php to a more appropriate location in ProxyTools.php.
2005-09-05 02:22:20 +00:00
Ævar Arnfjörð Bjarmason
1877ed135e * No longer passing the name of the language class by reference 2005-08-26 14:05:12 +00:00