Commit graph

378 commits

Author SHA1 Message Date
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
Brion Vibber
caf1cb4942 adjust whitespace (spaces -> tabs) 2005-08-16 23:19:54 +00:00
Mr. E23
ea2a812e56 Added dummy wfLogProfilingData() to avoid php warnings when profiling is disabled 2005-08-13 13:23:22 +00:00
Tim Starling
7c900a732a profiling improvements and bug fixes 2005-07-25 07:00:20 +00:00
River Tarnell
a14ffdcfb9 allow 'uselang' and 'useskin' to be specified in the URL parameters, with
some obvious effect.
2005-07-24 06:55:45 +00:00
River Tarnell
e4a87e105a implement "action=render" 2005-07-03 04:00:33 +00:00
Tim Starling
1f3284da90 recovering previous behaviour when enotif is switched off 2005-06-25 13:47:18 +00:00
Brion Vibber
8426ece183 * (bug 1805) Initialise $wgContLang before $wgUser 2005-06-16 07:51:45 +00:00
Brion Vibber
cb45389b9c * Remove linkscc table code, no longer used. 2005-05-31 07:21:31 +00:00
Tim Starling
6944ef5b4e forward-ported $wgSkipSkin from REL1_4, with enhancements 2005-05-29 06:18:10 +00:00
Tim Starling
225a20c35a Unconditional inclusion for SpecialPage.php, needed for {{special:whatever}}. Fixed getRedirect() to work with this inclusion order. 2005-05-28 11:49:40 +00:00
Ævar Arnfjörð Bjarmason
992b2c4cc8 * - is not a metacharacter in regular expressions, and ^ can be used to invert
matches within []
2005-05-25 01:36:38 +00:00
Tim Starling
f2e8bd8bf7 Using a different session name for each database, so they don't interfere with each other. This is only significant where several wikis share a domain. 2005-05-14 09:27:24 +00:00
Brion Vibber
dbd3c6183d Add WikiError to standard components now that we're using it more widely (though it's already explicitly included in places it's used so far, such as UserMailer and SpecialImport) 2005-04-27 22:38:51 +00:00
Ævar Arnfjörð Bjarmason
cd57e83bef * Parser.php was being included twice in a row 2005-04-25 12:47:10 +00:00
Tim Starling
66507cbde3 Setup.php-DateFormatter was using a lot of CPU time on the live site. Moved it to on-demand initialisation, with memcached assistance. 2005-04-20 15:42:08 +00:00
Tim Starling
52a4214b20 Smarter, more flexible cache type selection. Moved entire contents of ObjectCache.php to BagOStuff.php, to make way for some more generic code. 2005-04-09 10:30:45 +00:00
Tim Starling
1b76906d65 fixed bug 2005-03-31 12:06:38 +00:00
Magnus Manske
da910c7702 If you call function wfGetIP, it might help to implement it first ;-) 2005-03-31 11:11:37 +00:00
Tim Starling
ce4f1221f1 Adding some validation for IP determination via XFF headers, in preparation for adding ISP proxies to the trusted proxy list, which may occasionally give invalid XFF headers 2005-03-31 09:10:25 +00:00
Tim Starling
ba9ae79212 Fixed efficiency problem with $wgSiteNotice. Introduced wfSiteNotice(), which allows the script to load it on demand instead of on every invocation 2005-03-27 16:56:11 +00:00
Brion Vibber
2de124fdbc * Installation fixes for running under IIS
$_SERVER['REQUEST_URI'] and $_SERVER['SERVER_ADMIN'] aren't set under IIS.
Fall back to $_SERVER['SCRIPT_NAME'] for determining base URL on install.
2005-03-27 06:37:21 +00:00
Brion Vibber
6f5560867c Start removing the Latin-1 hacks. We're going pure UTF-8 for 1.5... 2005-03-26 22:23:48 +00:00
Brion Vibber
9ea27c3141 Don't force edit encoding when LanguageEo.php is loaded; defer until $wgContLang initialization.
This makes editing work on other languages with UI language set to Esperanto in preferences.
2005-03-14 02:00:53 +00:00
Brion Vibber
666d4d5135 Merge changes from 1.4:
* Squid purged defered to outside the db transaction
* Partial redirect goodies
* Compression threadhold on memcached
* setproctitle
* Some other tweaks
2005-03-09 02:02:04 +00:00
Brion Vibber
3caa8e7404 eAccelerator caching support, patches from Jamie Bliss 2005-03-02 01:54:05 +00:00
Brion Vibber
9636a88e1c Clean up experiments for special:data, special:validate, special:geo.
Moving these things to extensions if they are needed in the future.
2005-02-18 11:47:36 +00:00
Jens Frank
22da0bbfde Only include ParserXML when it is being used 2005-01-27 21:46:04 +00:00
Brion Vibber
0defdc6a3e * Skip message cache initialization on raw page view (quick hack)
The MediaWiki:Sitenotice hack as currently written forces message cache initiali
zation early in Setup.php. This adds up to 30% to the runtime on raw page views
and cache hits where no skin output has to be made, and dynamic CSS means we've got a fair amount of raw page views.
2005-01-18 10:16:55 +00:00
Tim Starling
829300bf0a fix for script execution vulnerability 2005-01-17 08:40:08 +00:00
Tim Starling
8844628487 Minor load balancing improvements 2005-01-15 10:11:45 +00:00
Jens Frank
67b0cf6906 Don't load user object from DB when in command line mode. DB might not yet exist 2005-01-15 07:28:33 +00:00
River Tarnell
fe586bbfc2 wgSquidServersNoPurge 2005-01-12 22:45:39 +00:00
Tim Starling
e1b5e3f57f porting site notice feature from REL1_3A 2004-12-23 09:12:58 +00:00
Brion Vibber
64ac6b8e77 Merge SCHEMA_WORK into HEAD. Lots of changes, some things are probably broken:
* Page moves/overwrites are a little iffy
* Compression might not be working right
* Profit!
2004-12-19 08:00:50 +00:00
Brion Vibber
798270581d (bug 454) Merge e-notif 2.00
From http://bugzilla.wikipedia.org/attachment.cgi?id=171&action=view
and extra files from http://www.tgries.de/mw/cvs15+enea200-minus-cvs.tgz

Undid a couple minor bits like the broken changing of minoreditletter.
Have not yet made general corrections/reworkings. Since this changes
the user and watchlist tables, you must run the updaters (installer or
update.php) on an existing database.
2004-12-18 03:47:11 +00:00
Brion Vibber
9169001980 * Fix language selection for upgraded accounts [merge from 1.4] 2004-12-11 09:57:58 +00:00
Brion Vibber
9a2a36ce5e * Defer message cache initialization, shaving a few ms off file cache hits 2004-12-09 05:51:20 +00:00
Zheng Zhu
7bee69578c more fixes for languages with no language files; allow UI customization for all languages. 2004-12-07 20:22:22 +00:00
Zheng Zhu
285d1dc09b fix typo 2004-11-29 15:24:02 +00:00
Tim Starling
5de9529eb1 made connection errors work again 2004-11-29 12:36:43 +00:00
Evan Prodromou
80d9f05b37 Add a system of hooks to allow third-party code to run before, after, or
instead of -- MediaWiki code for particular events (article rollback,
user ban, etc.). Framework is in place; hooks are not yet in place
in the mainline code.
2004-11-27 21:43:06 +00:00
Brion Vibber
c7620a7106 Let the parser cache use the objectcache table if memcached isn't set up,
and enable it by default. This provides significant speedups on medium
to long pages, though for busier sites the garbage collection probably
should be adjusted.
2004-11-22 01:16:44 +00:00
Brion Vibber
f5a1ac6798 Experimental authentication plugin interface. Will require a little bit more work to nail down all requirements. 2004-11-16 05:28:47 +00:00
Brion Vibber
98e82e9c60 Fix opening of session for users visiting with saved password token 2004-11-15 12:54:45 +00:00
Magnus Manske
a0d7248685 XML parser XHTML output 2004-11-03 14:00:08 +00:00
Tim Starling
7d1442e76f Backporting concatenated gzip history compression from SCHEMA_WORK. Also made a few tweaks to the compression script, mainly to make it faster for the purposes of a testing sequence I'm currently running on it. Will report to wikitech-l once testing is done. 2004-10-30 14:39:40 +00:00
Jens Frank
8b44e2c9d4 Add $IP to list of globals, since it is undefined otherwise 2004-10-24 08:29:34 +00:00
Tim Starling
1aa60b1361 Fixing multiple-inclusion problems 2004-10-24 02:13:00 +00:00
Tim Starling
4f4cdf87a3 rm obsolete global 2004-10-23 08:24:24 +00:00
Tim Starling
65c32390e9 comments 2004-09-26 13:41:21 +00:00
Tim Starling
91cf173f4a More informative error message for when the user forgot to move LocalSettings.php. Moved recently-added setup code from index.php to Setup.php where it's meant to be. index.php isn't the only entry point! 2004-09-26 10:41:48 +00:00
Brion Vibber
5537c5b85e Avoid gratuitously breaking configurations: continue to use
$wgLanguageCode in LocalSettings.php, and pass that value on
to $wgContLanguageCode internally.
2004-09-25 10:38:34 +00:00
Brion Vibber
869024bcb4 Adjust some spacing 2004-09-25 10:31:42 +00:00
Brion Vibber
d586617605 Change LanguageEn to be UTF-8 by default. This fixes the problem with
language selection destroying non-ASCII characters when English was selected.
2004-09-25 10:08:42 +00:00
Zheng Zhu
ada3997051 first attempt to support multiple language variants in the MediaWiki: namespace. 2004-09-25 04:15:47 +00:00
Zheng Zhu
32c223e2a1 removed caching of UI messages; it does not make sense, after all. 2004-09-25 02:23:04 +00:00
Zheng Zhu
f84493db51 First batch of files modified to switch wgLang to wgContLang. 2004-09-24 13:14:52 +00:00
Zheng Zhu
f30cb1cb19 updated warning about the UI switching code. 2004-09-24 00:49:00 +00:00
Zheng Zhu
6d10e85a52 Changed installation code so that wgContLanguageCode is set, replacing wgLanguageCode. 2004-09-24 00:34:13 +00:00
Zheng Zhu
9b826b9bf7 passing the language object in as parameter when initializing the message cache 2004-09-24 00:09:42 +00:00
Antoine Musso
be32b5b23f fix php notices about call-time by reference 2004-09-22 22:03:24 +00:00
Brion Vibber
36281e4c45 If $_SERVER['REMOTE_ADDR'] is not set, use 127.0.0.1 for $wgIP.
This avoids an E_NOTIFY-level warning and avoids having the empty
string set for the IP when running from CLI.
2004-09-22 11:39:30 +00:00
Zheng Zhu
ca7619c81c made some more wfMsg() to wfMsgForContent changes 2004-09-22 04:09:31 +00:00
Zheng Zhu
cc632696ba Adding a wgContLang object to handle message translation for the content of the site; wgLang should be used exclusively for UI messages. 2004-09-22 03:32:56 +00:00
Wil Mahan
b446574011 Bug 506: use $_SERVER[] instead of getenv() because the latter doesn't work
on IIS in ISAPI mode.
2004-09-20 21:53:21 +00:00
Antoine Musso
f8c9827902 Patch to only load $msgAllMessages instead of replacing the language object.
It's slow as the language object constructor is called twice.
See: http://bugzilla.wikipedia.org/show_bug.cgi?id=184
2004-09-08 13:32:13 +00:00
Brion Vibber
7c8905fa12 Add $wgUserLanguages array to specify which languages users are allowed
to select for the user interface. If this is left at the default empty
array the selection is disabled.

Currently the language selection is broken and will fail for many
cases, using bogus namespaces and probably corrupting your database
with bogus links, search index updates, and more.
2004-09-08 07:35:00 +00:00
Antoine Musso
f62712647b Registered user can set their own language for the interface. See http://bugzilla.wikipedia.org/show_bug.cgi?id=184 2004-09-08 03:39:32 +00:00
Tim Starling
a7e4f89cb4 Stub language file for zh-tw, changing Setup.php and Language.php to allow for languages with hyphens in their code 2004-09-05 06:17:37 +00:00
Antoine Musso
ba2afcd9fa Split files and classes in different packages for phpdocumentor. I probably changed some double quotes to single and used function foo () { shema 2004-09-03 23:00:01 +00:00
Antoine Musso
90155b8a97 Changing comments layout preparing for generated documentation with Phpdocumentor 2004-09-02 23:28:24 +00:00
Jens Frank
85bfd4f375 ENH#169: Provide plugin interface for skins. See also module "sampleskin" in extensions. 2004-08-27 05:23:52 +00:00
Antoine Musso
3d60242fb5 massive double to single quotes conversion. I have not noticed any bug after a lot of testing 2004-08-22 17:24:50 +00:00
Tim Starling
bcb4f2c046 New feature: Turck MMCache shared memory as a lightweight, windows-compatible replacement for memcached 2004-08-21 13:59:48 +00:00
Brion Vibber
2a09429bac Only load memcached-client.php if we're really using it. Saves about 120kb memory when off. 2004-08-21 10:04:30 +00:00
Brion Vibber
dde3967d28 Don't include SearchEngine.php when it's not used. Saves about 180k of memory at runtime. 2004-08-21 09:51:01 +00:00
Brion Vibber
d64197636f Don't load DifferenceEngine.php when not needed. This saves 200-300kb of ram. 2004-08-21 09:32:34 +00:00
Tim Starling
5698c6bcc7 Allowed post-parse link cache to be used for update as well as page view. This involves changes to Article::showArticle() and maintenance/refreshLinks.inc. Fixed various bugs that I noticed along the way. Added an option to recover the old 1.3.x behaviour, for profiling and debugging. 2004-08-14 13:34:57 +00:00
Tim Starling
cd2e8170d2 Ahh, so that's what that does 2004-08-12 06:54:58 +00:00
Brion Vibber
62e98ad47c Suppress some more warnings on separate execution of files. Shouldn't
be anything exploitable, it's just annoying.
2004-08-06 22:30:47 +00:00
Tim Starling
1773cd1e76 * Introducing bit field for database parameters
** Database constructor calling sequence, and Database::newFromParams()
** Including flags in the server initialisation structs
** Support for setting appropriate flags from legacy globals in Setup.php
** Moved some defines to Define.php so that they can be used in LocalSettings.php, most importantly the bit field constants

* Changes related to post-parse link colouring
** Turn the link cache back on when using it for updating the links table
** No longer need to call preFill() on page view

* Better synchronisation of slave servers
** Rearranged getConnection()
** System for beginning and committing transactions when multiple connections are open
** wfAbruptExit() commits transactions, wfErrorExit() does not. Various functions changed to use wfErrorAbort()

* Allowed reporting of database errors during deferred updates by moving them above output()
2004-07-24 07:24:04 +00:00
Tim Starling
ac549401d4 * Support for table name prefixes throughout the code. No support yet for converting static SQL, which also means no installation. But it has been tested by creating the tables in the ordinary way and then renaming them
* DB_WRITE now called DB_MASTER, DB_READ now called DB_SLAVE
* Converted to use SQL wrapper functions instead of direct SQL in various places
* Experimental method for preserving the chronological order of events when slave servers are used. Untested.
* Fixes to the new post-parse existence test feature
* Some.. other stuff
2004-07-18 08:48:43 +00:00
Tim Starling
b96b707efa OOP calling convention for database functions. DBMS abstraction implemented by means of functions instead of global variables, PostgreSQL object converted to a subclass instead of a drop-in replacement. Also the beginnings of a flexible table name feature. 2004-07-10 03:09:26 +00:00
Antoine Musso
232659747d removing useless comment 2004-06-17 16:52:54 +00:00
Antoine Musso
5928a9238b EXPERIMENTAL: Stop requiring skin classes we do not use. Save about 210KB memory for a monobook user, should save more when user use standard. 2004-06-17 16:31:57 +00:00
Tim Starling
b5ef8d221b Bringing the load balancer to the main branch. Still doesn't do much. I needed a DB connection cache for my Article.php alterations, which LoadBalancer provides. 2004-06-15 15:00:54 +00:00
Antoine Musso
16a74059bd recommiting specialpages loading fix as the BoardVote extension as now been fixed 2004-06-12 01:31:00 +00:00
Brion Vibber
e96217fc1c Undo change that stopped Wikipedia from running at all 2004-06-11 23:29:56 +00:00
Antoine Musso
82b207df94 do not instant Special* objects if user is not requesting a special page (save memory / cpu time) 2004-06-11 21:13:51 +00:00
Brion Vibber
9a78bae429 Converted remaining latin-1 localizations to UTF-8 (da/de/es/nl/sv).
For compatibility with existing installations, a latin-1 proxy language
module can be activated by setting $wgUseLatin1 = true; which will convert
messages to Latin-1 and use the Latin-1 support code as necessary.
2004-06-11 02:47:41 +00:00
Antoine Musso
c92a392572 double quotes to single quotes :o) 2004-06-09 01:25:31 +00:00
Antoine Musso
34efa448f5 possible performance enhancement 2004-06-08 02:32:56 +00:00
Tim Starling
876e7e5188 profiling correction 2004-06-06 14:05:07 +00:00
Tim Starling
74dc9fd67a More detail in profiling data 2004-06-04 02:44:58 +00:00
Tim Starling
1da9734e6c Fixed site notice for monobook, displayed site notice for board vote 2004-05-31 08:43:36 +00:00
Tim Starling
e3676a470c Introducing special page modular extensions, making the board vote special page the first of these.
* Moving common special page handling to SpecialPage.php
* Special page lists in the language classes are obsolete, replaced by the list in SpecialPage.php
* Special:Specialpages uses the standard page titles wfMsg(pagename) instead of the description list previously contained in the $wgSpecialPagesEn arrays
* Ability to add custom messages to the MessageCache. Overridable by the MediaWiki namespace.
* Moving board vote functionality from includes/SpecialBoardvote.php to extensions/BoardVote.php
2004-05-15 03:36:39 +00:00
Brion Vibber
762b8e9b47 Allow installing and running the wiki on a server where ini_set has been
disabled via disable_functions in php.ini (bug #928168)

The PHPTal skin doesn't function unless the PEAR bits are in include_path,
so it's disabled if ini_set can't be used. If the files are manually placed
or a real PEAR installation is available with the right stuff, one can
use $wgUsePHPTal = true;

There are likely other things that need to be taken into account for
restricted environments. Maintenance scripts haven't been tweaked for
such an environment yet either.
2004-05-09 10:37:00 +00:00
Brion Vibber
0c2fba0ac4 Add an objectcache table for limited caching when memcached isn't
available. Currently using for the message cache to avoid reading
every message separately. This now is only slightly slower than
memcached in my tests when $wgUseDatabaseMessages is enabled, so
it's a bit of a speedup for common hosts.
2004-05-09 05:12:55 +00:00
Tim Starling
8f22cb45b1 include_once -> require_once 2004-05-07 13:43:10 +00:00
Brion Vibber
eccdcc9b5f Don't load user session in command line mode; this can bork web-based
reinstalls in some circumstances (bug 941461)
2004-05-02 09:06:56 +00:00
Brion Vibber
58ac070b9a Fix unicode case conversion for English/UTF-8 2004-05-01 09:13:17 +00:00
Brion Vibber
020236a408 License selector for installation, to activate the metadata & footer info.
Can select no metadata, GNU FDL, or Creative Commons, which sends off
to the CC remote license engine to pick one.

Not fully tested. CC is returning the wrong icon URL except for public
domain right now. Going out to CC and back loses all other options from
the form.
2004-04-14 06:15:46 +00:00
Tim Starling
48dd60aa13 minor command line mode fixes 2004-03-23 10:15:26 +00:00
Tim Starling
2ca258fd03 * Changed inclusion syntax to allow e.g. {{stub}}
* Split MediaWiki namespace into MediaWiki and Template (requires changes to all language files)
* Purge links to on edit of Template namespace
* General refactoring of purging and cache invalidation code
2004-03-20 15:03:26 +00:00
Brion Vibber
623ca89c8b Save password cookie fixes 2004-03-10 05:21:58 +00:00
Gabriel Wicke
8882b85f4b support for second-tier squids in the ip parsing function 2004-03-08 18:44:20 +00:00
Brion Vibber
014093acc4 More globals and uninitialized variables fixes. Added WebRequest ($wgRequest)
object to encapsulate the handling of get/post variables:

The following grab something out of $_REQUEST. The first parameter is the
variable name and is required. The second is an optional default value:

  $wgRequest->getVal() - any type, returns NULL if no default given
  $wgRequest->getInt() - forced integer, 0 default
  $wgRequest->getText() - runs through $wgLang->recodeInput()
  $wgRequest->getBool() - return true/false
  $wgRequest->getCheck() - returns true if the var is set, even if to ""

$wgRequest strips slashes at initialization if necessary.

Also in this fine object:
  $wgRequest->wasPosted() - returns false if this wasn't a real form post,
    so we can protect against faked submissions in get urls.

There's still plenty of work to do, not everything uses the new functions
yet. To test the strict mode, do define('DEBUG_GLOBALS', 1);
2004-03-08 09:09:35 +00:00
Brion Vibber
9e53bfc81c Imported the register_globals hack from REL1_2. Also starting work on
elimination of the use of import_request_variables (which gives us all
the insecurity of register_globals). Uncomment the define of DEBUG_GLOBALS
in index.php to turn on extra error reporting and trace down use of
uninitialized variables and nassssty globals.

Also rearranged the magic_quotes fixing, may not yet cover everything...
2004-03-08 01:51:32 +00:00
Tim Starling
d48da59e31 Oops, left debug output in 2004-03-06 02:13:59 +00:00
Tim Starling
840dee3ad4 * Fixed magic quotes in $_REQUEST, in Setup.php
* Converted many instances of globals from the query to $_REQUEST
* Renamed near-useless Title::getURL() to Title::getPartialURL()
* Created new Title::getURL(), to replace wfLocalUrl, wfLocalUrlE, wfFullUrl and wfFullUrlE. Replaced most instances throughout the code
* In Parser.php, generalised stripping of <nowiki>, <pre> and <math> to allow more general use such as nesting
* Moved body of Article::preSaveTransform to Parser.php
* Put lots of comments in Title.php
2004-03-06 01:49:16 +00:00
Tim Starling
db41d9ae7c Parser improvements: global variable destruction 2004-02-29 08:43:29 +00:00
Tim Starling
ee73b49007 Split parser from OutputPage into Parser.php, corrected spelling of "suppress", a few other bits and pieces 2004-02-26 13:37:26 +00:00
Brion Vibber
0332f4c598 Fix for compatibility with short_open_tag = Off 2004-02-18 02:15:00 +00:00
Tim Starling
e2f98922df Two blocking features: IP range blocks, and expiry times configurable block-by-block.
Possible issue: uses strtotime(), which is very handy but in English
2004-02-14 12:37:25 +00:00