Clean up after Ie161e0f
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 30 Jan 2016 01:09:57 +0000 (20:09 -0500)
committerAnomie <bjorsch@wikimedia.org>
Wed, 3 Feb 2016 21:45:18 +0000 (21:45 +0000)
commit25dbd91513f1e55ee2ae9f01ef6abce648376a32
treeb3479b129c7af9a59326ccf1a30aa9e93bada75e
parent2257fe42288cca06376e5caf45aa32da9d0216cf
Clean up after Ie161e0f

Ie161e0f was done in a hurry, and so didn't do things in the best ways.
This introduces a new "CachedBagOStuff" that transparently handles all
the logic that had been copy-pasted all over in Ie161e0f.

The differences between CachedBagOStuff and MultiWriteBagOStuff are:
* CachedBagOStuff supports only one "backend".
* There's a flag for writes to only go to the in-memory cache.
* The in-memory cache is always updated.
* Locks go to the backend cache (with MultiWriteBagOStuff, it would wind
  up going to the HashBagOStuff used for the in-memory cache).

Change-Id: Iea494729bd2e8c6c5ab8facf4c241232e31e8215
12 files changed:
autoload.php
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/CachedBagOStuff.php [new file with mode: 0644]
includes/session/SessionBackend.php
includes/session/SessionManager.php
tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php [new file with mode: 0644]
tests/phpunit/includes/session/CookieSessionProviderTest.php
tests/phpunit/includes/session/ImmutableSessionProviderWithCookieTest.php
tests/phpunit/includes/session/PHPSessionHandlerTest.php
tests/phpunit/includes/session/SessionBackendTest.php
tests/phpunit/includes/session/SessionManagerTest.php
tests/phpunit/includes/session/TestBagOStuff.php