Commit graph

163 commits

Author SHA1 Message Date
Tim Starling
79a7b5455e General fix for trailing whitespace in messages, so that we don't have to put bugfix hacks at hundreds of places in the code to preserve HTML entities in messages that are formally plain text. Based on discussion with Nikerabbit. 2009-06-04 07:26:46 +00:00
Alexandre Emsenhuber
f1199b072d * fix MessageCache::get()'s $isFullKey param: full key is "msg/lang" as in MediaWiki namespace, not "lang/msg"
* whitespaces tweaks
2009-05-16 20:12:29 +00:00
Tom Maaswinkel
c028124f8e Added a new hook to handle messages that aren't found in the Mediawiki Namespace (before checking the message files) 2009-05-14 21:38:45 +00:00
Chad Horohoe
0ea3a0c7da Add $this as a parameter to LoadAllMessages. 2009-05-07 18:49:57 +00:00
Emil Podlaszewski
f04ca60561 Added new hook 'MessageCacheReplace' into MessageCache.php. For instance
to allow extensions to update caches in similar way as MediaWiki invalidates
a cached MonoBook sidebar
2009-04-08 14:23:14 +00:00
Aaron Schulz
ed09ebcffb Tweak for bug 11852. Made handling of message cache key normalisation more consistent. 2009-02-17 15:36:15 +00:00
Tim Starling
ed529ce860 Added some profiling sections for expensive functions 2009-02-17 03:26:39 +00:00
Brion Vibber
76f9b0b973 Run parsemag stuff through the proper language when wfMsgExt() asks for a specific one.
Previously we only passed on if we were interface or content, but if we're rendering for some third alternative it didn't get used.
Note that parse and parseinline are probably still wrong.... some better model may be required here.
Also it may be wrong in the case of fallbacks ... if you get an English message, is it right to use the Czech magic word parsing?
Hmm.
Might back it out if there's a better way. :)
2008-11-13 01:02:17 +00:00
Tim Starling
5f2680289f Fixed regression from r35821: the status key is meant to prevent DB overload, not memcached overload. 2008-10-10 13:02:57 +00:00
Alexandre Emsenhuber
02c8f58aa3 * Display default extensions messages for language subpages when the page being edited doesn't exist
* Fix MessageCache::figureMessage() to allow slashes in message name
2008-10-07 18:10:08 +00:00
Tim Starling
350b498b9f * Revert back to my parser pseudo-branch again. Note: if you feel like reverting this, reverting Parser.php alone to r40010 will work just fine.
* Merged replaceFreeExternalLinks() with doMagicLinks(). Makes a lot of sense, very similar operations, doesn't break any parser tests. Stops free links from interacting with other parser stages, the same way ISBN links don't. 
* The pass order change fixes Brion's complaint in r39980. Early link expansion, triggered by having more than 1000 links in the page, was outputting URLs which were destroyed by RFEL. Added parser test.
* Fixed an unrelated bug in LinkHolderArray::replace(): if a link to a redirect appears in two separate RLH calls, the second and subsequent calls do not add the mw-redirect class. Caused by an unmigrated LinkCache fetch.
* Added a parser test for a pass interaction bug that the pass order change fixes.
* The fuzzer told me to tell you that free external links in non-caption image parameters, which are and have always been invisible, are now not registered either.
* Miscellaneous supporting updates to the test infrastructure.
2008-08-26 14:37:15 +00:00
Fran Rogers
3ad5bfb749 Fix for problems with r39414; LinkHolderArray::replaceInterwiki() was badly broken 2008-08-16 10:13:35 +00:00
Siebrand Mazeland
2dedbbdfa1 Revert r39414. Breaks processing links like [[:wikipedia:nl:User:Siebrand|Dutch language Wikipedia]]. It will add a comment like "<!--IWLINK 0-->" in the HTML output. Happens even if there is one such link on a page. 2008-08-16 09:33:11 +00:00
Tim Starling
c45292ac40 * In the parser: do link existence tests in batches of 1000. Avoids using excessive memory to store Title objects.
* Split link placeholder/replacement handling into a separate object, LinkHolderArray.
* Remove Title objects from LinkCache, they apparently weren't being used at all. Same unconstrained memory usage as the former $parser->mLinkHolders.
* Introduced ExplodeIterator -- a workalike for explode() which doesn't use a significant amount of memory
* Introduced StringUtils::explode() -- select whether to use the simulated or native explode() depending on how many items there are
* Migrated most instances of explode() in Parser.php to StringUtils::explode()
* Renamed some variables in Parser::doBlockLevels()
* In Parser.php: $fname => __METHOD__, Parser => self/__CLASS__, to support Parser_DiffTest more easily
* Doc update in includes/MessageCache.php for r39412
* MW_TITLECACHE_MAX => Title::CACHE_MAX, nicer name, easier to access from another module
2008-08-15 16:35:03 +00:00
Chad Horohoe
d3116f845d Should be the last of the 0777's :)
* Use wfMkdirParents() instead of mkdir() with a recursive argument. 
* Also, allow $wgDirectoryMode take over, instead of hardcoding 0777.
* +formatting
2008-08-08 14:24:05 +00:00
Alexandre Emsenhuber
a4cfa79ea8 * factorize common code
* allow to pass directly a Language object
2008-07-26 20:41:52 +00:00
Shinjiman
6dc2f67fff * Re-implement the message caches for r35821
* Tweaked the message fetching on the MediaWiki:Conversiontable/xx-xx by changes of the message caching
  patch by Nikerabbit
2008-07-05 15:39:10 +00:00
Brion Vibber
918ec72c43 Revert the rest of r36804 -- ExtendJSGlobalVars and wfMessageCacheReplace hooks.
ExtendJSGlobalVars is probably ok in function, though I don't really like its name.

wfMessageCacheReplace seems really unclear as to what it's trying to accomplish.
2008-07-02 22:56:15 +00:00
Jack Phoenix
599b5a42d0 Two new hooks and one new global function from Wikia codebase 2008-06-30 08:42:09 +00:00
Shinjiman
4c2546b551 Revert r35821, the change brokes the message cache what the MediaWiki:Conversiontable/xx-xx are using, also this would lose the effects what have been set in the MediaWiki:Conversiontable/xx-xx. 2008-06-30 03:02:06 +00:00
Niklas Laxström
e648c5fe13 * Second try of split message caches with changes suggested by Tim Starling and other small fixes
* removed use of umask, wfMkdirParents works now
 * splitting of messages per language is now unconditional
 * storing cached messages in 2-d array of code => messages
 * fixed a bug in replace(), now deletion works properly
 * clear() should actually do something now
 * try to delay parser creation in transform()
 * removed the use of $memcPrefix and wfMemcKeyLang() in favour of wfMemcKey()
 * escape $code in loadFromDb()
 * use member variable instead of static variable for tracking loaded languages
2008-06-03 20:41:57 +00:00
Tim Starling
f3bffd7ca9 Revert r35478, r35264, r35262: $wgPerLanguageCaching feature. Bug found with $wgPerLanguageCaching=false. Nikerabbit, please see me for a detailed code review. 2008-06-01 03:27:48 +00:00
Alexandre Emsenhuber
87afc79d3b E_NOTICE: undefined variable $code in MessageCache::saveToCaches() 2008-05-28 12:17:03 +00:00
Niklas Laxström
0f5e68b417 * New option $wgPerLanguageCaching, for wikies with many translated system messages in MediaWiki namespace.
* Sidebar is now cached for all languages
2008-05-23 22:14:32 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Robert Leverington
32494abdb1 * $name instead of $file.
* Remove unnecessary if.
2008-05-05 15:03:42 +00:00
Robert Leverington
fd880384c4 * Use wfLoadExtensionMessages() in MessageCache::loadAllMessages() instead of MessageCache::loadMessagesFile(). 2008-05-05 15:00:16 +00:00
Robert Leverington
deca107b90 * wfLoadExtensionMessages() now accepts a language code as its second argument, rather than a boolean indicating whether or not to load all messages. This allows extension developers to be more discriminate with regards to which languages they load, avoiding the problem of loading lots of message localisations and fall backs not being merged in. 2008-05-05 13:29:51 +00:00
Robert Leverington
225c34df76 Revert r33918, no longer works given new fallback caching and there are alternate methods for determining message fallback. 2008-04-27 14:50:55 +00:00
Robert Leverington
8e3967d0a9 * Add parameter to MessageCache::get() to allow prevention of using a fallback language (default: false).
* Add option to wfMsgExt() 'nofallback' as an interface to the new parameter added to MessageCache::get().
2008-04-26 18:05:43 +00:00
Alexandre Emsenhuber
6a6482ab0c * Simplify a bit MessageCache::get(), don't load all valid languages name if the value passed is boolean
* do the same in wfMsgGetKey()
2008-04-24 13:02:32 +00:00
Robert Leverington
932aa091c7 * MessageCache::get $forContent parameter replaced with $langcode parameter so
that messages can be retreieved for any language.
* wfLoadExtensionMessages() now has the option to load messages for all the
  languages it contains.
* 'language' option added to wfMsgExt() so that a message can be retreieved from
  a specific language.
2008-04-24 11:59:32 +00:00
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