Commit graph

15 commits

Author SHA1 Message Date
Roan Kattouw
ee57148775 (bug 26535) Variable naming collision in MessageBlobStore::updateMessage() caused exception ('Non-string key given' in MessageCache) when conflicted updates were retried. 2011-01-06 15:13:24 +00:00
Tim Starling
82f274088a * Introduced Xml::encodeJsCall(), to replace the awkward repetitive code that was doing the same thing throughout the resource loader with varying degrees of security and correctness.
* Modified Xml::encodeJsVar() to allow it to pass through JS expressions without encoding, using a special object.
* In ResourceLoader::makeModuleResponse(), renamed $messages to $messagesBlob to make it clear that it's JSON-encoded, not an array.
* Fixed MessageBlobStore to store {} for an empty message array instead of [].
* In ResourceLoader::makeMessageSetScript(), fixed call to non-existent function mediaWiki.msg.set.
* For security, changed the calling convention of makeMessageSetScript() and makeLoaderImplementScript() to require explicit object construction of XmlJsCode() before interpreting their input as JS code.
* Documented several ResourceLoader static functions.
* In ResourceLoaderWikiModule, for readability, reduced the indenting level by flipping some if blocks and adding continue statements.
* In makeCustomLoaderScript(), allow non-numeric $version. The only caller I can find is already sending a non-numeric $version, presumably it was broken. Luckily there aren't any loader scripts in existence, I had to make one to test it.
* wfGetDb -> wfGetDB
* Added an extra line break in the startup module output, for readability.
* In ResourceLoaderStartUpModule::getModuleRegistrations(), fixed another assignment expression
2010-11-04 07:53:37 +00:00
Alexandre Emsenhuber
31ea8d2bca Fixed some doxygen warnings and consistency in documentation 2010-10-23 21:01:54 +00:00
Roan Kattouw
def8f59b6c (bug 25474) Fix wrong parameters in updateModule() call. r74525 tried to fix this, but missed the point. Patch by Borislav Manolov 2010-10-11 08:32:48 +00:00
Trevor Parscal
e6ed90f56e * Improved on r73971 by removing the $name parameter from MessageBlobStore::gerenateMessageBlob, since it was not being used.
* Fixed bug introduced in r73971 caused by using a module name rather than a module object in MessageBlobStore::updateModule
2010-10-08 18:42:20 +00:00
Roan Kattouw
8e65282ff6 (bug 25201) Respect $wgCacheEpoch in the resource loader
* The mtime of each module is now maxed with $wgCacheEpoch before being used. I chose to make this the caller's responsibility rather than getModifiedTime()'s, otherwise custom modules can (and inevitably will) forget to respect $wgCacheEpoch
* Invalidate message blobs if they're older than $wgCacheEpoch
2010-10-07 19:35:05 +00:00
Roan Kattouw
b3a3886752 Remove obsolete TODO comment 2010-10-07 17:56:43 +00:00
Trevor Parscal
d79eac20f3 Fixed a use of ResourceLoader::getModule as a static method when converting things over in r73971. 2010-09-29 21:13:56 +00:00
Trevor Parscal
016fbe7a81 Made ResourceLoader an instantiable object, rather than a static one, making it more modular and testable. 2010-09-29 19:04:04 +00:00
Roan Kattouw
b334000f35 Revert r72816 and do it properly: the SELECT should be executed on the master 2010-09-27 15:51:47 +00:00
Tim Starling
004f1edb37 Minor resource loader changes:
* Broke some long lines, converted some overly complex ternary operators to if()
* Added lots of line breaks into the output, for easier debugging.
* Added profiling for various functions.
* wfGetDb -> wfGetDB
* Fixed escaping in ResourceLoaderStartUpModule::getScript(), escape for JS rather than assuming Html::linkedScript() won't have any bad characters in it.
2010-09-17 11:45:49 +00:00
Niklas Laxström
a38d7f82bf Canonical case for function and whitespace fixes 2010-09-11 15:55:02 +00:00
Niklas Laxström
8e9cc0accf $dbr was undefined 2010-09-11 15:48:21 +00:00
Siebrand Mazeland
3f501420ee Stylize files added in r72349 2010-09-04 12:53:01 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00