Commit graph

807 commits

Author SHA1 Message Date
Tim Starling
24bf07cc86 * Add a $count argument to wfIncrStats(), to allow it to increase the count by more than one at a time.
* Added stats to job insert and pop.
* Formalised live patch for UDP stats aggregation, adding $wgAggregateStatsID.
2011-03-10 00:00:34 +00:00
Antoine Musso
8a3dcccbda Remove second parameters from wfEmptyMsg() calls
The second parameter was removed in r64178 and is now useless.
There is probably no need to backport this in 1.17.
2011-03-07 17:10:22 +00:00
Tim Starling
be76d86932 * Rewrote ObjectCache.php to conform to the modern coding style, and to be less convoluted about how CACHE_ANYTHING and CACHE_ACCEL are resolved. Moved most functionality to static members of a new ObjectCache class.
* Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions). 
* Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType. 
* Made all object cache classes derive from BagOStuff. 
* Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension.
* Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches.
* Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used.
* Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff.
* Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB.
* Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches.
* Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff.
* Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class.
* Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore
* Fixed spelling error in MWMemcached: persistant -> persistent
2011-03-03 09:37:37 +00:00
Sam Reed
baf83f74b8 More explicit variable definitions, function documentation 2011-02-20 13:33:42 +00:00
Brion Vibber
7d2049c7e3 * (bug 26250, bug 23817) Fix wfObjectToArray() to descend into arrays; fixes processing of JSON return values for ForeignAPIRepo when native json module not present 2011-02-13 23:04:34 +00:00
Alexandre Emsenhuber
b2a0cc74d5 Moved wfGetSiteNotice(), wfGetNamespaceNotice() and wfGetCachedNotice() to Skin call to allow passing the Skin object to the SiteNoticeBefore and SiteNoticeAfter hooks.
I didn't left compatibility functions since there's no other call to these functions in core or extensions.
2011-02-12 21:24:05 +00:00
Tim Starling
62afaa0972 Merge r81718 from 1.17wmf1 2011-02-08 12:08:21 +00:00
Antoine Musso
0fc566e318 Ignore code coverage for compatibility and shell functions
The compatibility functions in GlobalFunctions are just wrapper for
their equivalent in the Fallback class.  We should test the implementation
and we can safely ignore those wrappers.

Shell functions ignored make use of sleep() which is evil. They also
do some outputs to the console which is probably hard to test properly.
Given they are not critical, I just ignore their code coverage, we can
still test them though :)
2011-02-06 22:14:32 +00:00
Antoine Musso
8f45c9e03a bugfix for wfBCP47 and code coverage
Language code are case insensitive. The BCP 47 recommands nice
formatting nonetheless. This patch enhance our formatting:
- tags preceded by the private tag 'x' are now lower case
- 4 letters tags are now lower case with first letter uper cased

Please note the RFC seems to have a bug for az-Arab-x-AZE-derbend
which should be az-Arab-x-aze-derbend .  I have changed our test
to reflect this and added a comment for later reference.
2011-02-06 14:47:35 +00:00
Alexandre Emsenhuber
136f4c06fa Deprecated wfMsgWeirdKey(), use wfMessage() instead. Moved getDefaultMessageText() from Article to Title so that it can be used there instead of duplicating code. No usage in extensions. 2011-02-05 15:11:52 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Ilmari Karonen
2fcb5285c3 bug 26781: make wfEscapeWikiText() escape "*", "#", ";" and ":" at the beginning of the output and after line feeds. Also make escaping of "{", "}" and "=" more thorough and rewrite to use strtr() instead of str_replace() and htmlspecialchars(). 2011-01-18 19:39:13 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Daniel Friesen
2f933fedba Fix bug 14267 by adding support for a MediaWiki:Mainpage-nstab.
Additionally, *cough* *cough*:
* Add a Title::isMainPage helper for the fairly common $title->equals( Title::newMainPage() ); test.
* Update wfMessageFallback to also accept an array of message keys instead of requiring them listed as arguments to the function.
* Move the bulk of wfMessageFallback code into Message.php instead of leaving it in GlobalFunctions.php
* Change the wfMessageFallback implementation so that the Message class handles the fallbacks themselves eliminating any side effects caused by the fact that wfEmptyMsg always used usedb=false, language=userlang when one might actually use a different language or usedb setting in the message object that actually returned the text (this may be considered a wfEmptyMsg regression in 1.18).
* Make blank "" message contents fallback like nonexistant messages do.
* Re use the new tabAction array handling used to support mainpage-nstab in the talk and view tabs instead of making wfEmptyMsg calls directly in SkinTemplate.
2011-01-14 08:32:10 +00:00
Alexandre Emsenhuber
1e22a9dbde Allow OutputPage::parse() to parse in any langauge, modified wfMsgExt() and wfMessage() accordingly 2011-01-05 12:24:39 +00:00
X!
e1f21873d5 Fix r79494: Don't prefix functions now that they're in their own class 2011-01-04 01:44:11 +00:00
X!
1d0ac4a481 Move wfCreateObject to MWFunction::newObj. This uses the ReflectionClass to
instantiate a variable-length constructor in php 5.1.3 and up, and falls
back to the old, ugly, manual method that was in the old wfCreateObject
function. The instances in the core have been replaced.
2011-01-03 02:10:05 +00:00
X!
cbff3fe980 Followup to r79463: Move fallback functions to new Fallback class 2011-01-02 15:54:18 +00:00
X!
7d686e0164 GlobalFunction additions:
-in_string has a case-insensitive option
-wfClientAcceptsGzip has a force option to force resetting the static value, useful for unit tests

Unit tests for more global functions added
2011-01-02 04:38:04 +00:00
X!
cb424e7ad6 Fix r79463 and r79464: Syntax error 2011-01-02 01:35:24 +00:00
X!
c7341928d7 Accidental syntax error. *hides* 2011-01-02 01:34:26 +00:00
X!
373389b98f Move fallback function creation out of function_exists() conditionals.
This allows for unit testing of the fallback functions to ensure that
they work like the real functions do
2011-01-02 01:29:00 +00:00
Daniel Friesen
c510db2665 Merging Vector's navigation_urls and SkinTemplate's content_actions code into content_navigation. content_actions is now built by folding content_navigation and cleaning it up a bit.
content_actions hooks no longer work and have been dropped from the code, the hooks that affected vector before now affect all skins.
A few logic changes were made to make for a clean merge:
- vector was using vector-???-??? messages while SkinTemplate was using '???' messages. So as a side effect of merging that together all skins now support messages like '$skinname-view-history' which will fallback to the standard message if not defined.
- For MediaWiki: pages where the page does not exist but the message does in the i18n system SkinTemplate displayed "Edit" while Vector displayed "Create"; All skins now display "Edit".
- For users without undelete permissions SkinTemplate displayed an "Undelete" tab if the user had deletedhistory and deletedtext permissions. Vector would only display the tab for users with both deletedhistory and undelete permissions; The new behavior in all skins is to always display a tab if you have deletedhistory (since Special:Undelete will always have something to display) but display a "View ... deleted" instead of "Undelete" message if you do not have undelete permissions.
- Skins no longer need to hardcode tests for the &action= to decide if they should ignore the accesskey on some tabs, tabs which should not have an accesskey in the current page now have a "tooltiponly" key set to true.
2010-12-31 23:30:00 +00:00
X!
1993c83277 -Destroy the DB automatically when initting the DB
-Add $force option to wfSetVar
-More work on getting SQLite to work
2010-12-30 17:30:35 +00:00
Platonides
62f2f7b879 Fix r71751 problems with textual parameters.
Add a test for checking the problems which appeared in r71751
2010-12-30 16:10:42 +00:00
Sam Reed
50a74880a7 Followup r79229, fix varible type fail 2010-12-30 02:45:28 +00:00
Sam Reed
490367210b Add function return type hint to wfGetLBFactory
More parameter documentation to CloneDatabase
2010-12-30 02:44:26 +00:00
Roan Kattouw
341c94a05d Fix r79213: and $ts === null too, per CR 2010-12-29 22:30:07 +00:00
Roan Kattouw
093c65ec82 Followup r71751: change strict comparison to loose per CR, and add a comment explaining why 2010-12-29 22:28:26 +00:00
Mark A. Hershberger
aa08646a71 Misc whitespace changes, mostly EOL w/s and indention fixes so TAB = 4 spaces 2010-12-19 04:31:15 +00:00
Bryan Tong Minh
c71e58f76f Follow-up r75476: Windows set command treats everything until the && as part of the environment variable, resulting in a trailing whitespace which breaks stuff. 2010-12-18 15:00:11 +00:00
Chad Horohoe
9c84094cd0 * Handle output for DatabaseUpdater in the class itself, no more wfOut() usage in core :)
* Mark wfOut() deprecated
* CheckUser, OpenID and TitleKey still use wfOut :(
2010-12-17 15:31:01 +00:00
Tim Starling
84f3b30f9c Update references for wfEscapeShellArg() for r69732 etc. The very useful mailing list post that I cited has disappeared from the web! 2010-12-14 10:57:41 +00:00
Niklas Laxström
1f5ad5ffac Better debug logging which isn't misleading 2010-12-10 14:40:50 +00:00
Niklas Laxström
81791368a8 Don't unstub $wgOut just for adding debug messages 2010-12-10 12:03:39 +00:00
Siebrand Mazeland
af8b9eec6d * remove wfSeedRandom() which was marked for removal in 1.18.
* mark wfGetMimeMagic() for removal in 1.19.
* have wfLoadExtensionMessages() whine deprecated per comments and mark for removal in 1.20.
2010-12-09 11:31:09 +00:00
Platonides
a21b365848 Move wfQuotedPrintable() into UserMailer class 2010-12-08 23:09:29 +00:00
Platonides
1efb3c666a Follow up r77884. 2010-12-07 16:26:10 +00:00
Alexandre Emsenhuber
1f9be9ead2 Per Nikerabbit, follow-up to r77972: use a string instead of boolean for readability 2010-12-07 15:47:34 +00:00
Alexandre Emsenhuber
30caa2a8b9 Merged wfDoUpdates() and MediaWiki::doUpdates() in wfDoUpdates(); avoids code duplication 2010-12-07 11:49:13 +00:00
Alexandre Emsenhuber
cb6f556784 * (bug 26253) Removed $wgPostCommitUpdateList
As I said on the bug, this variable is not used since ages
2010-12-06 16:17:43 +00:00
Chad Horohoe
a13767d10f Cleanup r77883, contained unrelated debugging change 2010-12-06 15:34:28 +00:00
Chad Horohoe
0022d5ba4d Remove "checking for latest version" feature from the new installer. Originally a proof-of-concept, and I'm not satisfied with its state of completion enough to include it for 1.17. Reverts r71107, r71110, r71111, r71115, r71564, r65863, r57624, probably some others. 2010-12-06 15:32:32 +00:00
Antoine Musso
5cdd7614d5 pipe does not look nice in doxygen. fu r77499 2010-12-02 19:33:15 +00:00
Roan Kattouw
5173c6abe0 Correct typo in doc comment 2010-12-02 16:42:38 +00:00
Mark A. Hershberger
a465346c6e random w/s cleanup 2010-12-01 20:22:45 +00:00
Sam Reed
7320879184 Few braces and spaces
Fixing up documentation
2010-11-30 19:06:28 +00:00
Sam Reed
e76775e06f More unused variables 2010-11-30 18:44:50 +00:00
Platonides
ba3fd81ced Follow up r77407. Do it Right.
Fixes wfTimestamp() returning 0 instead of now.
2010-11-28 22:51:25 +00:00
Platonides
6c61f8f21c Fix bug introduced in r77171 2010-11-28 22:40:29 +00:00