Commit graph

131 commits

Author SHA1 Message Date
Siebrand Mazeland
bfc3734308 Remove getKeys(). Unused in core and extensions in SVN. 2008-04-20 18:52:24 +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
Alexandre Emsenhuber
e594cb011a * (bug 13431) Show true message source in Special:Allmessages&ot=php / xml
* Use Xml::* functions instead of wf* ones
* Call wfDeprecated() in MessageCache::disableTransform(), MessageCache::enableTransform(), MessageCache::setTransform() and MessageCache::getTransform()
2008-04-02 11:49:55 +00:00
Alexandre Emsenhuber
0d69ec9920 per r32027, use wfDeprecated() instead of trigger_error() 2008-03-16 18:26:10 +00:00
Tim Starling
870e2c7e32 * Fix bug 13002
* Fix excessive memory usage in MessageCache::loadFromLocal()
2008-02-13 05:46:43 +00:00
Tim Starling
5999d65b60 Fixed total breakage of the local message cache since r30437 2008-02-10 14:29:17 +00:00
Tim Starling
97522367b2 Reset the message cache on action=purge of a MediaWiki namespace page. Delete the sidebar cache *after* the message cache is updated, not before. If you delete it before then the same version might get cached again. 2008-02-09 10:01:35 +00:00
Niklas Laxström
186eb4ba30 * (bug 12880) wfLoadExtensionMessages does not use $fallback from MessagesXx.php 2008-02-02 20:33:25 +00:00
Niklas Laxström
0d1fc50c69 * Refactor a little to reduce code duplication
* Check language code validity
2008-02-02 18:15:57 +00:00
Brion Vibber
8b84dcd187 Apply a live hack from Wikimedia codebase: throw exception on invalid input to MessageCache::addMessages() 2008-01-29 01:04:29 +00:00
Tim Starling
6bfc746e83 * Eliminated message mode (OT_MSG), using OT_PREPROCESS instead. As proposed on wikitech-l.
* Fixed #tag behaviour in preprocess()
* Fixed #tag quote stripping regex
* Made MessageCache::getMessage() never transform its result, that is now left up to the caller. 
* A few other minor changes
2008-01-19 09:03:45 +00:00
Niklas Laxström
b20844540e * (bug 11452) wfMsgExt uses sometimes wrong language object for parsing magic words when called with options ''parsemag'' or ''content''. 2007-10-22 19:33:46 +00:00
Rotem Liss
44215dc542 If no messages are specified in the extension file, don't load them. 2007-09-10 22:53:17 +00:00
Tim Starling
5cb6ceee73 Allow extensions to define magic words by simply including a $magicWords variable in their registered i18n file. 2007-09-04 02:48:34 +00:00
Tim Starling
164bb322f2 Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.

Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
Rotem Liss
c2663cae7e This function is now not completely new, thus new extensions which don't have to be backwards-compatible can use it. 2007-07-11 15:24:33 +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
Tim Starling
234929d3ba 2nd attempt 2007-04-27 16:39:21 +00:00
Tim Starling
2461522f1c Fix MessageCache issue which caused the MediaWiki namespace to be ignored on the second call to wfMsg() for the same key. 2007-04-27 16:36:34 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Nick Jenkins
784e69d028 For the "includes/" directory:
* removing unused local vars
* removing used global declarations
* adding FIXMEs against extract() calls and lines that seem to be using uninitialized variables
* adding some array() declarations.
2007-01-12 10:03:51 +00:00
Brion Vibber
28844ed5c5 Fix regression in pulling *non*-default messages with spaces. Broke sidebar on www.mediawiki.org 2007-01-09 00:21:55 +00:00
Brion Vibber
efdffb2bca Fix regression in use of messages with underscores/spaces; normalize spaces to underscores for loading 2007-01-09 00:00:56 +00:00
Tim Starling
fee5bf298f fix breakage of wfEmptyMsg 2007-01-07 15:43:23 +00:00
Tim Starling
6b914045d7 Correct behaviour for title-case key input. 2007-01-07 14:22:32 +00:00
Rotem Liss
64cdd7bf34 Adding MessageCache::addMessagesByLang for localised extensions. Please do not use it for now, for backwards compatibility. 2007-01-06 18:29:53 +00:00
Tim Starling
fbe8b94bbe * The MediaWiki namespace is no longer pre-filled with default messages on install. All default messages will be removed from the MediaWiki namespace on upgrade.
* Swapped the order of dimensions in the 2-d array $wgMessageCache->mExtensionMessages.
2007-01-05 18:08:29 +00:00
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