Commit graph

103 commits

Author SHA1 Message Date
Tim Starling
b1cd1b035c Fixed inefficient use of array_keys() introduced by Nick in r17880. If this is setting off alarms, then fix the alarms. 2006-11-25 17:11:58 +00:00
Nick Jenkins
14c53b728f Code housekeeping stuff (and barring any stuff-ups on my behalf, there should be no changes in behaviour whatsoever after this) -
* removing some unused global declarations.
* removing or commenting out or adding comments for unused local vars.
* Adding one or two local var declarations.
* Declaring $matches array passed to preg_match() / preg_match_all() as array() before using [not required, just have a slight preference for the explicitness].
* remove one or two pass-by-reference function declarations where the value is not modified.
* Adding some braces to if-else blocks.
* In Parser.php, stripstrate is now an object rather than an array as per r17820, so we no longer need ask for a reference to it (as in "$x =& $this->mStripState;"), and in fact it's probably just simpler to get rid of $x altogether.
* Moving some preg regexes from "" quoting to '' quoting to stop static analyzer whinging about bad escape sequences.

... up to "LinksUpdate.php" in the includes/ directory.
2006-11-23 08:25:56 +00:00
Tim Starling
b4ccf8ae4a Removed broken redundant fallback to the Language message array. Message arrays are now merged pre-cache. It's a static call on a non-static function, it actually calls back to $wgMessageCache->load(), destroying the per-process message cache on every cache miss. 2006-11-16 16:49:23 +00:00
Tim Starling
5e60b97c3f Some message caches are over 1MB 2006-10-08 23:24:43 +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
Rotem Liss
ad8032b081 Creating the function MessageCache::getExtensionMessagesFor, to get an array of the extension messages in a specific language, and avoid the ugly hack in Special:Allmessages, which uses a private variable of wgMessageCache and uses is_array to check the array of messages, which includes both regular strings (as should be) and arrays of the languages. 2006-09-03 16:31:28 +00:00
Tim Starling
bf3e61374f Introduced hook function for requesting that extension messages be loaded 2006-08-24 16:58:44 +00:00
Tim Starling
dfe83d198c It broke things 2006-08-10 09:10:06 +00:00
Rotem Liss
dd6b0fcbcb * Correctly get messages which use the form "mainpage/fr" even if they were not created in the database, but only in the language file. This allows us to specify things like {{int:mainpage/fr}} without creating MediaWiki:Mainpage/fr (as we do in {{int:mainpage}}), and to view the default content of pages like MediaWiki:Mainpage/fr without creating them (as we do in MediaWiki:Mainpage). For this, creating a new static function - Language::getMessageFor - and getting the message for the language with it. This parsing applies only for messages with the "/" symbol (there are no such messages), so it should not break things.
* Because we define the messages 'january-gen', 'february-gen', etc. as the genitive forms of months in Langauge::mMonthGenMsgs, I created them in the English file. This should fix the test of {{CURRENTMONTHNAMEGEN}} in the parser tests (currently seems to output "<january-gen>"), and should fix the wrong output of checkLanguage.php and transstat.php, which think that these messages are obsolete.
* Using the genitive forms of the months in Hebrew
* (bug 6939) Update to Indonesian localisation (id) #31
2006-08-07 12:21:06 +00:00
Tim Starling
e46eb0fff5 Improved negative caching 2006-08-05 14:12:34 +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
6c83557757 Call firstCallInit() before cloning $wgParser. 2006-07-04 09:13:10 +00:00
Tim Starling
124cec8946 Better to clone $wgParser rather than use it, otherwise things like {{int:}} would be broken. 2006-07-03 11:17:27 +00:00
Tim Starling
8e452c22a7 Use $wgParser instead of constructing a new parser object. Constructing a new one is now more expensive than ever. 2006-07-03 11:08:02 +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
Rotem Liss
f7062e6f48 Extension messages translation is now possible. 2006-06-30 20:46:54 +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
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
Domas Mituzas
e6085d6e36 AutoLoad Revision 2006-06-06 10:56:46 +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
1f1b942c96 * (bug 6126) Allow fallback to customized primary language when user language
message contains '-'; fixes licenses selector on Commons configuration after
  recent addition of the message to Messages.php
2006-05-31 08:05:38 +00:00
Domas Mituzas
00cb0d116b MessageCachePHP: throw out stupid RE, use simple str_replace's 2006-05-29 05:49:03 +00:00
Domas Mituzas
71ffa3756a Allow storing local message cache as PHP source instead of serialized array, this way opcode cache is enjoyed :-) Might be not that secure, so disabled by default. 2006-05-28 18:29:42 +00:00
Antoine Musso
7ebdb6de89 Revert to r14165 . Did too many changes, didnt even run parserTests (i am bad) 2006-05-11 22:40:38 +00:00
Antoine Musso
bc14eb8045 Replacing var keyword with private / public as we now require PHP5. 2006-05-11 19:10:41 +00:00
Brion Vibber
4ff45a89d0 Remove yet more stray executable bits. The last, I hope. 2006-04-04 08:01:19 +00:00
Tim Starling
01a2998b95 preload hook 2006-02-11 11:41:46 +00:00
Domas Mituzas
0e2748f098 SIDEBAR CACHE WILL SURVIVE!!!!!!11111oneoneone 2006-01-14 22:13:43 +00:00
Brion Vibber
ece1fbdc76 Quick fix: revert cached sidebar
Breaks badly due to user language selection
2006-01-14 17:09:32 +00:00
Domas Mituzas
d170edc72f the revert at will style commit: cached sidebar :-) 2006-01-13 23:57:02 +00:00
Ævar Arnfjörð Bjarmason
a26d5a49d7 * s~\t+$~~ 2006-01-07 13:31:29 +00:00
Ævar Arnfjörð Bjarmason
7bbe971aec * s~ +$~~ 2006-01-07 13:09:30 +00:00
Tim Starling
b071c6fc4d Yes, really world writeable 2006-01-04 23:24:25 +00:00
Tim Starling
35a281ff88 suppress warnings from local message cache fopen() 2005-12-30 08:50:59 +00:00
Antoine Musso
2ca68a256d Clean up unused globals! 2005-12-04 18:27:59 +00:00
Ævar Arnfjörð Bjarmason
cb0a54af65 * Accessor/Mutator for $mDisableTransform, should all be merged into one with
wfSetVar() but I'm too lazy.
2005-11-28 01:14:12 +00:00
Tim Starling
6d82fa2f15 Added local message cache feature ($wgLocalMessageCache), to reduce bandwidth requirements to the memcached server. 2005-11-08 11:54:04 +00:00
Brion Vibber
219094eb01 Committing various live hacks from Wikimedia servers 2005-10-22 20:52:30 +00:00
Tim Starling
ce9d5692f1 Workaround for memcachedism 2005-09-11 17:33:25 +00:00
Tim Starling
5dd3b4903f * Negative caching for the MediaWiki namespace. This is especially important when the user language is different to the content language.
* Allow messages to be blank, without them being considered missing
2005-09-11 14:50:47 +00:00
Tim Starling
fbeef2d0fb respect $useDB 2005-08-14 07:21:43 +00:00
Brion Vibber
1960085c1a * Fix Special:Allmessages under PHP 5 2005-07-31 00:25:55 +00:00
Ævar Arnfjörð Bjarmason
fcaddb96af * Using addMessage() inside addMessages() instead of modifying
mExtensionMessages directly
2005-07-22 20:35:08 +00:00
River Tarnell
291c848de6 try a different way of handling the message cache 2005-07-07 03:08:58 +00:00
Ævar Arnfjörð Bjarmason
ed9232300b * Documented 2005-06-26 15:30:50 +00:00
Tim Starling
6d7456c82c less debug log spam 2005-05-28 11:07:55 +00:00
Tim Starling
4b390e9c9b fixed potential XSS vulnerability 2005-05-14 05:42:29 +00:00
Domas Mituzas
83514a73a5 revert my cruft regarding incremental message cache building, it targetted wrong trouble in wrong path anyway 2005-05-04 19:24:10 +00:00