* Rewrote ObjectCache.php to conform to the modern coding style, and to be less convo...
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 3 Mar 2011 09:37:37 +0000 (09:37 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 3 Mar 2011 09:37:37 +0000 (09:37 +0000)
commitbe76d86932bea59ea18d729b28d05fbc4775cf25
treed387d4d4ef3efe1842f4f0c6c0b9d295824d64c9
parenta9bba5464972fb8ea5a923cb1b5c7bde86e02d4f
* 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
14 files changed:
includes/AutoLoader.php
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/Setup.php
includes/objectcache/BagOStuff.php
includes/objectcache/EmptyBagOStuff.php [new file with mode: 0644]
includes/objectcache/MemcachedClient.php
includes/objectcache/MemcachedPhpBagOStuff.php [new file with mode: 0644]
includes/objectcache/MultiWriteBagOStuff.php [new file with mode: 0644]
includes/objectcache/ObjectCache.php
includes/objectcache/SqlBagOStuff.php
maintenance/mcc.php
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php